For brevity, the request examples on this page omit the
_meta request
metadata (io.modelcontextprotocol/protocolVersion,
io.modelcontextprotocol/clientInfo, and
io.modelcontextprotocol/clientCapabilities). Every request MUST include
the required _meta fields; see
_meta.User Interaction Model
Tools in MCP are designed to be model-controlled, meaning that the language model can discover and invoke tools automatically based on its contextual understanding and the user’s prompts. However, implementations are free to expose tools through any interface pattern that suits their needs—the protocol itself does not mandate any specific user interaction model.Capabilities
Servers that support tools MUST declare thetools capability:
listChanged indicates whether the server will emit notifications when the list of
available tools changes.
Servers that declare the tools capability MUST respond to tools/list requests
with the set of tools currently available to the requesting client. This set MAY be
empty and MAY change over time (see
List Changed Notification), but MUST NOT vary
per-connection or as a side effect of other requests on the connection. The set
MAY vary by the authorization presented on the request — for example, returning
only the tools the caller’s granted scopes permit — since credentials are
per-request input, not connection state.
Servers SHOULD return tools in a deterministic order (i.e., the same ordering across
requests when the underlying set of tools has not changed). Deterministic ordering enables
clients to reliably cache the tool list and improves LLM prompt cache hit rates when tools
are included in model context.
Protocol Messages
Listing Tools
To discover available tools, clients send atools/list request. This operation supports
pagination and caching.
Request:
Calling Tools
To invoke a tool, clients send atools/call request:
Request:
Input Required Tool Results
Servers MAY respond totools/call with an InputRequiredResult to indicate that additional input is needed before the tool call can be completed. This follows the multi round-trip requests mechanism.
When retrying the request with input responses, clients include inputResponses and, if provided by the server, requestState in the request parameters:
Input Required Response:
id MUST be different between the initial request and the retry.
List Changed Notification
When the list of available tools changes, servers that declared thelistChanged
capability SHOULD send a notification to clients that have opened a
subscriptions/listen stream with
toolsListChanged: true:
Message Flow
Data Types
Tool
A tool definition includes:name: Unique identifier for the tooltitle: Optional human-readable name of the tool for display purposes.description: Human-readable description of functionalityicons: Optional array of icons for display in user interfacesinputSchema: JSON Schema defining expected parameters- Follows the JSON Schema usage guidelines
- Defaults to 2020-12 if no
$schemafield is present - MUST be a valid JSON Schema object (not
null) - For tools with no parameters, use one of these valid approaches:
{ "type": "object", "additionalProperties": false }- Recommended: explicitly accepts only empty objects{ "type": "object" }- accepts any object (including with properties)
- Properties MAY include an
x-mcp-headerannotation to expose parameter values as HTTP headers
outputSchema: Optional JSON Schema defining expected output structure- Follows the JSON Schema usage guidelines
- Defaults to 2020-12 if no
$schemafield is present
annotations: Optional properties describing tool behavior
Tool Names
- Tool names SHOULD be between 1 and 128 characters in length (inclusive).
- Tool names SHOULD be considered case-sensitive.
- The following SHOULD be the only allowed characters: uppercase and lowercase ASCII letters (A-Z, a-z), digits (0-9), underscore (_), hyphen (-), and dot (.)
- Tool names SHOULD NOT contain spaces, commas, or other special characters.
- Tool names SHOULD be unique within a server.
- Example valid tool names:
getUserDATA_EXPORT_v2admin.tools.list
Tool name uniqueness is scoped to a single server. Clients or proxies that
aggregate tools from multiple servers MAY encounter naming collisions (for
example, two servers each exposing a
search tool) and SHOULD implement a
disambiguation strategy such as prefixing tool names with a server identifier.The server name (from serverInfo) is not guaranteed to be unique across
servers and SHOULD NOT be relied upon for disambiguation.x-mcp-header
Thex-mcp-header extension property allows servers to designate specific tool
parameters to be mirrored into HTTP headers when using the
Streamable HTTP transport.
This enables network intermediaries (load balancers, proxies, WAFs) to route and process
requests based on parameter values without parsing the request body.
The x-mcp-header property is placed directly within the JSON Schema of the property to
be mirrored. Its value specifies the name portion of the resulting Mcp-Param-{name}
HTTP header.
Constraints on x-mcp-header values:
- MUST NOT be empty
- MUST match HTTP field-name token syntax (
1*tchar, RFC 9110 Section 5.1) - MUST NOT contain control characters, including carriage return (CR,
\r) or line feed (LF,\n) - MUST be case-insensitively unique among all
x-mcp-headervalues in theinputSchema - MUST only be applied to parameters with primitive types (integer, string, boolean).
Parameters with type
numberare not permitted. Integer values MUST be within the safe range for integers represented using IEEE754 double-precision floating point numbers (−253+1 to 253−1) - MUST only be applied to properties that are statically reachable from the schema root, as defined in Custom Headers from Tool Parameters, which also defines how header values are extracted from call arguments
x-mcp-header value violates these constraints. Rejection means the client MUST
exclude the invalid tool from the result of tools/list. Clients SHOULD log a
warning when rejecting a tool definition, including the tool name and the reason for
rejection. This ensures that a single malformed tool definition does not prevent other
valid tools from being used. Clients using other transports (e.g., stdio) MAY ignore
x-mcp-header annotations entirely.
Example tool definition with x-mcp-header:
"region": "us-west1", the client adds
the header Mcp-Param-Region: us-west1 to the HTTP request.
Tool Result
Tool results may contain structured or unstructured content. Unstructured content is returned in thecontent field of a result, and can contain multiple content items of different types:
All content types (text, image, audio, resource links, and embedded resources)
support optional
annotations that
provide metadata about audience, priority, and modification times. This is the
same annotation format used by resources and prompts.
Text Content
Image Content
Audio Content
Resource Links
A tool MAY return links to Resources, to provide additional context or data. In this case, the tool will return a URI that can be subscribed to or fetched by the client:Resource links returned by tools are not guaranteed to appear in the results
of a
resources/list request.Embedded Resources
Resources MAY be embedded to provide additional context or data using a suitable URI scheme. Servers that use embedded resources SHOULD implement theresources capability: