or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

auth.mdindex.mdjsonrpc.mdmcp-client.mdmcp-protocol.mdmcp-server.mdmcp-transports.mdmcp-types.mdoauthex.md
tile.json

mcp-protocol.mddocs/

MCP Protocol Types

Low-level protocol types for MCP requests, responses, parameters, and results. These types are used for communication between clients and servers.

Tool Protocol Types

CallToolParams

Parameters for calling a tool (used by clients).

import "github.com/modelcontextprotocol/go-sdk/mcp"

type CallToolParams struct {
    Meta      `json:"_meta,omitempty"`
    Name      string `json:"name"`
    Arguments any    `json:"arguments,omitempty"`
}

Fields:

  • Meta: Reserved metadata field
  • Name: Name of the tool to call
  • Arguments: Tool arguments (any JSON-marshalable value)

Methods:

func (p *CallToolParams) GetProgressToken() any
func (p *CallToolParams) SetProgressToken(t any)

CallToolParamsRaw

Parameters passed to tool handlers on the server with raw (unmarshaled) arguments.

type CallToolParamsRaw struct {
    Meta      `json:"_meta,omitempty"`
    Name      string          `json:"name"`
    Arguments json.RawMessage `json:"arguments,omitempty"`
}

Fields:

  • Meta: Reserved metadata field
  • Name: Name of the tool being called
  • Arguments: Raw arguments from the client (handler must unmarshal)

Methods:

func (p *CallToolParamsRaw) GetProgressToken() any
func (p *CallToolParamsRaw) SetProgressToken(t any)

CallToolRequest

Type alias for tool call requests received by servers.

type CallToolRequest = ServerRequest[*CallToolParamsRaw]

CallToolResult

Server's response to a tool call.

type CallToolResult struct {
    Meta              `json:"_meta,omitempty"`
    Content           []Content `json:"content"`
    StructuredContent any       `json:"structuredContent,omitempty"`
    IsError           bool      `json:"isError,omitempty"`
}

Fields:

  • Meta: Reserved metadata field
  • Content: List of content objects representing unstructured result
  • StructuredContent: Optional structured result (must marshal to JSON object)
  • IsError: Whether the tool call ended in error

Methods:

func (r *CallToolResult) UnmarshalJSON(data []byte) error

ListToolsParams

Parameters for listing tools.

type ListToolsParams struct {
    Meta   `json:"_meta,omitempty"`
    Cursor string `json:"cursor,omitempty"`
}

Fields:

  • Meta: Reserved metadata field
  • Cursor: Opaque pagination token

Methods:

func (p *ListToolsParams) GetProgressToken() any
func (p *ListToolsParams) SetProgressToken(t any)

ListToolsRequest

Type alias for list tools requests.

type ListToolsRequest = ServerRequest[*ListToolsParams]

ListToolsResult

Server's response to a list tools request.

type ListToolsResult struct {
    Meta       `json:"_meta,omitempty"`
    NextCursor string  `json:"nextCursor,omitempty"`
    Tools      []*Tool `json:"tools"`
}

Fields:

  • Meta: Reserved metadata field
  • NextCursor: Pagination token for next page
  • Tools: List of available tools

ToolListChangedParams

Parameters for tool list changed notifications.

type ToolListChangedParams struct {
    Meta `json:"_meta,omitempty"`
}

Methods:

func (p *ToolListChangedParams) GetProgressToken() any
func (p *ToolListChangedParams) SetProgressToken(t any)

ToolListChangedRequest

Type alias for tool list changed notification requests.

type ToolListChangedRequest = ClientRequest[*ToolListChangedParams]

Prompt Protocol Types

GetPromptParams

Parameters for getting a prompt.

type GetPromptParams struct {
    Meta      `json:"_meta,omitempty"`
    Arguments map[string]string `json:"arguments,omitempty"`
    Name      string            `json:"name"`
}

Fields:

  • Meta: Reserved metadata field
  • Arguments: Arguments for templating the prompt
  • Name: Name of the prompt or prompt template

Methods:

func (p *GetPromptParams) GetProgressToken() any
func (p *GetPromptParams) SetProgressToken(t any)

GetPromptRequest

Type alias for get prompt requests.

type GetPromptRequest = ServerRequest[*GetPromptParams]

GetPromptResult

Server's response to a get prompt request.

type GetPromptResult struct {
    Meta        `json:"_meta,omitempty"`
    Description string           `json:"description,omitempty"`
    Messages    []*PromptMessage `json:"messages"`
}

Fields:

  • Meta: Reserved metadata field
  • Description: Optional prompt description
  • Messages: List of prompt messages

ListPromptsParams

Parameters for listing prompts.

type ListPromptsParams struct {
    Meta   `json:"_meta,omitempty"`
    Cursor string `json:"cursor,omitempty"`
}

