Module tools

Module tools 

Source
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§

CallToolParams
Parameters for tools/call request (matches TypeScript CallToolRequest.params)
CallToolRequest
Complete tools/call request (matches TypeScript CallToolRequest interface)
CallToolResult
Result for tools/call (per MCP spec)
ListToolsParams
Parameters for tools/list request
ListToolsRequest
Complete tools/list request (matches TypeScript ListToolsRequest interface)
ListToolsResult
Result for tools/list (per MCP spec) - extends PaginatedResult
Tool
Tool definition
ToolAnnotations
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.
ToolSchema
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
HasBaseMetadata
Base metadata trait - matches TypeScript BaseMetadata interface
HasDescription
Tool description trait
HasInputSchema
Input schema trait
HasOutputSchema
Output schema trait
HasToolMeta
Tool-specific meta trait (separate from RPC _meta)
ToolDefinition
Complete tool definition - composed from fine-grained traits Complete MCP Tool Creation - Build executable tools that clients can invoke.

Type Aliases§

ToolResult
Tool result type - an alias for ContentBlock to maintain backward compatibility while ensuring MCP 2025-06-18 specification compliance