Table of Contents

Class RequestMethods

Namespace
ModelContextProtocol.Protocol.Messages
Assembly
ModelContextProtocol.dll

Provides constants with the names of common request methods used in the MCP protocol.

public static class RequestMethods
Inheritance
RequestMethods
Inherited Members

Fields

CompletionComplete

The name of the request method sent from the client to the server to ask for completion suggestions.

public const string CompletionComplete = "completion/complete"

Field Value

string

Remarks

This is used to provide autocompletion-like functionality for arguments in a resource reference or a prompt template. The client provides a reference (resource or prompt), argument name, and partial value, and the server responds with matching completion options.

Initialize

The name of the request method sent from the client to the server when it first connects, asking it initialize.

public const string Initialize = "initialize"

Field Value

string

Remarks

The initialize request is the first request sent by the client to the server. It provides client information and capabilities to the server during connection establishment. The server responds with its own capabilities and information, establishing the protocol version and available features for the session.

LoggingSetLevel

The name of the request method sent from the client to the server to adjust the logging level.

public const string LoggingSetLevel = "logging/setLevel"

Field Value

string

Remarks

This request allows clients to control which log messages they receive from the server by setting a minimum severity threshold. After processing this request, the server will send log messages with severity at or above the specified level to the client as LoggingMessageNotification notifications.

Ping

The name of the request method sent by either endpoint to check that the connected endpoint is still alive.

public const string Ping = "ping"

Field Value

string

PromptsGet

The name of the request method sent by the client to get a prompt provided by the server.

public const string PromptsGet = "prompts/get"

Field Value

string

PromptsList

The name of the request method sent from the client to request a list of the server's prompts.

public const string PromptsList = "prompts/list"

Field Value

string

ResourcesList

The name of the request method sent from the client to request a list of the server's resources.

public const string ResourcesList = "resources/list"

Field Value

string

ResourcesRead

The name of the request method sent from the client to read a specific server resource.

public const string ResourcesRead = "resources/read"

Field Value

string

ResourcesSubscribe

The name of the request method sent from the client to request ResourceUpdatedNotification notifications from the server whenever a particular resource changes.

public const string ResourcesSubscribe = "resources/subscribe"

Field Value

string

ResourcesTemplatesList

The name of the request method sent from the client to request a list of the server's resource templates.

public const string ResourcesTemplatesList = "resources/templates/list"

Field Value

string

ResourcesUnsubscribe

The name of the request method sent from the client to request unsubscribing from ResourceUpdatedNotification notifications from the server.

public const string ResourcesUnsubscribe = "resources/unsubscribe"

Field Value

string

RootsList

The name of the request method sent from the server to request a list of the client's roots.

public const string RootsList = "roots/list"

Field Value

string

SamplingCreateMessage

The name of the request method sent from the server to sample an large language model (LLM) via the client.

public const string SamplingCreateMessage = "sampling/createMessage"

Field Value

string

Remarks

This request allows servers to utilize an LLM available on the client side to generate text or image responses based on provided messages. It is part of the sampling capability in the Model Context Protocol and enables servers to access client-side AI models without needing direct API access to those models.

ToolsCall

The name of the request method sent from the client to request that the server invoke a specific tool.

public const string ToolsCall = "tools/call"

Field Value

string

ToolsList

The name of the request method sent from the client to request a list of the server's tools.

public const string ToolsList = "tools/list"

Field Value

string