mcp-use TypeScript API
    Preparing search index...

    Function widget

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

    • Create a view/widget tool result (propsstructuredContent).

      Type Parameters

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

        Props object type.

      Parameters

      Returns TypedCallToolResult<TProps>

      Tool result with props in structuredContent.

      Prefer a plain CallToolResult with view: on the tool definition: { content: [{ type: "text", text }], structuredContent: props }.