mcp-use TypeScript API
    Preparing search index...

    Interface ProviderMessage

    Provider-neutral message shape. Each provider module is responsible for mapping this into its wire format (OpenAI chat.completions, Anthropic messages, Gemini generateContent).

    interface ProviderMessage {
        content: string | ContentPart[];
        role: "system" | "user" | "assistant" | "tool";
        toolCallId?: string;
        toolCalls?: ProviderToolCall[];
        toolIsError?: boolean;
        toolName?: string;
        toolResult?: unknown;
    }
    Index
    content: string | ContentPart[]

    Text content, OR a list of rich content parts (for multimodal input).

    role: "system" | "user" | "assistant" | "tool"

    Message role in the provider-neutral conversation.

    toolCallId?: string

    Tool result payload (tool messages only).

    toolCalls?: ProviderToolCall[]

    Tool calls emitted by the assistant (assistant messages only).

    toolIsError?: boolean

    Whether the MCP tool reported an error.

    toolName?: string

    Tool name associated with a tool result.

    toolResult?: unknown

    Raw result returned by the MCP tool.