pub enum Capability {
Show 29 variants
Experimental,
Extensions,
Roots,
RootsListChanged,
Sampling,
SamplingContext,
SamplingTools,
Elicitation,
ElicitationForm,
ElicitationUrl,
Logging,
Prompts,
PromptsListChanged,
Resources,
ResourcesListChanged,
ResourcesSubscribe,
Tools,
ToolsListChanged,
Completions,
Tasks,
TasksCancel,
TasksList,
TasksRequests,
TasksRequestsElicitation,
TasksRequestsElicitationCreate,
TasksRequestsSampling,
TasksRequestsSamplingCreateMessage,
TasksRequestsTools,
TasksRequestsToolsCall,
}Expand description
A capability name as the specification spells it.
Fieldless, and one variant per leaf name in the capability trees. The
container names (roots, tasks, …) are variants too: a peer that
advertises roots has advertised that it has roots, and a feature gate on
“the peer has roots at all” is a real question that
FeatureProfile has to answer.
Variants§
Experimental
Client and server experimental bags. Present in every revision.
Extensions
extensions, new in 2026-07-28 on both sides.
Roots
Client roots. Deprecated in 2026-07-28 but still defined.
RootsListChanged
Client roots.listChanged, removed in 2026-07-28 along with the
notifications/roots/list_changed method.
Sampling
Client sampling. Deprecated in 2026-07-28 but still defined.
SamplingContext
Client sampling.context, added 2025-11-25.
SamplingTools
Client sampling.tools, added 2025-11-25 (SEP-1577).
Elicitation
Client elicitation, added 2025-06-18.
ElicitationForm
Client elicitation.form, added 2025-11-25 (SEP-1330).
ElicitationUrl
Client elicitation.url, added 2025-11-25 (SEP-1036).
Logging
Server logging. Deprecated in 2026-07-28; logging/setLevel is
removed, log level moves to _meta.
Prompts
Server prompts, every revision.
PromptsListChanged
Server prompts.listChanged, every revision.
Resources
Server resources, every revision.
ResourcesListChanged
Server resources.listChanged, every revision.
ResourcesSubscribe
Server resources.subscribe. The methods behind it are replaced in
2026-07-28; the capability is not.
Tools
Server tools, every revision.
ToolsListChanged
Server tools.listChanged, every revision.
Completions
Server completions, added 2025-03-26.
Tasks
tasks, added 2025-11-25 (SEP-1686) on both sides and removed
from both in 2026-07-28, where it moves to the
io.modelcontextprotocol/tasks extension (SEP-2663).
TasksCancel
Client and server tasks.cancel, 2025-11-25 only.
TasksList
Client and server tasks.list, 2025-11-25 only. The method was
removed in 2026-07-28 along with the capability.
TasksRequests
Client and server tasks.requests, 2025-11-25 only.
TasksRequestsElicitation
Client tasks.requests.elicitation, 2025-11-25 only.
TasksRequestsElicitationCreate
Client tasks.requests.elicitation.create, 2025-11-25 only.
TasksRequestsSampling
Client tasks.requests.sampling, 2025-11-25 only.
TasksRequestsSamplingCreateMessage
Client tasks.requests.sampling.createMessage, 2025-11-25 only.
TasksRequestsTools
Server tasks.requests.tools, 2025-11-25 only.
TasksRequestsToolsCall
Server tasks.requests.tools.call, 2025-11-25 only.
Implementations§
Source§impl Capability
impl Capability
Sourcepub fn bit(self) -> u128
pub fn bit(self) -> u128
The bit this capability occupies in a CapabilitySet.
The index is the position in Capability::ALL, found by name rather
than written by hand, so adding a variant cannot leave a stale
hand-assigned bit behind. Asserted to be a distinct in-range power of
two by every_capability_fits_in_the_bitset.
Not const: the indexing_slicing lint is denied workspace-wide, and
slice::get — the non-panicking form it demands — is not a
const-callable function on 1.98. The two cannot both be satisfied, and
an unchecked index in a const fn is not worth suppressing the lint
for: nothing here is evaluated at compile time.
Sourcepub fn defined_in(self, version: ProtocolVersion) -> bool
pub fn defined_in(self, version: ProtocolVersion) -> bool
Whether the given revision defines this capability at all.
Not the same question as whether a particular peer advertises it: a revision either has the name in its schema or it does not, and a peer on that revision either sends it or does not.