MCPToolHandler | WebHare Platform SDK
WebHare Platform SDK
    Preparing search index...

    Type Alias MCPToolHandler<Input, Structured>

    MCPToolHandler: (
        input: Input,
        context: MCPToolContext,
    ) => Promise<MCPToolResult<Structured>> | MCPToolResult<Structured>

    Signature of an MCP tool's onCall function. Declare handlers using satisfies MCPToolHandler rather than as MCPToolHandler to keep their inferred result type, so clients can use MCPToolOutput to get the type of their structuredContent

    Type Parameters

    • Input extends Record<string, unknown> = Record<string, never>

      Arguments the tool accepts, matching its inputSchema

    • Structured extends Record<string, unknown> = Record<string, unknown>

      Type of the structuredContent the tool returns

    Type Declaration