Tool use / function calling concept page. LLM returns structured tool_use blocks (JSON args via tool schema), runtime validates/executes/returns tool_result. Anthropic/OpenAI/Gemini parallel tool calls. MCP (Model Context Protocol, Anthropic Nov 2024) for vendor-agnostic standardized tool servers. 4 scenarios: simple weather call, parallel 5-tool fan-out, MCP filesystem+git, failure modes (hallucination/bad-args/injection). 2 ADRs (function calling vs MCP vs custom; parallel vs sequential).
A language model can propose a tool name and arguments, but generated structure is still untrusted input. The application must resolve a known tool, validate schema and semantics, authorize the exact caller and target, and handle side effects under ordinary distributed-systems failure modes.
Resolve, validate, authorize. A generated call becomes executable only after registry, schema, semantic, and policy checks.
Confirmed mutation with durable identity. The executor records intent before a side effect and accepts only approval for the same fingerprint.
Timeout and reconciliation. A network timeout can hide a completed mutation; blind retries are forbidden.
Tool result is untrusted data. A webpage, file, database row, or error can contain instructions intended to control the next model call.
Publish a minimal versioned tool registry, reject unknown fields and tools, authorize every exact resource, require confirmation for configured effects, and persist an operation fingerprint before mutations. Sanitize tool results before returning them to the model and reconcile UNKNOWN outcomes before retry.
Введите числа или выберите пресет