Based on the MCP SDK TypeScript definitions and official documentation, here is the complete list of fields available in the Tool type:
-
name(string) - REQUIRED- The unique identifier for the tool
- Must be a string that uniquely identifies this tool within the server
-
inputSchema(object) - REQUIRED- A JSON Schema object defining the expected parameters for the tool
- Must be an object with:
type: "object" (literal)properties: object (optional) - defines the tool parametersrequired: string[] (optional) - list of required parameter names
- Can include additional JSON Schema properties via passthrough
-
description(string) - OPTIONAL- A human-readable description of the tool's functionality
- Helps LLMs understand when and how to use the tool
-
title(string) - OPTIONAL- Human-readable display name for the tool
- Used for UI purposes when showing tools to users
- Note: This is part of the annotations object
-
outputSchema(object) - OPTIONAL- A JSON Schema object defining the structure of the tool's output
- Used for the
structuredContentfield in CallToolResult - Must be an object with:
type: "object" (literal)properties: object (optional)required: string[] (optional)
- If provided:
- Servers MUST provide structured results that conform to this schema
- Clients SHOULD validate structured results against this schema
-
annotations(object) - OPTIONAL- Optional properties describing tool behavior
- Contains behavioral hints (not guarantees) about the tool
- Fields within annotations:
These are nested within the annotations object:
title(string) - Human-readable title for the toolreadOnlyHint(boolean) - If true, the tool does not modify its environment (default: false)destructiveHint(boolean) - If true, the tool may perform destructive updates (default: true)- Only meaningful when
readOnlyHint == false
- Only meaningful when
idempotentHint(boolean) - If true, repeated calls with same arguments have no additional effect (default: false)- Only meaningful when
readOnlyHint == false
- Only meaningful when
openWorldHint(boolean) - If true, tool interacts with an "open world" of external entities (default: true)- Example: web search tools have open world, memory tools do not
const exampleTool: Tool = {
// Required fields
name: "take_screenshot",
inputSchema: {
type: "object",
properties: {
url: {
type: "string",
description: "URL to capture"
},
fullPage: {
type: "boolean",
description: "Capture full page",
default: true
}
},
required: ["url"]
},
// Optional fields
description: "Captures a screenshot of a web page",
outputSchema: {
type: "object",
properties: {
width: { type: "number" },
height: { type: "number" },
format: { type: "string" }
},
required: ["width", "height", "format"]
},
annotations: {
title: "Screenshot Capture Tool",
readOnlyHint: true,
destructiveHint: false,
idempotentHint: true,
openWorldHint: true
}
};- Security: Clients MUST consider tool annotations to be untrusted unless they come from trusted servers
- Annotations are hints: They are not guaranteed to provide a faithful description of tool behavior
- Backward compatibility: Tools returning structured content SHOULD also return functionally equivalent unstructured content
- Schema extensibility: Both inputSchema and outputSchema support passthrough, allowing additional JSON Schema properties
- TypeScript definition:
@modelcontextprotocol/sdk/types.js- ToolSchema and ToolAnnotationsSchema - Official docs: https://modelcontextprotocol.io/specification/draft/server/tools
- The Tool type is defined as
Infer<typeof ToolSchema>in the SDK