Fields:

  • Meta: Reserved metadata field
  • Cursor: Opaque pagination token

Methods:

func (p *ListPromptsParams) GetProgressToken() any
func (p *ListPromptsParams) SetProgressToken(t any)

ListPromptsRequest

Type alias for list prompts requests.

type ListPromptsRequest = ServerRequest[*ListPromptsParams]

ListPromptsResult

Server's response to a list prompts request.

type ListPromptsResult struct {
    Meta       `json:"_meta,omitempty"`
    NextCursor string    `json:"nextCursor,omitempty"`
    Prompts    []*Prompt `json:"prompts"`
}

Fields:

  • Meta: Reserved metadata field
  • NextCursor: Pagination token for next page
  • Prompts: List of available prompts

PromptListChangedParams

Parameters for prompt list changed notifications.

type PromptListChangedParams struct {
    Meta `json:"_meta,omitempty"`
}

Methods:

func (p *PromptListChangedParams) GetProgressToken() any
func (p *PromptListChangedParams) SetProgressToken(t any)

PromptListChangedRequest

Type alias for prompt list changed notification requests.

type PromptListChangedRequest = ClientRequest[*PromptListChangedParams]

Resource Protocol Types

ReadResourceParams

Parameters for reading a resource.

type ReadResourceParams struct {
    Meta `json:"_meta,omitempty"`
    URI  string `json:"uri"`
}

Fields:

  • Meta: Reserved metadata field
  • URI: URI of the resource to read

Methods:

func (p *ReadResourceParams) GetProgressToken() any
func (p *ReadResourceParams) SetProgressToken(t any)

ReadResourceRequest

Type alias for read resource requests.

type ReadResourceRequest = ServerRequest[*ReadResourceParams]

ReadResourceResult

Server's response to a read resource request.

type ReadResourceResult struct {
    Meta     `json:"_meta,omitempty"`
    Contents []*ResourceContents `json:"contents"`
}

Fields:

  • Meta: Reserved metadata field
  • Contents: List of resource contents

ListResourcesParams

Parameters for listing resources.

type ListResourcesParams struct {
    Meta   `json:"_meta,omitempty"`
    Cursor string `json:"cursor,omitempty"`
}

Fields:

  • Meta: Reserved metadata field
  • Cursor: Opaque pagination token

Methods:

func (p *ListResourcesParams) GetProgressToken() any
func (p *ListResourcesParams) SetProgressToken(t any)

ListResourcesRequest

Type alias for list resources requests.

type ListResourcesRequest = ServerRequest[*ListResourcesParams]

ListResourcesResult

Server's response to a list resources request.

type ListResourcesResult struct {
    Meta       `json:"_meta,omitempty"`
    NextCursor string      `json:"nextCursor,omitempty"`
    Resources  []*Resource `json:"resources"`
}

Fields:

  • Meta: Reserved metadata field
  • NextCursor: Pagination token for next page
  • Resources: List of available resources

ListResourceTemplatesParams

Parameters for listing resource templates.

type ListResourceTemplatesParams struct {
    Meta   `json:"_meta,omitempty"`
    Cursor string `json:"cursor,omitempty"`
}

Fields:

  • Meta: Reserved metadata field
  • Cursor: Opaque pagination token

Methods:

func (p *ListResourceTemplatesParams) GetProgressToken() any
func (p *ListResourceTemplatesParams) SetProgressToken(t any)

ListResourceTemplatesRequest

Type alias for list resource templates requests.

type ListResourceTemplatesRequest = ServerRequest[*ListResourceTemplatesParams]

ListResourceTemplatesResult

Server's response to a list resource templates request.

type ListResourceTemplatesResult struct {
    Meta              `json:"_meta,omitempty"`
    NextCursor        string              `json:"nextCursor,omitempty"`
    ResourceTemplates []*ResourceTemplate `json:"resourceTemplates"`
}

Fields:

  • Meta: Reserved metadata field
  • NextCursor: Pagination token for next page
  • ResourceTemplates: List of available resource templates

SubscribeParams

Parameters for subscribing to resource updates.

type SubscribeParams struct {
    Meta `json:"_meta,omitempty"`
    URI  string `json:"uri"`
}

Fields:

  • Meta: Reserved metadata field
  • URI: URI of the resource to subscribe to

SubscribeRequest

Type alias for subscribe requests.

type SubscribeRequest = ServerRequest[*SubscribeParams]

UnsubscribeParams

Parameters for unsubscribing from resource updates.

type UnsubscribeParams struct {
    Meta `json:"_meta,omitempty"`
    URI  string `json:"uri"`
}

Fields:

  • Meta: Reserved metadata field
  • URI: URI of the resource to unsubscribe from

UnsubscribeRequest

Type alias for unsubscribe requests.

type UnsubscribeRequest = ServerRequest[*UnsubscribeParams]

