@modelcontextprotocol/sdk
    Preparing search index...

    Interface CreateMessageRequestParams

    Parameters for a sampling/createMessage request.

    interface CreateMessageRequestParams {
        _meta?: { progressToken?: ProgressToken; [key: string]: unknown };
        includeContext?: "none" | "thisServer" | "allServers";
        maxTokens: number;
        messages: SamplingMessage[];
        metadata?: object;
        modelPreferences?: ModelPreferences;
        stopSequences?: string[];
        systemPrompt?: string;
        temperature?: number;
    }

    Hierarchy (View Summary)

    Index

    Properties

    _meta?: { progressToken?: ProgressToken; [key: string]: unknown }

    See General fields: _meta for notes on _meta usage.

    Type Declaration

    • [key: string]: unknown
    • OptionalprogressToken?: ProgressToken

      If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.

    includeContext?: "none" | "thisServer" | "allServers"

    A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request.

    maxTokens: number

    The requested maximum number of tokens to sample (to prevent runaway completions).

    The client MAY choose to sample fewer tokens than the requested maximum.

    messages: SamplingMessage[]
    metadata?: object

    Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.

    modelPreferences?: ModelPreferences

    The server's preferences for which model to select. The client MAY ignore these preferences.

    stopSequences?: string[]
    systemPrompt?: string

    An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.

    temperature?: number

    number