mcp-use TypeScript API
    Preparing search index...

    Interface RunOptions<T>

    Options shared by run, stream, and streamEvents.

    interface RunOptions<T = string> {
        externalHistory?: BaseMessage[];
        manageConnector?: boolean;
        maxSteps?: number;
        messages?: ProviderMessage[];
        prompt?: string;
        schema?: ZodType<T, unknown, $ZodTypeInternals<T, unknown>>;
        signal?: AbortSignal;
    }

    Type Parameters

    • T = string
    Index
    externalHistory?: BaseMessage[]

    Additional LangChain-formatted history for this call.

    The native agent appends it after memory-enabled stored conversation and before messages and the current prompt. It does not clear or replace stored memory.

    manageConnector?: boolean

    Lets the agent initialize and clean up connectors for this run. Defaults to true.

    maxSteps?: number

    Maximum model/tool-loop steps for this run.

    messages?: ProviderMessage[]

    Provider-neutral messages appended before prompt.

    prompt?: string

    User request for this run.

    schema?: ZodType<T, unknown, $ZodTypeInternals<T, unknown>>

    Zod schema for a typed result.

    Structured output is supported by the LangChain entry point and remote agents. The native local agent rejects this option.

    signal?: AbortSignal

    Cancels model requests and agent execution.