mcp-use TypeScript API
    Preparing search index...

    Interface AiSdkTool

    An AI SDK dynamic tool backed by an MCP tool.

    The annotations, _meta, and metadata fields are retained as MCP-side metadata. The structural type intentionally imports no AI SDK types so the client remains compatible with AI SDK v5, v6, and v7 without a dependency.

    interface AiSdkTool {
        _meta?: { [key: string]: unknown };
        annotations?: {};
        description?: string;
        inputSchema: any;
        metadata?: any;
        title?: string;
        type: "dynamic";
        execute(
            args: unknown,
            executionOptions?: AiSdkToolExecutionOptions,
        ): Promise<{ [key: string]: unknown }>;
    }
    Index
    _meta?: { [key: string]: unknown }

    Original MCP tool metadata.

    annotations?: {}

    Original MCP tool annotations.

    description?: string

    MCP tool description supplied to the model, when present.

    inputSchema: any

    Input schema passed to the AI SDK provider and dynamic-tool parser.

    any is intentional: AI SDK v5, v6, and v7 expose incompatible FlexibleSchema generations, while dynamic MCP tool inputs are runtime values in all of them.

    metadata?: any

    Adapter metadata retained for AI SDK/provider consumers.

    title?: string

    Human-readable MCP tool title, when present.

    type: "dynamic"

    Identifies this as an AI SDK runtime-generated tool.

    • Executes the MCP tool with model-provided arguments.

      Parameters

      Returns Promise<{ [key: string]: unknown }>