mcp-use TypeScript API
    Preparing search index...

    Function object

    Prefer raw CallToolResult, ReadResourceResult, or GetPromptResult returns. These helpers remain for upgrade compatibility and map to the official wire envelopes.

    • Create a structured JSON object tool result.

      Type Parameters

      • T extends Record<string, unknown>

        Object payload type.

      Parameters

      • data: T

        Object (or array — forwarded to array) to return.

      Returns TypedCallToolResult<T>

      Tool result with JSON text and structuredContent.

      Prefer { content: [{ type: "text", text: JSON.stringify(data) }], structuredContent: data }.