What Are MCP Tools?
Tools are functions that an MCP server exposes for AI models to call. They’re the primary way servers provide actions — fetching data, running computations, modifying state, or triggering side effects. Hosts discover available tools when connecting and present them to the model as callable functions.Discovery (tools/list)
When a client connects, the host calls tools/list to discover the server’s tools. Each tool declares:
| Field | Description |
|---|---|
name | Unique identifier (e.g., "get-weather") |
description | What the tool does, for the model to read |
inputSchema | JSON Schema defining accepted parameters |
annotations | Hints about behavior (read-only, destructive, etc.) |
Input Schemas
Tools declare their parameters using JSON Schema. The host validates arguments against the schema before invoking the tool. Schemas can also be defined with Zod — the SDK auto-converts them to JSON Schema.Invocation (tools/call)
The host calls tools/call with the tool name and validated arguments. The server executes the tool and returns a result.
Results
Tool results contain two fields:content— An array of content blocks (text,image,audio) that go into the model’s context. This is what the AI sees.structuredContent— Optional typed data optimized for programmatic consumption. MCP Apps uses this to pass data to Views (see Event Handlers).
Annotations
Tools can include annotations that help hosts decide how to handle them:| Annotation | Description |
|---|---|
readOnlyHint | Tool does not modify state. |
destructiveHint | Tool may perform destructive operations (deletes, overwrites). |
idempotentHint | Calling the tool multiple times with the same arguments has the same effect. |
openWorldHint | Tool interacts with external systems outside the server’s control. |
Related
registerAppTool
Register tools with UI metadata on the MCP server.