MCPcopy Create free account
hub / github.com/modelcontextprotocol/go-sdk / CreateMessageWithToolsParams

Struct CreateMessageWithToolsParams

mcp/protocol.go:433–448  ·  view source on GitHub ↗

CreateMessageWithToolsParams is a sampling request that includes tools. It extends the basic [CreateMessageParams] fields with tools, tool choice, and messages that support array content (for parallel tool calls). Use with [ServerSession.CreateMessageWithTools].

Source from the content-addressed store, hash-verified

431//
432// Use with [ServerSession.CreateMessageWithTools].
433type CreateMessageWithToolsParams struct {
434 Meta `json:"_meta,omitempty"`
435 IncludeContext string `json:"includeContext,omitempty"`
436 MaxTokens int64 `json:"maxTokens"`
437 // Messages supports array content for tool_use and tool_result blocks.
438 Messages []*SamplingMessageV2 `json:"messages"`
439 Metadata any `json:"metadata,omitempty"`
440 ModelPreferences *ModelPreferences `json:"modelPreferences,omitempty"`
441 StopSequences []string `json:"stopSequences,omitempty"`
442 SystemPrompt string `json:"systemPrompt,omitempty"`
443 Temperature float64 `json:"temperature,omitempty"`
444 // Tools is the list of tools available for the model to use.
445 Tools []*Tool `json:"tools,omitempty"`
446 // ToolChoice controls how the model should use tools.
447 ToolChoice *ToolChoice `json:"toolChoice,omitempty"`
448}
449
450func (x *CreateMessageWithToolsParams) isParams() {}
451func (x *CreateMessageWithToolsParams) GetProgressToken() any { return getProgressToken(x) }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected