mcp-use TypeScript API
    Preparing search index...

    Function array

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

    • Create a structured array tool result (2026 any-JSON root — no { data } wrap).

      Type Parameters

      • T extends unknown[]

        Array payload type.

      Parameters

      • data: T

        Array to return as structuredContent.

      Returns { [key: string]: unknown }

      Tool result with JSON text and the array as structuredContent.

      Prefer { content: [{ type: "text", text: JSON.stringify(data) }], structuredContent: data } or { content: [], structuredContent: data } (SDK may auto-append JSON text for non-object roots).