Import
InferTools
Extract the full tool registry from a server type:ToolNames
Get a union of all tool names:ToolInput
Get the input type for a specific tool:ToolOutput
Get the output type for a specific tool:ToolResponseMetadata
Get the response metadata type for a specific tool:Usage Examples
Type-safe Component Props
Type-safe API Wrapper
Conditional Types Based on Tool
How It Works
The type system uses TypeScript’s conditional types and mapped types:Related
- generateHelpers - Generate typed hooks
- Type Safety concept - Understanding the type system
- McpServer - Server class with $types