ResourceUpdatedNotificationParams

Parameters for resource updated notifications.

type ResourceUpdatedNotificationParams struct {
    Meta `json:"_meta,omitempty"`
    URI  string `json:"uri"`
}

Fields:

  • Meta: Reserved metadata field
  • URI: URI of the resource that has been updated

ResourceUpdatedNotificationRequest

Type alias for resource updated notification requests.

type ResourceUpdatedNotificationRequest = ClientRequest[*ResourceUpdatedNotificationParams]

ResourceListChangedParams

Parameters for resource list changed notifications.

type ResourceListChangedParams struct {
    Meta `json:"_meta,omitempty"`
}

Methods:

func (p *ResourceListChangedParams) GetProgressToken() any
func (p *ResourceListChangedParams) SetProgressToken(t any)

ResourceListChangedRequest

Type alias for resource list changed notification requests.

type ResourceListChangedRequest = ClientRequest[*ResourceListChangedParams]

Sampling Protocol Types

CreateMessageParams

Parameters for requesting message creation from an LLM.

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"`
}

Fields:

  • Meta: Reserved metadata field
  • IncludeContext: Request to include context from MCP servers
  • MaxTokens: Maximum tokens to sample
  • Messages: List of messages for the conversation
  • Metadata: Optional metadata to pass to LLM provider
  • ModelPreferences: Server's model selection preferences
  • StopSequences: Stop sequences for generation
  • SystemPrompt: Optional system prompt for sampling
  • Temperature: Temperature for sampling

Methods:

func (p *CreateMessageParams) GetProgressToken() any
func (p *CreateMessageParams) SetProgressToken(t any)

CreateMessageRequest

Type alias for create message requests.

type CreateMessageRequest = ClientRequest[*CreateMessageParams]

CreateMessageResult

Client's response to a create message request.

type CreateMessageResult struct {
    Meta       `json:"_meta,omitempty"`
    Content    Content `json:"content"`
    Model      string  `json:"model"`
    Role       Role    `json:"role"`
    StopReason string  `json:"stopReason,omitempty"`
}

Fields:

  • Meta: Reserved metadata field
  • Content: Message content from the LLM
  • Model: Name of the model that generated the message
  • Role: Role of the message sender
  • StopReason: Why sampling stopped, if known

Methods:

func (r *CreateMessageResult) UnmarshalJSON(data []byte) error

Elicitation Protocol Types

ElicitParams

Parameters for elicitation requests (asking user for information).

type ElicitParams struct {
    Meta            `json:"_meta,omitempty"`
    Message         string `json:"message"`
    RequestedSchema any    `json:"requestedSchema"`
}

Fields:

  • Meta: Reserved metadata field
  • Message: Message to present to the user
  • RequestedSchema: JSON schema object defining requested schema

Methods:

func (p *ElicitParams) GetProgressToken() any
func (p *ElicitParams) SetProgressToken(t any)

ElicitRequest

Type alias for elicitation requests.

type ElicitRequest = ClientRequest[*ElicitParams]

ElicitResult

Client's response to an elicitation request.

type ElicitResult struct {
    Meta    `json:"_meta,omitempty"`
    Action  string         `json:"action"`
    Content map[string]any `json:"content,omitempty"`
}

Fields:

  • Meta: Reserved metadata field
  • Action: User action ("accept", "decline", or "cancel")
  • Content: Submitted form data (only present when action is "accept")

Root Protocol Types

ListRootsParams

Parameters for listing client roots.

type ListRootsParams struct {
    Meta `json:"_meta,omitempty"`
}

Methods:

func (p *ListRootsParams) GetProgressToken() any
func (p *ListRootsParams) SetProgressToken(t any)

ListRootsRequest

Type alias for list roots requests.

type ListRootsRequest = ClientRequest[*ListRootsParams]

ListRootsResult

Client's response to a list roots request.

type ListRootsResult struct {
    Meta  `json:"_meta,omitempty"`
    Roots []*Root `json:"roots"`
}

Fields:

  • Meta: Reserved metadata field
  • Roots: List of client roots

RootsListChangedParams

Parameters for roots list changed notifications.

type RootsListChangedParams struct {
    Meta `json:"_meta,omitempty"`
}

Methods:

func (p *RootsListChangedParams) GetProgressToken() any
func (p *RootsListChangedParams) SetProgressToken(t any)

RootsListChangedRequest

Type alias for roots list changed notification requests.

type RootsListChangedRequest = ServerRequest[*RootsListChangedParams]

Completion Protocol Types

CompleteParams

Parameters for completion requests.

type CompleteParams struct {
    Meta     `json:"_meta,omitempty"`
    Argument CompleteParamsArgument `json:"argument"`
    Context  *CompleteContext       `json:"context,omitempty"`
    Ref      *CompleteReference     `json:"ref"`
}

