pub enum McpMethod {
Show 19 variants
Initialize,
Ping,
ToolsList,
ToolsCall,
ResourcesList,
ResourcesRead,
ResourceTemplatesList,
PromptsList,
PromptsGet,
SetLogLevel,
Complete,
InitializedNotification,
CancelledNotification,
ProgressNotification,
LoggingMessageNotification,
RootsListChangedNotification,
SamplingCreateMessage,
ElicitationCreate,
RootsList,
}Expand description
Every method MCP defines, as of 2026-07-28.
One variant per method, so an unknown name cannot be confused with a known
one at the type level: lookup returning None is the only way to reach
-32601.
Variants§
Initialize
initialize.
Ping
ping.
ToolsList
tools/list.
ToolsCall
tools/call.
ResourcesList
resources/list.
ResourcesRead
resources/read.
ResourceTemplatesList
resources/templates/list.
PromptsList
prompts/list.
PromptsGet
prompts/get.
SetLogLevel
logging/setLevel.
Complete
completion/complete.
InitializedNotification
notifications/initialized.
CancelledNotification
notifications/cancelled.
ProgressNotification
notifications/progress.
LoggingMessageNotification
notifications/message.
RootsListChangedNotification
notifications/roots/list_changed.
SamplingCreateMessage
sampling/createMessage.
ElicitationCreate
elicitation/create.
RootsList
roots/list.
Implementations§
Source§impl McpMethod
impl McpMethod
Sourcepub const ALL: [Self; 19]
pub const ALL: [Self; 19]
Every method, in the order the specification introduces them.
Exists so a test can assert the direction a per-name test cannot: that
every variant is reachable from a name, not merely that every name has
a variant. A method added to the enum and forgotten in lookup is
otherwise a -32601 waiting to happen.
Sourcepub fn is_request(self) -> bool
pub fn is_request(self) -> bool
Whether a request naming this method is something a server answers.
Only informational. A server still has to consult the session’s
FeatureProfile before
answering, because a method can exist in the schema and be unavailable
in a given session — roots/list after roots is deprecated, or
sampling/createMessage from a client that never advertised sampling.
This answers the narrower question of whether the name is a request name
at all, which is what the router needs to pick between its two params
decoders.