Reading - Agent Tools & Interoperability with MCP1.
A tool is an external function or service that a language model can invoke at runtime to perform actions beyond its static training data.
OpenAI introduced function calling (circa mid-2023), which allows models to invoke external code. Modern tools are built on top of this function-calling capability.
A tool definition is a contract between the model and the client. This contract must include:
Example:
Consider a system with N AI models and M tools. Without standardization, each model requires a custom integration for each tool—resulting in N × M point-to-point connectors.
This quickly becomes unmanageable as both models and tools scale.
Before LSP, each code editor needed a separate plugin for each programming language. With 10 editors and 10 languages, that meant 100 plugins.
Microsoft introduced the Language Server Protocol (LSP). It provided:
MCP follows a similar architectural pattern to LSP. It provides:
Tool discovery example:
User query: “What’s the weather in New York?”
The LLM decides to call get_weather(city="NY").
The server executes the function and returns the result, which the client feeds back into the model’s context.
Sometimes a tool needs LLM assistance to complete its task—for example, summarizing a large document before returning a result.
Flow:
fetch_and_summarize_pdf)This keeps the server lightweight while still leveraging model intelligence.
When a tool lacks critical information—such as confirmation for a destructive action—it can elicit input from a human operator.
Example:
Describe intent, not implementation Prefer: “Create a high-priority bug ticket in Jira” Avoid: “POST to /rest/api/3/issue with JSON payload…”
Granularity matters Each tool should perform one atomic action. Compose complex workflows by chaining simple tools.
Minimize output payloads Never return megabytes of raw data to the LLM. If output is large:
Validate inputs strictly Enforce type and domain constraints (e.g., brightness ∈ [0,100]) to prevent runtime errors.
Idempotency & safety Design tools to be safe on retries (e.g., idempotency keys for financial or destructive operations).