pub struct ClientCapabilities {
pub tools: bool,
pub prompts: bool,
pub resources: bool,
pub sampling: bool,
}Expand description
Client capability configuration
Defines the capabilities that this client supports when connecting to MCP servers. These capabilities are sent during the initialization handshake to negotiate which features will be available during the session.
§Examples
use turbomcp_client::ClientCapabilities;
let capabilities = ClientCapabilities {
tools: true,
prompts: true,
resources: true,
sampling: false,
};Fields§
§tools: boolWhether the client supports tool calling
prompts: boolWhether the client supports prompts
resources: boolWhether the client supports resources
sampling: boolWhether the client supports sampling
Implementations§
Source§impl ClientCapabilities
impl ClientCapabilities
Sourcepub fn all() -> Self
pub fn all() -> Self
All capabilities enabled (tools, prompts, resources, sampling)
This is the most comprehensive configuration, enabling full MCP protocol support.
§Example
use turbomcp_client::ClientCapabilities;
let capabilities = ClientCapabilities::all();
assert!(capabilities.tools);
assert!(capabilities.prompts);
assert!(capabilities.resources);
assert!(capabilities.sampling);Sourcepub fn core() -> Self
pub fn core() -> Self
Core capabilities without sampling (tools, prompts, resources)
This is the recommended default for most applications. It enables all standard MCP features except server-initiated sampling requests.
§Example
use turbomcp_client::ClientCapabilities;
let capabilities = ClientCapabilities::core();
assert!(capabilities.tools);
assert!(capabilities.prompts);
assert!(capabilities.resources);
assert!(!capabilities.sampling);Sourcepub fn minimal() -> Self
pub fn minimal() -> Self
Minimal capabilities (tools only)
Use this for simple tool-calling clients that don’t need prompts, resources, or sampling support.
§Example
use turbomcp_client::ClientCapabilities;
let capabilities = ClientCapabilities::minimal();
assert!(capabilities.tools);
assert!(!capabilities.prompts);
assert!(!capabilities.resources);
assert!(!capabilities.sampling);Sourcepub fn only_tools() -> Self
pub fn only_tools() -> Self
Only tools enabled
Same as minimal(), provided for clarity.
Sourcepub fn only_resources() -> Self
pub fn only_resources() -> Self
Only resources enabled
Use this for resource-focused clients that don’t need tools or prompts.
§Example
use turbomcp_client::ClientCapabilities;
let capabilities = ClientCapabilities::only_resources();
assert!(!capabilities.tools);
assert!(!capabilities.prompts);
assert!(capabilities.resources);Sourcepub fn only_prompts() -> Self
pub fn only_prompts() -> Self
Only prompts enabled
Use this for prompt-focused clients that don’t need tools or resources.
§Example
use turbomcp_client::ClientCapabilities;
let capabilities = ClientCapabilities::only_prompts();
assert!(!capabilities.tools);
assert!(capabilities.prompts);
assert!(!capabilities.resources);Sourcepub fn only_sampling() -> Self
pub fn only_sampling() -> Self
Only sampling enabled
Use this for clients that exclusively handle server-initiated sampling requests.
Trait Implementations§
Source§impl Clone for ClientCapabilities
impl Clone for ClientCapabilities
Source§fn clone(&self) -> ClientCapabilities
fn clone(&self) -> ClientCapabilities
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more