Expand description
MCP Tools Protocol Types
This module defines the types used for the MCP tools functionality.
Modules§
- builder
- Tool Builder for Runtime Tool Construction
Structs§
- Call
Tool Params - Parameters for tools/call request (matches TypeScript CallToolRequest.params)
- Call
Tool Request - Complete tools/call request (matches TypeScript CallToolRequest interface)
- Call
Tool Result - Result for tools/call (per MCP spec)
- List
Tools Params - Parameters for tools/list request
- List
Tools Request - Complete tools/list request (matches TypeScript ListToolsRequest interface)
- List
Tools Result - Result for tools/list (per MCP spec) - extends PaginatedResult
- Tool
- Tool definition
- Tool
Annotations - Tool annotations structure (matches TypeScript ToolAnnotations) NOTE: all properties in ToolAnnotations are hints. They are not guaranteed to provide a faithful description of tool behavior. Clients should never make tool use decisions based on ToolAnnotations from untrusted servers.
- Tool
Schema - JSON Schema definition for tool input/output (matches TypeScript spec exactly) Must be an object with type: “object”, properties, and required fields
Traits§
- HasAnnotations
- Annotations trait
- HasBase
Metadata - Base metadata trait - matches TypeScript BaseMetadata interface
- HasDescription
- Tool description trait
- HasInput
Schema - Input schema trait
- HasOutput
Schema - Output schema trait
- HasTool
Meta - Tool-specific meta trait (separate from RPC _meta)
- Tool
Definition - Complete tool definition - composed from fine-grained traits Complete MCP Tool Creation - Build executable tools that clients can invoke.
Type Aliases§
- Tool
Result - Tool result type - an alias for ContentBlock to maintain backward compatibility while ensuring MCP 2025-06-18 specification compliance