mcp-use TypeScript API
    Preparing search index...

    Interface WidgetResponseConfig<TProps>

    Runtime data for a view-bound tool result (legacy widget helper).

    Prefer returning a plain CallToolResult from a tool registered with view: { name }. Put view props in structuredContent and model-facing text in content.

    interface WidgetResponseConfig<
        TProps extends Record<string, unknown> = Record<string, unknown>,
    > {
        data?: TProps;
        message?: string;
        metadata?: Record<string, unknown>;
        output?:
            | { [key: string]: unknown }
            | TypedCallToolResult<Record<string, unknown>>;
        props?: TProps;
    }

    Type Parameters

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

      Props object placed in structuredContent.

    Index
    data?: TProps

    Legacy alias for WidgetResponseConfig.props.

    Use props instead.

    message?: string

    Override text when output is omitted or should be replaced.

    metadata?: Record<string, unknown>

    Extra result _meta for the view.

    output?:
        | { [key: string]: unknown }
        | TypedCallToolResult<Record<string, unknown>>

    Model-facing helper/CallToolResult whose content is forwarded.

    props?: TProps

    View-facing data sent as structuredContent.