In MCP, what exactly is a 'tool' and who decides when to call it?
An MCP tool is a model-invokable function with a name, description, and JSON Schema for its arguments. The LLM decides when to call it; the server executes the action.
Imagine the AI has a toolbox in front of it. Each tool in the box has a label (the name), a small card explaining what it does (the description), and a little form showing what inputs it needs (the JSON Schema). The AI reads the cards, picks a tool that fits the current task, fills in the form, and hands it to the runtime. The runtime actually picks up the tool, uses it (creates the GitHub issue, writes the file, sends the message), and reports back what happened. The AI never touches the tool directly; it only chooses which one to use and fills in the form. Tools are how MCP servers let the model take action in the outside world.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
An MCP tool is the primitive that lets a model take action in the outside world through an MCP server. It is one of three primitives the protocol defines (resources and prompts are the other two) and the only one the model itself decides to invoke. Tools are where the model crosses from generating text into producing real effects.
This walkthrough covers what a tool is structurally, the lifecycle of a tool call from model emission to server execution, the contrast with resources and prompts, and the boundaries of what function calling at the inference layer does and does not guarantee.
The definition, unpacked
An MCP tool is a model-invokable function exposed by an MCP server, with a name, a description, and a JSON Schema for its arguments.
Four properties sit in that definition. Model-invokable means the model decides when to call the tool based on the description. The model does not execute the tool; it emits a structured call that the runtime executes. Function exposed by a server means the tool implementation lives on the server side; the server does whatever the tool advertises. Name and description are the metadata the model reads when choosing which tool to call. The name identifies uniquely within the server; the description is written for the model, not for end users. JSON Schema for arguments is the contract for what the model must supply when calling the tool; it is what makes structured, type-safe function calling possible.
The definition also clarifies what tools are not. They are not the only primitive (resources and prompts coexist). They are not where the LLM lives (the model is in the host; the server executes actions). And they are not guaranteed to be called correctly every time (function calling guarantees structure, not semantics).
Situations where this technique stops working.
2–4 min · Everything important, quickly.
Real products, models, and research that use this idea.
- Filesystem server tools: `read_text_file`, `write_file`, `list_directory`, `create_directory`, `move_file`.
- GitHub server tools: `create_issue`, `list_issues`, `search_repositories`, `get_pull_request`, `merge_pull_request`.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow does a tool call in MCP relate to function calling at the LLM provider layer?
Function calling is the inference-layer mechanism: the model emits a structured JSON object naming the tool and its arguments, with structural well-formedness guaranteed by the provider's sampling layer. A tool call in MCP is the system-layer routing: the host takes the emitted function call, finds the right MCP client, and sends tools/call over JSON-RPC. The two compose: function calling makes emission reliable; MCP makes routing standardized.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Confusing tools with resources. Tools are model-invoked and may have side effects; resources are host-pulled and strictly read-only. The invocation path and safety model are completely different.
60 second bullets to scan on the way to the call.
Define an MCP tool using the name, description, and JSON Schema framing
Name the three roles in a tool call: model (decides), host (routes), server (executes)
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.