Complete protocol types for all MCP requests, responses, parameters, and results.
type InitializeParams struct {
Meta `json:"_meta,omitempty"`
Capabilities *ClientCapabilities `json:"capabilities"`
ClientInfo *Implementation `json:"clientInfo"`
ProtocolVersion string `json:"protocolVersion"`
}Parameters sent by client to initialize the connection.
Methods:
func (p *InitializeParams) GetProgressToken() any
func (p *InitializeParams) SetProgressToken(t any)type InitializeResult struct {
Meta `json:"_meta,omitempty"`
Capabilities *ServerCapabilities `json:"capabilities"`
Instructions string `json:"instructions,omitempty"`
ProtocolVersion string `json:"protocolVersion"`
ServerInfo *Implementation `json:"serverInfo"`
}Server's response to initialization.
Fields:
Capabilities: Features the server supportsInstructions: Human-readable instructions for using the serverProtocolVersion: MCP protocol version (e.g., "2025-06-18")ServerInfo: Server name and versiontype InitializedParams struct {
Meta `json:"_meta,omitempty"`
}Parameters for initialized notification sent by client after receiving InitializeResult.
Methods:
func (p *InitializedParams) GetProgressToken() any
func (p *InitializedParams) SetProgressToken(t any)type CallToolParams struct {
Meta `json:"_meta,omitempty"`
Name string `json:"name"`
Arguments any `json:"arguments,omitempty"`
}Client request to call a tool.
Fields:
Meta: Additional metadataName: Tool nameArguments: Tool-specific arguments (map or struct)Methods:
func (p *CallToolParams) GetProgressToken() any
func (p *CallToolParams) SetProgressToken(t any)type CallToolParamsRaw struct {
Meta `json:"_meta,omitempty"`
Name string `json:"name"`
Arguments json.RawMessage `json:"arguments,omitempty"`
}Raw parameters passed to tool handlers on server with unparsed arguments.
Methods:
func (p *CallToolParamsRaw) GetProgressToken() any
func (p *CallToolParamsRaw) SetProgressToken(t any)type CallToolResult struct {
Meta `json:"_meta,omitempty"`
Content []Content `json:"content"`
StructuredContent any `json:"structuredContent,omitempty"`
IsError bool `json:"isError,omitempty"`
}Server's response to a tool call.
Fields:
Content: Unstructured result as content objects (text, images, etc.)StructuredContent: Optional structured result as JSON objectIsError: Whether the tool call ended in errorMethods:
func (r *CallToolResult) UnmarshalJSON(data []byte) errortype ListToolsParams struct {
Meta `json:"_meta,omitempty"`
Cursor string `json:"cursor,omitempty"`
}Client request to list available tools.
Fields:
Cursor: Pagination cursor from previous responseMethods:
func (p *ListToolsParams) GetProgressToken() any
func (p *ListToolsParams) SetProgressToken(t any)type ListToolsResult struct {
Meta `json:"_meta,omitempty"`
NextCursor string `json:"nextCursor,omitempty"`
Tools []*Tool `json:"tools"`
}Server response with list of tools.
Fields:
NextCursor: Cursor for next page (empty if no more results)Tools: Available toolstype ToolListChangedParams struct {
Meta `json:"_meta,omitempty"`
}Server notification that its tool list has changed.
Methods:
func (p *ToolListChangedParams) GetProgressToken() any
func (p *ToolListChangedParams) SetProgressToken(t any)type GetPromptParams struct {
Meta `json:"_meta,omitempty"`
Arguments map[string]string `json:"arguments,omitempty"`
Name string `json:"name"`
}Client request to get a prompt with arguments.
Fields:
Arguments: Prompt argument valuesName: Prompt nameMethods:
func (p *GetPromptParams) GetProgressToken() any
func (p *GetPromptParams) SetProgressToken(t any)type GetPromptResult struct {
Meta `json:"_meta,omitempty"`
Description string `json:"description,omitempty"`
Messages []*PromptMessage `json:"messages"`
}Server response with prompt messages.
Fields:
Description: Human-readable descriptionMessages: Prompt messages with roles and contenttype PromptMessage struct {
Content Content `json:"content"`
Role Role `json:"role"`
}A message returned as part of a prompt.
Fields:
Content: Message content (text, image, etc.)Role: Message role ("user", "assistant", etc.)Methods:
func (m *PromptMessage) UnmarshalJSON(data []byte) errortype ListPromptsParams struct {
Meta `json:"_meta,omitempty"`
Cursor string `json:"cursor,omitempty"`
}Client request to list available prompts.
Fields:
Cursor: Pagination cursor from previous responseMethods:
func (p *ListPromptsParams) GetProgressToken() any
func (p *ListPromptsParams) SetProgressToken(t any)type ListPromptsResult struct {
Meta `json:"_meta,omitempty"`
NextCursor string `json:"nextCursor,omitempty"`
Prompts []*Prompt `json:"prompts"`
}Server response with list of prompts.
Fields:
NextCursor: Cursor for next page (empty if no more results)Prompts: Available promptstype PromptListChangedParams struct {
Meta `json:"_meta,omitempty"`
}Server notification that its prompt list has changed.
Methods:
func (p *PromptListChangedParams) GetProgressToken() any
func (p *PromptListChangedParams) SetProgressToken(t any)type ReadResourceParams struct {
Meta `json:"_meta,omitempty"`
URI string `json:"uri"`
}Client request to read a resource.
Fields:
URI: Resource URI to readMethods:
func (p *ReadResourceParams) GetProgressToken() any
func (p *ReadResourceParams) SetProgressToken(t any)type ReadResourceResult struct {
Meta `json:"_meta,omitempty"`
Contents []*ResourceContents `json:"contents"`
}Server response with resource contents.
Fields:
Contents: Resource contents (may include sub-resources)type ListResourcesParams struct {
Meta `json:"_meta,omitempty"`
Cursor string `json:"cursor,omitempty"`
}Client request to list available resources.
Fields:
Cursor: Pagination cursor from previous responseMethods:
func (p *ListResourcesParams) GetProgressToken() any
func (p *ListResourcesParams) SetProgressToken(t any)type ListResourcesResult struct {
Meta `json:"_meta,omitempty"`
NextCursor string `json:"nextCursor,omitempty"`
Resources []*Resource `json:"resources"`
}Server response with list of resources.
Fields:
NextCursor: Cursor for next page (empty if no more results)Resources: Available resourcestype ListResourceTemplatesParams struct {
Meta `json:"_meta,omitempty"`
Cursor string `json:"cursor,omitempty"`
}Client request to list available resource templates.
Fields:
Cursor: Pagination cursor from previous responseMethods:
func (p *ListResourceTemplatesParams) GetProgressToken() any
func (p *ListResourceTemplatesParams) SetProgressToken(t any)type ListResourceTemplatesResult struct {
Meta `json:"_meta,omitempty"`
NextCursor string `json:"nextCursor,omitempty"`
ResourceTemplates []*ResourceTemplate `json:"resourceTemplates"`
}Server response with list of resource templates.
Fields:
NextCursor: Cursor for next page (empty if no more results)ResourceTemplates: Available resource templatestype SubscribeParams struct {
Meta `json:"_meta,omitempty"`
URI string `json:"uri"`
}Client request to subscribe to resource updates.
Fields:
URI: Resource URI to subscribe totype UnsubscribeParams struct {
Meta `json:"_meta,omitempty"`
URI string `json:"uri"`
}Client request to cancel resource subscription.
Fields:
URI: Resource URI to unsubscribe fromtype ResourceListChangedParams struct {
Meta `json:"_meta,omitempty"`
}Server notification that its resource list has changed.
Methods:
func (p *ResourceListChangedParams) GetProgressToken() any
func (p *ResourceListChangedParams) SetProgressToken(t any)type ResourceUpdatedNotificationParams struct {
Meta `json:"_meta,omitempty"`
URI string `json:"uri"`
}Server notification that a specific resource has been updated.
Fields:
URI: URI of the updated resourcetype ListRootsParams struct {
Meta `json:"_meta,omitempty"`
}Server request to list client roots.
Methods:
func (p *ListRootsParams) GetProgressToken() any
func (p *ListRootsParams) SetProgressToken(t any)type ListRootsResult struct {
Meta `json:"_meta,omitempty"`
Roots []*Root `json:"roots"`
}Client response with list of roots.
Fields:
Roots: Client root directories/filestype RootsListChangedParams struct {
Meta `json:"_meta,omitempty"`
}Client notification that its root list has changed.
Methods:
func (p *RootsListChangedParams) GetProgressToken() any
func (p *RootsListChangedParams) SetProgressToken(t any)type CreateMessageParams struct {
Meta `json:"_meta,omitempty"`
IncludeContext string `json:"includeContext,omitempty"`
MaxTokens int64 `json:"maxTokens"`
Messages []*SamplingMessage `json:"messages"`
Metadata any `json:"metadata,omitempty"`
ModelPreferences *ModelPreferences `json:"modelPreferences,omitempty"`
StopSequences []string `json:"stopSequences,omitempty"`
SystemPrompt string `json:"systemPrompt,omitempty"`
Temperature float64 `json:"temperature,omitempty"`
}Server request for client to generate a message using an LLM.
Fields:
IncludeContext: Context inclusion strategyMaxTokens: Maximum tokens in responseMessages: Conversation historyMetadata: Additional metadataModelPreferences: Model selection preferencesStopSequences: Sequences that stop generationSystemPrompt: System prompt for the LLMTemperature: Sampling temperature (0.0-1.0)Methods:
func (p *CreateMessageParams) GetProgressToken() any
func (p *CreateMessageParams) SetProgressToken(t any)type CreateMessageResult struct {
Meta `json:"_meta,omitempty"`
Content Content `json:"content"`
Model string `json:"model"`
Role Role `json:"role"`
StopReason string `json:"stopReason,omitempty"`
}Client response with generated message.
Fields:
Content: Generated message contentModel: Model used for generationRole: Message role ("assistant")StopReason: Why generation stoppedMethods:
func (r *CreateMessageResult) UnmarshalJSON(data []byte) errortype SamplingMessage struct {
Content Content `json:"content"`
Role Role `json:"role"`
}A message in the conversation history for sampling.
Fields:
Content: Message contentRole: Message role ("user", "assistant")Methods:
func (m *SamplingMessage) UnmarshalJSON(data []byte) errortype ModelPreferences struct {
CostPriority float64 `json:"costPriority,omitempty"`
Hints []*ModelHint `json:"hints,omitempty"`
IntelligencePriority float64 `json:"intelligencePriority,omitempty"`
SpeedPriority float64 `json:"speedPriority,omitempty"`
}Server preferences for model selection during sampling.
Fields:
CostPriority: Priority for low cost (0.0-1.0)Hints: Hints for specific modelsIntelligencePriority: Priority for high intelligence (0.0-1.0)SpeedPriority: Priority for fast response (0.0-1.0)type ModelHint struct {
Name string `json:"name,omitempty"`
}Hint for model selection.
Fields:
Name: Suggested model nametype ElicitParams struct {
Meta `json:"_meta,omitempty"`
Message string `json:"message"`
RequestedSchema any `json:"requestedSchema"`
}Server request for client to prompt user for structured input.
Fields:
Message: Message to present to userRequestedSchema: JSON schema defining requested input (top-level properties only)Methods:
func (p *ElicitParams) GetProgressToken() any
func (p *ElicitParams) SetProgressToken(t any)type ElicitResult struct {
Meta `json:"_meta,omitempty"`
Action string `json:"action"`
Content map[string]any `json:"content,omitempty"`
}Client response to elicitation request.
Fields:
Action: User action ("accept", "decline", or "cancel")Content: Form data when action is "accept"type CompleteParams struct {
Meta `json:"_meta,omitempty"`
Argument CompleteParamsArgument `json:"argument"`
Context *CompleteContext `json:"context,omitempty"`
Ref *CompleteReference `json:"ref"`
}Client request for argument completion suggestions.
Fields:
Argument: Argument to completeContext: Additional contextRef: Reference to prompt or resourcetype CompleteParamsArgument struct {
Name string `json:"name"`
Value string `json:"value"`
}Argument information for completions.
Fields:
Name: Argument nameValue: Current partial valuetype CompleteContext struct {
Arguments map[string]string `json:"arguments,omitempty"`
}Additional context for completions.
Fields:
Arguments: Other argument valuestype CompleteReference struct {
Type string `json:"type"`
Name string `json:"name,omitempty"`
URI string `json:"uri,omitempty"`
}Completion reference type ("ref/prompt" or "ref/resource").
Fields:
Type: Reference typeName: Prompt name (for ref/prompt)URI: Resource URI (for ref/resource)Methods:
func (r *CompleteReference) MarshalJSON() ([]byte, error)
func (r *CompleteReference) UnmarshalJSON(data []byte) errortype CompleteResult struct {
Meta `json:"_meta,omitempty"`
Completion CompletionResultDetails `json:"completion"`
}Server response with completion suggestions.
Fields:
Completion: Completion detailstype CompletionResultDetails struct {
HasMore bool `json:"hasMore,omitempty"`
Total int `json:"total,omitempty"`
Values []string `json:"values"`
}Details of completion results.
Fields:
HasMore: Whether there are more completions availableTotal: Total number of completionsValues: Completion suggestionstype LoggingMessageParams struct {
Meta `json:"_meta,omitempty"`
Data any `json:"data"`
Level LoggingLevel `json:"level"`
Logger string `json:"logger,omitempty"`
}Server notification of a log message.
Fields:
Data: Log data (string or structured)Level: Log severity levelLogger: Optional logger nameMethods:
func (p *LoggingMessageParams) GetProgressToken() any
func (p *LoggingMessageParams) SetProgressToken(t any)type SetLoggingLevelParams struct {
Meta `json:"_meta,omitempty"`
Level LoggingLevel `json:"level"`
}Client request to set server's logging level.
Fields:
Level: New logging levelMethods:
func (p *SetLoggingLevelParams) GetProgressToken() any
func (p *SetLoggingLevelParams) SetProgressToken(t any)type ProgressNotificationParams struct {
Meta `json:"_meta,omitempty"`
ProgressToken any `json:"progressToken"`
Message string `json:"message,omitempty"`
Progress float64 `json:"progress"`
Total float64 `json:"total,omitempty"`
}Progress notification for long-running operations.
Fields:
ProgressToken: Token identifying the operationMessage: Optional progress messageProgress: Current progress valueTotal: Total expected progress valuetype CancelledParams struct {
Meta `json:"_meta,omitempty"`
Reason string `json:"reason,omitempty"`
RequestID any `json:"requestId"`
}Notification that a request has been cancelled.
Fields:
Reason: Optional cancellation reasonRequestID: ID of cancelled requestMethods:
func (p *CancelledParams) GetProgressToken() any
func (p *CancelledParams) SetProgressToken(t any)type PingParams struct {
Meta `json:"_meta,omitempty"`
}Ping request to check connectivity.
Methods:
func (p *PingParams) GetProgressToken() any
func (p *PingParams) SetProgressToken(t any)type Annotations struct {
Audience []Role `json:"audience,omitempty"`
LastModified string `json:"lastModified,omitempty"`
Priority float64 `json:"priority,omitempty"`
}Optional annotations for objects to inform how they are used or displayed.
Fields:
Audience: Intended customer (e.g., "user", "assistant")LastModified: ISO 8601 formatted timestampPriority: Importance from 0 (optional) to 1 (required)