Fields:

  • Meta: Reserved metadata field
  • Argument: The argument's information
  • Context: Optional completion context
  • Ref: The completion reference

CompleteParamsArgument

Argument information for completion requests.

type CompleteParamsArgument struct {
    Name  string `json:"name"`
    Value string `json:"value"`
}

Fields:

  • Name: Name of the argument
  • Value: Value for completion matching

CompleteRequest

Type alias for completion requests.

type CompleteRequest = ServerRequest[*CompleteParams]

CompleteResult

Server's response to a completion request.

type CompleteResult struct {
    Meta       `json:"_meta,omitempty"`
    Completion CompletionResultDetails `json:"completion"`
}

Fields:

  • Meta: Reserved metadata field
  • Completion: Completion details

Logging Protocol Types

LoggingMessageParams

Parameters for logging messages.

type LoggingMessageParams struct {
    Meta   `json:"_meta,omitempty"`
    Data   any          `json:"data"`
    Level  LoggingLevel `json:"level"`
    Logger string       `json:"logger,omitempty"`
}

Fields:

  • Meta: Reserved metadata field
  • Data: Data to be logged
  • Level: Severity of the log message
  • Logger: Optional name of the logger

Methods:

func (p *LoggingMessageParams) GetProgressToken() any
func (p *LoggingMessageParams) SetProgressToken(t any)

LoggingMessageRequest

Type alias for logging message requests.

type LoggingMessageRequest = ClientRequest[*LoggingMessageParams]

SetLoggingLevelParams

Parameters for setting logging level.

type SetLoggingLevelParams struct {
    Meta  `json:"_meta,omitempty"`
    Level LoggingLevel `json:"level"`
}

Fields:

  • Meta: Reserved metadata field
  • Level: The logging level client wants to receive

Methods:

func (p *SetLoggingLevelParams) GetProgressToken() any
func (p *SetLoggingLevelParams) SetProgressToken(t any)

Progress Protocol Types

ProgressNotificationClientRequest

Type alias for progress notifications from server to client.

type ProgressNotificationClientRequest = ClientRequest[*ProgressNotificationParams]

ProgressNotificationServerRequest

Type alias for progress notifications from client to server.

type ProgressNotificationServerRequest = ServerRequest[*ProgressNotificationParams]

Initialization Protocol Types

InitializeParams

Parameters for initialization requests.

type InitializeParams struct {
    Meta            `json:"_meta,omitempty"`
    Capabilities    *ClientCapabilities `json:"capabilities"`
    ClientInfo      *Implementation     `json:"clientInfo"`
    ProtocolVersion string              `json:"protocolVersion"`
}

Fields:

  • Meta: Reserved metadata field
  • Capabilities: Client capabilities
  • ClientInfo: Client implementation information
  • ProtocolVersion: Latest MCP version the client supports

Methods:

func (p *InitializeParams) GetProgressToken() any
func (p *InitializeParams) SetProgressToken(t any)

InitializeRequest

Type alias for initialize requests.

type InitializeRequest = ClientRequest[*InitializeParams]

InitializeResult

Server's response after initialization.

type InitializeResult struct {
    Meta            `json:"_meta,omitempty"`
    Capabilities    *ServerCapabilities `json:"capabilities"`
    Instructions    string              `json:"instructions,omitempty"`
    ProtocolVersion string              `json:"protocolVersion"`
    ServerInfo      *Implementation     `json:"serverInfo"`
}

Fields:

  • Meta: Reserved metadata field
  • Capabilities: Server capabilities
  • Instructions: Instructions for using the server
  • ProtocolVersion: MCP version the server wants to use
  • ServerInfo: Server implementation information

InitializedParams

Parameters for initialized notifications.

type InitializedParams struct {
    Meta `json:"_meta,omitempty"`
}

Methods:

func (p *InitializedParams) GetProgressToken() any
func (p *InitializedParams) SetProgressToken(t any)

InitializedRequest

Type alias for initialized notification requests.

type InitializedRequest = ServerRequest[*InitializedParams]

Connection Management Types

PingParams

Parameters for ping requests.

type PingParams struct {
    Meta `json:"_meta,omitempty"`
}

Methods:

func (p *PingParams) GetProgressToken() any
func (p *PingParams) SetProgressToken(t any)

CancelledParams

Parameters for cancellation notifications.

type CancelledParams struct {
    Meta      `json:"_meta,omitempty"`
    Reason    string `json:"reason,omitempty"`
    RequestID any    `json:"requestId"`
}

Fields:

  • Meta: Reserved metadata field
  • Reason: Optional cancellation reason
  • RequestID: ID of the request to cancel

Methods:

func (p *CancelledParams) GetProgressToken() any
func (p *CancelledParams) SetProgressToken(t any)