mcp-use TypeScript API
    Preparing search index...

    Interface TypedCallToolResult<T>

    Typed CallToolResult that constrains structuredContent to T.

    Prefer returning a raw CallToolResult from tool callbacks. Example: { content: [{ type: "text", text: JSON.stringify(data) }], structuredContent: data }.

    interface TypedCallToolResult<
        T extends Record<string, unknown> = Record<string, unknown>,
    > {
        _meta?: { [key: string]: unknown };
        content: ({} | {} | {} | {} | {})[];
        isError?: boolean;
        structuredContent?: T;
        [x: string]: unknown;
    }

    Type Parameters

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

      Structured payload type (typically an object).

    Indexable

    • [x: string]: unknown
    Index
    _meta?: { [key: string]: unknown }

    Protocol extension metadata.

    content: ({} | {} | {} | {} | {})[]

    Model-visible content blocks.

    isError?: boolean

    Whether the result represents a tool-domain error.

    structuredContent?: T

    Typed structured payload.