@mcp-z/server
    Preparing search index...

    Type Alias TypedToolResult<T>

    TypedToolResult: Omit<CallToolResult, "structuredContent"> & {
        structuredContent?: { result: T };
    }

    Type-safe wrapper for CallToolResult with typed structuredContent. Use in tests to get proper type inference for tool responses.

    Type Parameters

    • T

      The output schema type for the tool

    const response = await handler(input, extra) as TypedToolResult<Output>;
    const result = response.structuredContent?.result;
    // result is properly typed as Output | undefined