pub struct ServerCapabilities {
pub completions: Option<Map<String, Value>>,
pub experimental: Option<HashMap<String, Map<String, Value>>>,
pub logging: Option<Map<String, Value>>,
pub prompts: Option<ServerCapabilitiesPrompts>,
pub resources: Option<ServerCapabilitiesResources>,
pub tasks: Option<ServerTasks>,
pub tools: Option<ServerCapabilitiesTools>,
}Expand description
Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities.
JSON schema
{
"description": "Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities.",
"type": "object",
"properties": {
"completions": {
"description": "Present if the server supports argument autocompletion suggestions.",
"type": "object",
"additionalProperties": true
},
"experimental": {
"description": "Experimental, non-standard capabilities that the server supports.",
"type": "object",
"additionalProperties": {
"type": "object",
"additionalProperties": true
}
},
"logging": {
"description": "Present if the server supports sending log messages to the client.",
"type": "object",
"additionalProperties": true
},
"prompts": {
"description": "Present if the server offers any prompt templates.",
"type": "object",
"properties": {
"listChanged": {
"description": "Whether this server supports notifications for changes to the prompt list.",
"type": "boolean"
}
}
},
"resources": {
"description": "Present if the server offers any resources to read.",
"type": "object",
"properties": {
"listChanged": {
"description": "Whether this server supports notifications for changes to the resource list.",
"type": "boolean"
},
"subscribe": {
"description": "Whether this server supports subscribing to resource updates.",
"type": "boolean"
}
}
},
"tasks": {
"description": "Present if the server supports task-augmented requests.",
"type": "object",
"properties": {
"cancel": {
"description": "Whether this server supports tasks/cancel.",
"type": "object",
"additionalProperties": true
},
"list": {
"description": "Whether this server supports tasks/list.",
"type": "object",
"additionalProperties": true
},
"requests": {
"description": "Specifies which request types can be augmented with tasks.",
"type": "object",
"properties": {
"tools": {
"description": "Task support for tool-related requests.",
"type": "object",
"properties": {
"call": {
"description": "Whether the server supports task-augmented tools/call requests.",
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
},
"tools": {
"description": "Present if the server offers any tools to call.",
"type": "object",
"properties": {
"listChanged": {
"description": "Whether this server supports notifications for changes to the tool list.",
"type": "boolean"
}
}
}
}
}Fields§
§completions: Option<Map<String, Value>>Present if the server supports argument autocompletion suggestions.
experimental: Option<HashMap<String, Map<String, Value>>>Experimental, non-standard capabilities that the server supports.
logging: Option<Map<String, Value>>Present if the server supports sending log messages to the client.
prompts: Option<ServerCapabilitiesPrompts>§resources: Option<ServerCapabilitiesResources>§tasks: Option<ServerTasks>§tools: Option<ServerCapabilitiesTools>Implementations§
Source§impl ServerCapabilities
impl ServerCapabilities
Sourcepub fn can_list_tasks(&self) -> bool
pub fn can_list_tasks(&self) -> bool
Returns true if the server supports listing tasks.
This is determined by whether the list capability is present.
Sourcepub fn can_cancel_tasks(&self) -> bool
pub fn can_cancel_tasks(&self) -> bool
Returns true if the server supports canceling tasks.
This is determined by whether the cancel capability is present.
Sourcepub fn can_run_task_augmented_tools(&self) -> bool
pub fn can_run_task_augmented_tools(&self) -> bool
Returns true if the server supports task-augmented tools/call requests
pub fn can_handle_request( &self, client_request: &ClientJsonrpcRequest, ) -> Result<(), RpcError>
Sourcepub fn can_accept_notification(
&self,
notification_method: &str,
) -> Result<(), RpcError>
pub fn can_accept_notification( &self, notification_method: &str, ) -> Result<(), RpcError>
Asserts that the server supports the requested notification.
Verifies that the server advertises support for the notification type, allowing callers to avoid sending notifications that the server does not support. This can be used to prevent issuing requests to peers that lack the required capability.
Trait Implementations§
Source§impl Clone for ServerCapabilities
impl Clone for ServerCapabilities
Source§fn clone(&self) -> ServerCapabilities
fn clone(&self) -> ServerCapabilities
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more