### ServerCapabilities Builder Example Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.ServerCapabilities.html Example of how to build a ServerCapabilities instance using the builder pattern. ```APIDOC ## Builder ```rust let cap = ServerCapabilities::builder() .enable_logging() .enable_experimental() .enable_prompts() .enable_resources() .enable_tools() .enable_tool_list_changed() .build(); ``` ``` -------------------------------- ### Example Usage Source: https://docs.rs/rmcp/1.5.0/rmcp/model/enum.CreateElicitationRequestParams.html Examples demonstrating how to create instances of CreateElicitationRequestParams for both form-based and URL-based elicitation. ```APIDOC ## Example Usage ### 1. Form-based elicitation request ```rust use rmcp::model::*; let params = CreateElicitationRequestParams::FormElicitationParams { meta: None, message: "Please provide your email".to_string(), requested_schema: ElicitationSchema::builder() .required_email("email") .build() .unwrap(), }; ``` ### 2. URL-based elicitation request ```rust use rmcp::model::*; let params = CreateElicitationRequestParams::UrlElicitationParams { meta: None, message: "Please provide your feedback at the following URL".to_string(), url: "https://example.com/feedback".to_string(), elicitation_id: "unique-id-123".to_string(), }; ``` ``` -------------------------------- ### serve Source: https://docs.rs/rmcp/1.5.0/rmcp/service/struct.RoleClient.html Starts serving the service. This method is available when the `client` or `server` crate features are enabled. ```APIDOC ## fn serve(self, transport: T) -> impl Future, R::InitializeError>> + MaybeSendFuture ### Description Starts serving the service. ### Method fn ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (Result) - **RunningService** - A future that resolves to the running service. #### Error Response (Result) - **R::InitializeError** - An error that occurred during service initialization. ### Availability Available on **crate features`client` or `server`** only. ``` -------------------------------- ### URL-based Elicitation Request Example Source: https://docs.rs/rmcp/1.5.0/rmcp/model/enum.CreateElicitationRequestParams.html Example of creating a URL-based elicitation request, directing the user to a specific URL. ```rust use rmcp::model::*; let params = CreateElicitationRequestParams::UrlElicitationParams { meta: None, message: "Please provide your feedback at the following URL".to_string(), url: "https://example.com/feedback".to_string(), elicitation_id: "unique-id-123".to_string(), }; ``` -------------------------------- ### serve_with_ct Source: https://docs.rs/rmcp/1.5.0/rmcp/service/struct.RoleClient.html Starts serving with a cancellation token. This method is available when the `client` or `server` crate features are enabled. ```APIDOC ## fn serve_with_ct(self, transport: T, ct: CancellationToken) -> impl Future, ClientInitializeError>> + MaybeSendFuture ### Description Starts serving with a cancellation token. ### Method fn ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (Result) - **RunningService** - A future that resolves to the running service. #### Error Response (Result) - **ClientInitializeError** - An error that occurred during client initialization. ### Availability Available on **crate features`client` or `server`** only. ``` -------------------------------- ### serve_with_ct Source: https://docs.rs/rmcp/1.5.0/rmcp/service/struct.RoleServer.html Starts a RoleServer service with a transport and a cancellation token. This method is available when the 'client' or 'server' crate features are enabled. ```APIDOC ## serve_with_ct ### Description Starts a RoleServer service with a transport and a cancellation token. ### Method ``` impl ServiceExt for S where S: Service, ``` ### Signature ```rust fn serve_with_ct(self, transport: T, ct: CancellationToken) -> impl Future, ServerInitializeError>> + MaybeSendFuture where T: IntoTransport, E: Error + Send + Sync + 'static, ``` ### Type Parameters - `T`: The type of the transport. - `E`: The error type associated with the transport. - `A`: Additional type parameter for the transport. ### Parameters - `transport`: The transport to use for serving the service. - `ct`: A `CancellationToken` to signal when the service should stop. ### Returns A future that resolves to a `RunningService` or a `ServerInitializeError`. ### Availability Available on **crate features`client` or `server`** only. ``` -------------------------------- ### ServiceExt Implementation - serve_with_ct Source: https://docs.rs/rmcp/1.5.0/rmcp/service/struct.TowerHandler.html Starts a service with a transport and cancellation token. Available on crate features`client` or `server` only. ```rust fn serve_with_ct( self, transport: T, ct: CancellationToken, ) -> impl Future, ClientInitializeError>> + MaybeSendFuture ``` -------------------------------- ### ServiceExt::serve_with_ct Source: https://docs.rs/rmcp/1.5.0/rmcp/service/struct.TowerHandler.html Starts a service with a cancellation token. This method is available on crate features`client` or `server` only. ```APIDOC ## `serve_with_ct` ```rust fn serve_with_ct< T, E, A, >(self, transport: T, ct: CancellationToken) -> impl Future, ClientInitializeError>> + MaybeSendFuture ``` Starts a service with a cancellation token. This method is available on crate features`client` or `server` only. ``` -------------------------------- ### serve Source: https://docs.rs/rmcp/1.5.0/rmcp/service/struct.RoleServer.html Starts a RoleServer service with a given transport. This method is available when the 'client' or 'server' crate features are enabled. ```APIDOC ## serve ### Description Starts a RoleServer service with a given transport. ### Method ``` impl ServiceExt for S where S: Service, ``` ### Signature ```rust fn serve(self, transport: T) -> impl Future, R::InitializeError>> + MaybeSendFuture where T: IntoTransport, E: Error + Send + Sync + 'static, Self: Sized, ``` ### Type Parameters - `T`: The type of the transport. - `E`: The error type associated with the transport. - `A`: Additional type parameter for the transport. ### Parameters - `transport`: The transport to use for serving the service. ### Returns A future that resolves to a `RunningService` or an initialization error. ### Availability Available on **crate features`client` or `server`** only. ``` -------------------------------- ### ClientCapabilities Builder Usage Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.ClientCapabilities.html Example of how to use the ClientCapabilities builder to construct a capabilities object. ```APIDOC ## §Builder ``` let cap = ClientCapabilities::builder() .enable_experimental() .enable_roots() .enable_roots_list_changed() .build(); ``` ``` -------------------------------- ### Get Running Task Count Source: https://docs.rs/rmcp/1.5.0/rmcp/task_manager/struct.OperationProcessor.html Get the number of tasks currently running. ```rust pub fn running_task_count(&mut self) -> usize ``` -------------------------------- ### initialize Source: https://docs.rs/rmcp/1.5.0/rmcp/handler/server/trait.ServerHandler.html Initializes the server with provided parameters. ```APIDOC ## initialize ### Description Initializes the server with provided parameters. ### Method `initialize` ### Parameters - `request`: `InitializeRequestParams` - The initialization parameters. - `context`: `RequestContext` - The request context. ### Returns - `impl Future>` ``` -------------------------------- ### Create TokioChildProcess with Builder Source: https://docs.rs/rmcp/1.5.0/rmcp/transport/child_process/struct.TokioChildProcess.html Use the `builder` function to get an entry point for creating a TokioChildProcess with fine-grained control over stdio configurations. ```rust pub fn builder(command: impl Into) -> TokioChildProcessBuilder ``` -------------------------------- ### Building a Multi-Select EnumSchema Source: https://docs.rs/rmcp/1.5.0/rmcp/model/enum.EnumSchema.html Example of creating a multi-select EnumSchema with specified values, multiselect option, min/max items, and a description. ```rust use rmcp::model::*; let enum_schema = EnumSchema::builder(vec!["US".to_string(), "UK".to_string()]) .multiselect() .min_items(1u64).expect("Min items should be correct value") .max_items(4u64).expect("Max items should be correct value") .description("Country code") .build(); ``` -------------------------------- ### initialize Source: https://docs.rs/rmcp/1.5.0/rmcp/handler/server/trait.ServerHandler.html Initializes the server. This method is used to set up the server with initial parameters. ```APIDOC ## initialize ### Description Initializes the server. ### Method `initialize` ### Parameters - `request`: `InitializeRequestParams` - The initialization parameters. - `context`: `RequestContext` - The request context. ### Returns - `impl Future>` - A future that resolves to the initialization result. ``` -------------------------------- ### initialize Source: https://docs.rs/rmcp/1.5.0/rmcp/handler/server/trait.ServerHandler.html Initializes the server with the given parameters. This method is available only when the `local` crate feature is disabled. ```APIDOC ## initialize ### Description Initializes the server with the specified request parameters. ### Method `initialize` ### Parameters - `request`: `InitializeRequestParams` - The initialization parameters. - `context`: `RequestContext` - The request context. ### Returns - `Result` - A future that resolves to the initialization result or an error. ``` -------------------------------- ### Get BTreeMap Length Source: https://docs.rs/rmcp/1.5.0/rmcp/model/type.ExperimentalCapabilities.html Use `len()` to get the number of elements currently in the map. This is a constant-time operation. ```rust use std::collections::BTreeMap; let mut a = BTreeMap::new(); assert_eq!(a.len(), 0); a.insert(1, "a"); assert_eq!(a.len(), 1); ``` -------------------------------- ### Form-based Elicitation Request Example Source: https://docs.rs/rmcp/1.5.0/rmcp/model/enum.CreateElicitationRequestParams.html Example of creating a form-based elicitation request with a required email schema. ```rust use rmcp::model::*; let params = CreateElicitationRequestParams::FormElicitationParams { meta: None, message: "Please provide your email".to_string(), requested_schema: ElicitationSchema::builder() .required_email("email") .build() .unwrap(), }; ``` -------------------------------- ### Initialize and Populate ExtensionCapabilities Source: https://docs.rs/rmcp/1.5.0/rmcp/model/type.ExtensionCapabilities.html Demonstrates how to create a new ExtensionCapabilities map and insert an extension with specific settings, like UI mime types. ```rust use rmcp::model::ExtensionCapabilities; use serde_json::json; let mut extensions = ExtensionCapabilities::new(); extensions.insert( "io.modelcontextprotocol/ui".to_string(), serde_json::from_value(json!({ "mimeTypes": ["text/html;profile=mcp-app"] })).unwrap() ); ``` -------------------------------- ### Send Authorized GET Request Source: https://docs.rs/rmcp/1.5.0/rmcp/transport/auth/struct.AuthorizedHttpClient.html Sends an authorized GET request to the specified URL. Returns a Response or an AuthError. ```rust pub async fn get(&self, url: U) -> Result ``` -------------------------------- ### Building ServerCapabilities Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.ServerCapabilities.html Demonstrates how to build a ServerCapabilities instance using a builder pattern, enabling various features. ```rust let cap = ServerCapabilities::builder() .enable_logging() .enable_experimental() .enable_prompts() .enable_resources() .enable_tools() .enable_tool_list_changed() .build(); ``` -------------------------------- ### Get BTreeMap Values Source: https://docs.rs/rmcp/1.5.0/rmcp/model/type.ExperimentalCapabilities.html Use `values()` to get an iterator over the map's values, in order by key. This provides immutable references to the values. ```rust use std::collections::BTreeMap; let mut a = BTreeMap::new(); a.insert(1, "hello"); a.insert(2, "goodbye"); let values: Vec<&str> = a.values().cloned().collect(); assert_eq!(values, ["hello", "goodbye"]); ``` -------------------------------- ### InitializeResult::with_instructions Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.InitializeResult.html Sets optional human-readable instructions on the InitializeResult. ```APIDOC ## fn with_instructions(self, instructions: impl Into) -> Self ### Description Set instructions on this result. ### Parameters - `instructions` (impl Into) - The instructions to set. ``` -------------------------------- ### Basic Key-Value Retrieval in BTreeMap Source: https://docs.rs/rmcp/1.5.0/rmcp/model/type.ExperimentalCapabilities.html Demonstrates the basic usage of `get` to retrieve a value associated with a key and checking for non-existent keys. ```rust use std::collections::BTreeMap; let mut map = BTreeMap::new(); map.insert(1, "a"); assert_eq!(map.get(&1), Some(&"a")); assert_eq!(map.get(&2), None); ``` -------------------------------- ### Get BTreeMap Keys Source: https://docs.rs/rmcp/1.5.0/rmcp/model/type.ExperimentalCapabilities.html Use `keys()` to get an iterator over the map's keys, in sorted order. This provides immutable references to the keys. ```rust use std::collections::BTreeMap; let mut a = BTreeMap::new(); a.insert(2, "b"); a.insert(1, "a"); let keys: Vec<_> = a.keys().cloned().collect(); assert_eq!(keys, [1, 2]); ``` -------------------------------- ### serve_directly Source: https://docs.rs/rmcp/1.5.0/rmcp/service/index.html Use this function to skip the initialization process. Available on crate features `client` or `server`. ```APIDOC ## serve_directly ### Description Use this function to skip the initialization process. Available on crate features `client` or `server`. ### Function Signature `serve_directly()` ``` -------------------------------- ### Get or insert a type into Extensions Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.Extensions.html Get a mutable reference to an extension of a specific type, inserting the provided value if the type is not already present. ```rust let mut ext = Extensions::new(); *ext.get_or_insert(1i32) += 2; assert_eq!(*ext.get::().unwrap(), 3); ``` -------------------------------- ### serve_server_with_ct Source: https://docs.rs/rmcp/1.5.0/rmcp/service/fn.serve_server_with_ct.html Initializes and serves a server with the provided service, transport, and cancellation token. Returns a RunningService or a ServerInitializeError. ```APIDOC ## serve_server_with_ct ### Description Initializes and serves a server with the provided service, transport, and cancellation token. Returns a RunningService or a ServerInitializeError. ### Signature ```rust pub async fn serve_server_with_ct( service: S, transport: T, ct: CancellationToken, ) -> Result, ServerInitializeError> where S: Service, T: IntoTransport, E: Error + Send + Sync + 'static, ``` ### Availability Available on (crate features`client` or `server`) and crate feature `server` only. ``` -------------------------------- ### Get or insert with a closure into Extensions Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.Extensions.html Get a mutable reference to an extension of a specific type, inserting a value generated by a closure if the type is not already present. ```rust let mut ext = Extensions::new(); *ext.get_or_insert_with(|| 1i32) += 2; assert_eq!(*ext.get::().unwrap(), 3); ``` -------------------------------- ### PromptContext::new Constructor Source: https://docs.rs/rmcp/1.5.0/rmcp/handler/server/prompt/struct.PromptContext.html Creates a new instance of PromptContext. ```APIDOC ### impl<'a, S> PromptContext<'a, S> #### pub fn new( server: &'a S, name: String, arguments: Option>, context: RequestContext, ) -> Self ``` -------------------------------- ### Get Mutable BTreeMap Values Source: https://docs.rs/rmcp/1.5.0/rmcp/model/type.ExperimentalCapabilities.html Use `values_mut()` to get a mutable iterator over the map's values, in order by key. This allows modification of values in place. ```rust use std::collections::BTreeMap; let mut a = BTreeMap::new(); a.insert(1, String::from("hello")); a.insert(2, String::from("goodbye")); for value in a.values_mut() { value.push_str("!"); } let values: Vec = a.values().cloned().collect(); assert_eq!(values, [String::from("hello!"), String::from("goodbye!")]); ``` -------------------------------- ### Building ClientCapabilities Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.ClientCapabilities.html Demonstrates how to use the builder pattern to construct a ClientCapabilities instance with specific features enabled. This is the recommended way to create instances due to the struct's non-exhaustive nature. ```rust let cap = ClientCapabilities::builder() .enable_experimental() .enable_roots() .enable_roots_list_changed() .build(); ``` -------------------------------- ### Get or insert default into Extensions Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.Extensions.html Get a mutable reference to an extension of a specific type, inserting the type's default value if it's not already present. ```rust let mut ext = Extensions::new(); *ext.get_or_insert_default::() += 2; assert_eq!(*ext.get::().unwrap(), 2); ``` -------------------------------- ### Create New Prompt Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.Prompt.html Constructs a new Prompt instance with a given name, optional description, and optional arguments. Use this when initializing a prompt. ```rust pub fn new( name: N, description: Option, arguments: Option>, ) -> Self where N: Into, D: Into, ``` -------------------------------- ### name Source: https://docs.rs/rmcp/1.5.0/rmcp/transport/streamable_http_client/type.StreamableHttpClientTransport.html Get the name of the transport. ```APIDOC ## name ### Description Get the name of the transport. ### Method `name` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (Cow<'static, str>) The static name of the transport. #### Response Example ```json { "example": "Cow<'static, str>" } ``` ``` -------------------------------- ### type_id Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.RawResource.html Gets the TypeId of self. ```APIDOC ## fn type_id(&self) -> TypeId ### Description Gets the `TypeId` of `self`. ### Method `type_id` ### Parameters None ### Returns - `TypeId`: The type identifier of `self`. ``` -------------------------------- ### Get Raw Pointer to Arc Data Source: https://docs.rs/rmcp/1.5.0/rmcp/transport/common/server_side_http/type.SessionId.html Use `as_ptr` to get a raw pointer to the data owned by an Arc. The pointer is valid as long as strong counts exist. This method is available only when the `client` feature is enabled. ```rust use std::sync::Arc; let x = Arc::new("hello".to_owned()); let y = Arc::clone(&x); let x_ptr = Arc::as_ptr(&x); assert_eq!(x_ptr, Arc::as_ptr(&y)); assert_eq!(unsafe { &*x_ptr }, "hello"); ``` -------------------------------- ### Example Usage of ElicitationSchemaBuilder Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.ElicitationSchemaBuilder.html Demonstrates how to use the ElicitationSchemaBuilder to construct an elicitation schema with various property types and configurations. ```rust use rmcp::model::*; let schema = ElicitationSchema::builder() .required_email("email") .required_integer("age", 0, 150) .optional_bool("newsletter", false) .description("User registration") .build(); ``` -------------------------------- ### Get String as a Byte Slice Source: https://docs.rs/rmcp/1.5.0/rmcp/model/type.Cursor.html Use `as_bytes` to get a byte slice view of the String's contents. This is useful for low-level operations or when interacting with APIs that expect byte slices. The inverse operation is `from_utf8`. ```rust let s = String::from("hello"); assert_eq!(&[104, 101, 108, 108, 111], s.as_bytes()); ``` -------------------------------- ### Tool Creation and Configuration Methods Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.Tool.html Provides methods for creating new Tool instances and configuring their properties. ```APIDOC ## impl Tool ### pub fn new(name: N, description: D, input_schema: S) -> Self Create a new tool with the given name and description. ### pub fn new_with_raw( name: N, description: Option>, input_schema: S, ) -> Self Create a new tool with just a name and input schema (no description). ### pub fn with_title(self, title: impl Into) -> Self Set the human-readable title. ### pub fn with_raw_output_schema(self, output_schema: Arc) -> Self Set the output schema from a raw value. ### pub fn with_annotations(self, annotations: ToolAnnotations) -> Self Set the annotations. ### pub fn with_icons(self, icons: Vec) -> Self Set the icons. ### pub fn with_meta(self, meta: Meta) -> Self Set the metadata. ### pub fn annotate(self, annotations: ToolAnnotations) -> Self ### pub fn with_execution(self, execution: ToolExecution) -> Self Set the execution configuration for this tool. ### pub fn task_support(&self) -> TaskSupport Returns the task support mode for this tool. Returns `TaskSupport::Forbidden` if not explicitly set. ### pub fn with_output_schema(self) -> Self Available on **crate feature`server`** only. Set the output schema using a type that implements JsonSchema. #### Panics Panics if the generated schema does not have root type “object” as required by MCP specification. ### pub fn with_input_schema(self) -> Self Available on **crate feature`server`** only. Set the input schema using a type that implements JsonSchema. ### pub fn schema_as_json_value(&self) -> Value Get the schema as json value. ``` -------------------------------- ### type_id Source: https://docs.rs/rmcp/1.5.0/rmcp/model/enum.JsonRpcMessage.html Gets the `TypeId` of the `JsonRpcMessage` instance. ```APIDOC ## fn type_id(&self) -> TypeId Gets the `TypeId` of `self`. ``` -------------------------------- ### PromptRouter::new Source: https://docs.rs/rmcp/1.5.0/rmcp/handler/server/router/prompt/struct.PromptRouter.html Creates a new, empty PromptRouter instance. ```APIDOC ## PromptRouter::new ### Description Creates a new, empty `PromptRouter` instance. ### Method `new()` ### Returns A new `PromptRouter` with an empty map of routes. ``` -------------------------------- ### Get immutable cursor after the greatest key smaller than a bound Source: https://docs.rs/rmcp/1.5.0/rmcp/model/type.ExperimentalCapabilities.html Use `upper_bound` to get an immutable cursor positioned after the greatest key strictly less than the specified bound. This is useful for inspecting elements relative to a key without modification. ```rust #![feature(btree_cursors)] use std::collections::BTreeMap; use std::ops::Bound; let map = BTreeMap::from([ (1, "a"), (2, "b"), (3, "c"), (4, "d"), ]); let cursor = map.upper_bound(Bound::Included(&3)); assert_eq!(cursor.peek_prev(), Some((&3, &"c"))); assert_eq!(cursor.peek_next(), Some((&4, &"d"))); ``` ```rust #![feature(btree_cursors)] use std::collections::BTreeMap; use std::ops::Bound; let map = BTreeMap::from([ (1, "a"), (2, "b"), (3, "c"), (4, "d"), ]); let cursor = map.upper_bound(Bound::Excluded(&3)); assert_eq!(cursor.peek_prev(), Some((&2, &"b"))); assert_eq!(cursor.peek_next(), Some((&3, &"c"))); ``` ```rust #![feature(btree_cursors)] use std::collections::BTreeMap; use std::ops::Bound; let map = BTreeMap::from([ (1, "a"), (2, "b"), (3, "c"), (4, "d"), ]); let cursor = map.upper_bound(Bound::Unbounded); assert_eq!(cursor.peek_prev(), Some((&4, &"d"))); assert_eq!(cursor.peek_next(), None); ``` -------------------------------- ### ServerCapabilitiesBuilder::enable_prompts_with Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.ServerCapabilitiesBuilder.html Enables prompt capabilities with a specific configuration. ```APIDOC ## ServerCapabilitiesBuilder::enable_prompts_with ### Description Enables prompt features and configures them with the provided `PromptsCapability` object. This method returns a new builder instance. ### Method `enable_prompts_with(prompts: PromptsCapability)` ### Parameters - **prompts** (`PromptsCapability`): The configuration for prompt capabilities. ### Returns - `ServerCapabilitiesBuilder`: A new builder instance with the specified prompt capabilities. ``` -------------------------------- ### weak_count Source: https://docs.rs/rmcp/1.5.0/rmcp/transport/common/server_side_http/type.SessionId.html Gets the number of Weak pointers to the allocation. ```APIDOC ## weak_count ### Description Gets the number of `Weak` pointers to this allocation. ### Method `pub fn weak_count(this: &Arc) -> usize` ### Safety This method by itself is safe, but using it correctly requires extra care. Another thread can change the weak count at any time, including potentially between calling this method and acting on the result. ### Availability Available on **crate feature`client`** only. ### Examples ```rust use std::sync::Arc; let five = Arc::new(5); let _weak_five = Arc::downgrade(&five); // This assertion is deterministic because we haven't shared // the `Arc` or `Weak` between threads. assert_eq!(1, Arc::weak_count(&five)); ``` ``` -------------------------------- ### Iterate Over a Sub-Range of BTreeMap Elements Source: https://docs.rs/rmcp/1.5.0/rmcp/model/type.ExperimentalCapabilities.html Constructs a double-ended iterator over a sub-range of elements. Supports various range syntaxes like `min..max` or `(Bound, Bound)`. Panics if range start > end, or if start == end with both bounds excluded. ```rust use std::collections::BTreeMap; use std::ops::Bound::Included; let mut map = BTreeMap::new(); map.insert(3, "a"); map.insert(5, "b"); map.insert(8, "c"); for (&key, &value) in map.range((Included(&4), Included(&8))) { println!("{key}: {value}"); } assert_eq!(Some((&5, &"b")), map.range(4..).next()); ``` -------------------------------- ### Set Implementation Website URL Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.Implementation.html Chains a website URL to an `Implementation` builder. Use this to link to the official website or documentation for the implementation. ```rust pub fn with_website_url(self, website_url: impl Into) -> Self ``` -------------------------------- ### strong_count Source: https://docs.rs/rmcp/1.5.0/rmcp/transport/common/server_side_http/type.SessionId.html Gets the number of strong (Arc) pointers to the allocation. ```APIDOC ## strong_count ### Description Gets the number of strong (`Arc`) pointers to this allocation. ### Method `pub fn strong_count(this: &Arc) -> usize` ### Safety This method by itself is safe, but using it correctly requires extra care. Another thread can change the strong count at any time, including potentially between calling this method and acting on the result. ### Availability Available on **crate feature`client`** only. ### Examples ```rust use std::sync::Arc; let five = Arc::new(5); let _also_five = Arc::clone(&five); // This assertion is deterministic because we haven't shared // the `Arc` between threads. assert_eq!(2, Arc::strong_count(&five)); ``` ``` -------------------------------- ### ServerCapabilitiesBuilder::enable_experimental_with Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.ServerCapabilitiesBuilder.html Enables experimental capabilities with a specific configuration. ```APIDOC ## ServerCapabilitiesBuilder::enable_experimental_with ### Description Enables experimental features and configures them with the provided `ExperimentalCapabilities` object. This method returns a new builder instance. ### Method `enable_experimental_with(experimental: ExperimentalCapabilities)` ### Parameters - **experimental** (`ExperimentalCapabilities`): The configuration for experimental capabilities. ### Returns - `ServerCapabilitiesBuilder`: A new builder instance with the specified experimental capabilities. ``` -------------------------------- ### Get Session ID Source: https://docs.rs/rmcp/1.5.0/rmcp/transport/streamable_http_server/session/local/struct.LocalSessionHandle.html Retrieves the unique identifier for the session. ```APIDOC ## id ### Description Get the session id. ### Method `id(&self) -> &SessionId` ``` -------------------------------- ### InitializeResult::with_server_info Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.InitializeResult.html Sets the server implementation information on the InitializeResult. ```APIDOC ## fn with_server_info(self, server_info: Implementation) -> Self ### Description Set the server info on this result. ### Parameters - `server_info` (Implementation) - The server information to set. ``` -------------------------------- ### ClientCapabilitiesBuilder::enable_experimental_with Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.ClientCapabilitiesBuilder.html Enables experimental capabilities with a specific configuration. ```APIDOC ## ClientCapabilitiesBuilder::enable_experimental_with ### Description Enables experimental capabilities for the client and sets a specific `ExperimentalCapabilities` configuration. This method returns a new builder instance with the experimental flag and configuration set. ### Method `enable_experimental_with(experimental: ExperimentalCapabilities)` ### Parameters - `experimental` (ExperimentalCapabilities): The specific experimental capabilities to enable. ### Return Value - `ClientCapabilitiesBuilder`: A new builder instance with the specified experimental capabilities enabled. ``` -------------------------------- ### Get Session ID Source: https://docs.rs/rmcp/1.5.0/rmcp/transport/streamable_http_server/session/local/struct.LocalSessionHandle.html Retrieves the unique identifier for the session. ```rust pub async fn id(&self) -> &SessionId ``` -------------------------------- ### AuthorizedHttpClient::get Source: https://docs.rs/rmcp/1.5.0/rmcp/transport/auth/struct.AuthorizedHttpClient.html Sends an authorized HTTP GET request. ```APIDOC ## AuthorizedHttpClient::get ### Description Sends an authorized GET request. ### Signature ```rust pub async fn get(&self, url: U) -> Result ``` ### Parameters * `url`: The URL to send the GET request to. Must implement `IntoUrl`. ### Returns A `Result` containing the `Response` on success, or an `AuthError` on failure. ``` -------------------------------- ### Create an empty Extensions Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.Extensions.html Use `Extensions::new()` to initialize an empty set of extensions. ```rust let mut ext = Extensions::new(); ``` -------------------------------- ### OperationProcessor::running_task_count Source: https://docs.rs/rmcp/1.5.0/rmcp/task_manager/struct.OperationProcessor.html Gets the number of currently running tasks. ```APIDOC ## OperationProcessor::running_task_count ### Description Get the number of running tasks. ### Signature ```rust pub fn running_task_count(&mut self) -> usize ``` ### Returns `usize` - The number of running tasks. ``` -------------------------------- ### new Source: https://docs.rs/rmcp/1.5.0/rmcp/transport/auth/enum.OAuthState.html Creates a new OAuth state machine. Requires a base URL and an optional HTTP client. ```APIDOC ## `new` `pub async fn new( base_url: U, client: Option, ) -> Result` Create new OAuth state machine. ``` -------------------------------- ### impl Any for T Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.Extensions.html Provides the `type_id` method to get the `TypeId` of a type. ```APIDOC ## fn type_id(&self) -> TypeId ### Description Gets the `TypeId` of `self`. ### Method `type_id` ### Parameters None ### Response - **TypeId**: The unique identifier for the type. ``` -------------------------------- ### Root::new Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.Root.html Creates a new `Root` instance with the provided URI. The `name` field defaults to `None`. ```APIDOC ## `Root::new` ### Description Creates a new `Root` with the given URI. `name` defaults to `None`. ### Signature ```rust pub fn new(uri: impl Into) -> Self ``` ### Parameters * `uri`: `impl Into` - The URI for the new root. ``` -------------------------------- ### AuthorizationManager::get_scope_upgrade_attempts Source: https://docs.rs/rmcp/1.5.0/rmcp/transport/auth/struct.AuthorizationManager.html Gets the number of scope upgrade attempts made. ```APIDOC ## AuthorizationManager::get_scope_upgrade_attempts ### Description Get the number of scope upgrade attempts made. ### Method `pub async fn get_scope_upgrade_attempts(&self) -> u32` ### Returns `u32`: The number of scope upgrade attempts. ``` -------------------------------- ### AuthClient::new Source: https://docs.rs/rmcp/1.5.0/rmcp/transport/auth/struct.AuthClient.html Creates a new instance of AuthClient, initializing it with an HTTP client and an authorization manager. ```APIDOC ## AuthClient::new ### Description Create a new authorized HTTP client. ### Signature ```rust pub fn new(http_client: C, auth_manager: AuthorizationManager) -> Self ``` ### Parameters * `http_client`: The underlying HTTP client to be used. * `auth_manager`: The authorization manager responsible for handling authentication tokens. ``` -------------------------------- ### Get Extensions for CustomNotification Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.CustomNotification.html Provides immutable access to the extensions of a CustomNotification. ```rust fn extensions(&self) -> &Extensions ``` -------------------------------- ### Constructor Methods Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.CompletionInfo.html Provides methods for creating instances of CompletionInfo with different configurations. ```APIDOC ## Constructor Methods ### `new(values: Vec) -> Result` Create a new CompletionInfo with validation for maximum values. ### `with_all_values(values: Vec) -> Result` Create CompletionInfo with all values and no pagination. ### `with_pagination(values: Vec, total: Option, has_more: bool) -> Result` Create CompletionInfo with pagination information. ``` -------------------------------- ### Inspecting References Source: https://docs.rs/rmcp/1.5.0/rmcp/model/enum.Reference.html Methods to get information about the type and content of a Reference. ```APIDOC /// Get the reference type as a string pub fn reference_type(&self) -> &'static str ``` ```APIDOC /// Extract prompt name if this is a prompt reference pub fn as_prompt_name(&self) -> Option<&str> ``` ```APIDOC /// Extract resource URI if this is a resource reference pub fn as_resource_uri(&self) -> Option<&str> ``` -------------------------------- ### Get Progress Token Source: https://docs.rs/rmcp/1.5.0/rmcp/handler/client/progress/struct.ProgressSubscriber.html Retrieves the progress token associated with the ProgressSubscriber. ```rust pub fn progress_token(&self) -> &ProgressToken ``` -------------------------------- ### InitializeResult::new Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.InitializeResult.html Creates a new InitializeResult with a default protocol version and the provided server capabilities. ```APIDOC ## fn new(capabilities: ServerCapabilities) -> Self ### Description Create a new `InitializeResult` with default protocol version and the given capabilities. ### Parameters - `capabilities` (ServerCapabilities) - The server capabilities to initialize with. ``` -------------------------------- ### from Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.RawResource.html Creates a new instance from a given value. ```APIDOC ## fn from(t: T) -> T ### Description Returns the argument unchanged. ### Method `from` ### Parameters - `t` (T): The value to convert from. ### Returns - `T`: The converted value. ``` -------------------------------- ### Get the number of extensions Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.Extensions.html Return the count of extensions currently stored in the set. ```rust let mut ext = Extensions::new(); assert_eq!(ext.len(), 0); ext.insert(5i32); assert_eq!(ext.len(), 1); ``` -------------------------------- ### Get Meta for CustomNotification Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.CustomNotification.html Provides immutable access to the meta information of a CustomNotification. ```rust fn get_meta(&self) -> &Meta ``` -------------------------------- ### `impl Implementation` Methods Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.Implementation.html Provides methods for creating and configuring `Implementation` instances. ```APIDOC ## `impl Implementation` ### `pub fn new(name: impl Into, version: impl Into) -> Self` Create a new `Implementation`. ### `pub fn from_build_env() -> Self` Create an `Implementation` from build environment variables. ### `pub fn with_title(self, title: impl Into) -> Self` Set the human-readable title for the implementation. ### `pub fn with_description(self, description: impl Into) -> Self` Set the description for the implementation. ### `pub fn with_icons(self, icons: Vec) -> Self` Set the icons for the implementation. ### `pub fn with_website_url(self, website_url: impl Into) -> Self` Set the website URL for the implementation. ``` -------------------------------- ### Get Mutable Extensions for CustomNotification Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.CustomNotification.html Provides mutable access to the extensions of a CustomNotification. ```rust fn extensions_mut(&mut self) -> &mut Extensions ``` -------------------------------- ### create_standalone_stream Source: https://docs.rs/rmcp/1.5.0/rmcp/transport/streamable_http_server/session/trait.SessionManager.html Create an SSE stream not tied to a specific client request (HTTP GET). ```APIDOC ## fn create_standalone_stream ### Description Create an SSE stream not tied to a specific client request (HTTP GET). ### Signature ```rust fn create_standalone_stream( &self, id: &SessionId, ) -> impl Future + Send + Sync + 'static, Self::Error>> + Send; ``` ``` -------------------------------- ### Get the required scope for upgrade Source: https://docs.rs/rmcp/1.5.0/rmcp/transport/streamable_http_client/struct.InsufficientScopeError.html Retrieves the required scope as a string slice if it is available. ```rust pub fn get_required_scope(&self) -> Option<&str> ``` -------------------------------- ### Initialize AuthorizationManager from Store Source: https://docs.rs/rmcp/1.5.0/rmcp/transport/auth/struct.AuthorizationManager.html Initializes the AuthorizationManager from stored credentials if available. It loads credentials and configures the client if found. ```rust pub async fn initialize_from_store(&mut self) -> Result ``` -------------------------------- ### Get Extra Fields Source: https://docs.rs/rmcp/1.5.0/rmcp/transport/auth/type.OAuthTokenResponse.html Retrieves a reference to the vendor-specific extra fields within a StandardTokenResponse. ```rust pub fn extra_fields(&self) -> &EF ``` -------------------------------- ### PolicyExt::or Method Source: https://docs.rs/rmcp/1.5.0/rmcp/handler/server/router/prompt/struct.PromptRoute.html Creates a new Policy that returns Action::Follow if either self or other policies return Action::Follow. ```rust fn or(self, other: P) -> Or where T: Policy, P: Policy, ``` -------------------------------- ### AuthorizationManager::get_access_token Source: https://docs.rs/rmcp/1.5.0/rmcp/transport/auth/struct.AuthorizationManager.html Gets the access token from the local credential store, refreshing it if necessary. ```APIDOC ## AuthorizationManager::get_access_token ### Description Get access token from local credential store. If expired, refresh it automatically when a refresh token is available. When the access token has expired and no refresh token is available (or the refresh itself fails), returns `AuthError::AuthorizationRequired` so the caller can re-authenticate. ### Method `pub async fn get_access_token(&self) -> Result` ### Returns `Result`: The access token string or an `AuthError`. ``` -------------------------------- ### ServerCapabilitiesBuilder::enable_extensions_with Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.ServerCapabilitiesBuilder.html Enables extension capabilities with a specific configuration. ```APIDOC ## ServerCapabilitiesBuilder::enable_extensions_with ### Description Enables extension features and configures them with the provided `ExtensionCapabilities` object. This method returns a new builder instance. ### Method `enable_extensions_with(extensions: ExtensionCapabilities)` ### Parameters - **extensions** (`ExtensionCapabilities`): The configuration for extension capabilities. ### Returns - `ServerCapabilitiesBuilder`: A new builder instance with the specified extension capabilities. ``` -------------------------------- ### RequestIdProvider Implementation for AtomicU32Provider Source: https://docs.rs/rmcp/1.5.0/rmcp/service/struct.AtomicU32Provider.html Provides a method to get the next request ID from the AtomicU32Provider. ```rust fn next_request_id(&self) -> RequestId ``` -------------------------------- ### ServerCapabilitiesBuilder::enable_prompts Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.ServerCapabilitiesBuilder.html Enables prompt capabilities for the server. ```APIDOC ## ServerCapabilitiesBuilder::enable_prompts ### Description Enables prompt capabilities for the server. This method returns a new builder instance with prompt capabilities enabled. ### Method `enable_prompts()` ### Returns - `ServerCapabilitiesBuilder`: A new builder instance with prompt capabilities enabled. ``` -------------------------------- ### ProgressTokenProvider Implementation for AtomicU32Provider Source: https://docs.rs/rmcp/1.5.0/rmcp/service/struct.AtomicU32Provider.html Provides a method to get the next progress token from the AtomicU32Provider. ```rust fn next_progress_token(&self) -> ProgressToken ``` -------------------------------- ### Get Mutable Meta for CustomNotification Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.CustomNotification.html Provides mutable access to the meta information of a CustomNotification. ```rust fn get_meta_mut(&mut self) -> &mut Meta ``` -------------------------------- ### ClientCapabilitiesBuilder::enable_roots_with Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.ClientCapabilitiesBuilder.html Enables root capabilities with a specific configuration. ```APIDOC ## ClientCapabilitiesBuilder::enable_roots_with ### Description Enables root capabilities for the client and sets a specific `RootsCapabilities` configuration. This method returns a new builder instance with the roots flag and configuration set. ### Method `enable_roots_with(roots: RootsCapabilities)` ### Parameters - `roots` (RootsCapabilities): The specific root capabilities to enable. ### Return Value - `ClientCapabilitiesBuilder`: A new builder instance with the specified root capabilities enabled. ``` -------------------------------- ### Start OAuth Authorization with Metadata URL Source: https://docs.rs/rmcp/1.5.0/rmcp/transport/auth/enum.OAuthState.html Initiates the OAuth authorization flow with an optional client metadata URL (SEP-991). Requires scopes, a redirect URI, and an optional client name. Returns a Result indicating success or an AuthError. ```rust pub async fn start_authorization_with_metadata_url( &mut self, scopes: &[&str], redirect_uri: &str, client_name: Option<&str>, client_metadata_url: Option<&str>, ) -> Result<(), AuthError> ``` -------------------------------- ### Get JSON Schema Name Source: https://docs.rs/rmcp/1.5.0/rmcp/model/enum.RawContent.html Returns the name of the generated JSON Schema for RawContent. ```rust fn schema_name() -> Cow<'static, str> ``` -------------------------------- ### serve_client Source: https://docs.rs/rmcp/1.5.0/rmcp/service/index.html Serves the client. Available on crate features `client` or `server`. ```APIDOC ## serve_client ### Description Serves the client. Available on crate features `client` or `server`. ### Function Signature `serve_client()` ``` -------------------------------- ### AuthorizationSession Source: https://docs.rs/rmcp/1.5.0/rmcp/transport/auth/index.html Represents an OAuth 2.0 authorization session to guide users through the authorization process. ```APIDOC ## Struct AuthorizationSession oauth2 authorization session, for guiding user to complete the authorization process. ``` -------------------------------- ### new Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.CompletionContext.html Creates a new, empty completion context. ```APIDOC ## pub fn new() -> Self ### Description Create a new empty completion context. ### Returns A new instance of `CompletionContext`. ``` -------------------------------- ### FromContextPart for Parameters

Source: https://docs.rs/rmcp/1.5.0/rmcp/handler/server/prompt/struct.PromptContext.html Allows Parameters

to be created from a PromptContext. ```APIDOC ### impl FromContextPart> for Parameters

where P: DeserializeOwned, #### fn from_context_part( context: &mut PromptContext<'_, S>, ) -> Result ``` -------------------------------- ### String Target Interface Source: https://docs.rs/rmcp/1.5.0/rmcp/model/type.Cursor.html Provides methods to get a mutable reference to the String and to finalize its construction. ```rust type Finished = String fn as_mut_string(&mut self) -> &mut String fn finish(self) -> String ``` -------------------------------- ### Create CompletionInfo with Pagination Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.CompletionInfo.html Creates a CompletionInfo instance with provided values and explicit pagination details, including the total number of available items and a flag indicating if more results exist. ```rust pub fn with_pagination( values: Vec, total: Option, has_more: bool, ) -> Result ``` -------------------------------- ### Get Session ID Source: https://docs.rs/rmcp/1.5.0/rmcp/transport/streamable_http_server/session/local/struct.LocalSessionWorker.html Retrieves the unique identifier for the session. This method is part of the LocalSessionWorker implementation. ```rust pub fn id(&self) -> &SessionId ``` -------------------------------- ### Get String Slice Source: https://docs.rs/rmcp/1.5.0/rmcp/model/type.Cursor.html Extracts an immutable string slice (`&str`) representing the entire String. ```rust let s = String::from("foo"); assert_eq!("foo", s.as_str()); ``` -------------------------------- ### serve_directly_with_ct Source: https://docs.rs/rmcp/1.5.0/rmcp/service/index.html Use this function to skip the initialization process with a cancellation token. Available on crate features `client` or `server`. ```APIDOC ## serve_directly_with_ct ### Description Use this function to skip the initialization process with a cancellation token. Available on crate features `client` or `server`. ### Function Signature `serve_directly_with_ct()` ``` -------------------------------- ### Get Prompt Request Source: https://docs.rs/rmcp/1.5.0/rmcp/service/struct.Peer.html Retrieves a prompt with the provided parameters. Available on the 'client' crate feature only. ```rust pub async fn get_prompt( &self, params: GetPromptRequestParams, ) -> Result ``` -------------------------------- ### List All Prompts Source: https://docs.rs/rmcp/1.5.0/rmcp/service/struct.Peer.html A wrapper method for `Peer::list_prompts` that repeatedly calls it to list all available prompts. Available on the 'client' crate feature only. ```rust pub async fn list_all_prompts(&self) -> Result, ServiceError> ``` -------------------------------- ### Get Task Descriptor Source: https://docs.rs/rmcp/1.5.0/rmcp/task_manager/struct.OperationProcessor.html Fetch the metadata for a running or recently completed task using its ID. ```rust pub fn task_descriptor(&self, task_id: &str) -> Option<&OperationDescriptor> ``` -------------------------------- ### List All Resources Source: https://docs.rs/rmcp/1.5.0/rmcp/service/struct.Peer.html A wrapper method for `Peer::list_resources` that repeatedly calls it to list all available resources. Available on the 'client' crate feature only. ```rust pub async fn list_all_resources(&self) -> Result, ServiceError> ``` -------------------------------- ### Get Transport Name with NeverTransport Source: https://docs.rs/rmcp/1.5.0/rmcp/service/struct.RoleServer.html Returns the name of the transport. Available on crate feature `transport-streamable-http-server-session` only. ```rust fn name() -> Cow<'static, str> ``` -------------------------------- ### serve_server Source: https://docs.rs/rmcp/1.5.0/rmcp/service/index.html Serves the server. Available on crate features `client` or `server`. ```APIDOC ## serve_server ### Description Serves the server. Available on crate features `client` or `server`. ### Function Signature `serve_server()` ``` -------------------------------- ### Get Schema as JSON Value Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.Tool.html Retrieves the schema associated with the tool, represented as a `serde_json::Value`. ```rust pub fn schema_as_json_value(&self) -> Value ``` -------------------------------- ### Policy Combination: Or Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.Annotations.html Creates a new Policy that returns Action::Follow if either the self or other policy returns Action::Follow. ```APIDOC ## fn or(self, other: P) -> Or ### Description Create a new `Policy` that returns `Action::Follow` if either `self` or `other` return `Action::Follow`. ### Parameters * `other`: P - The other policy to combine with. ### Returns * `Or` - A new policy representing the logical OR of the two input policies. ``` -------------------------------- ### Get TypeId for any Type Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.CustomResult.html Retrieves the TypeId of a given type, useful for runtime type identification. ```rust fn type_id(&self) -> TypeId; ``` -------------------------------- ### ServerCapabilitiesBuilder::enable_logging_with Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.ServerCapabilitiesBuilder.html Enables logging capabilities with a specific configuration. ```APIDOC ## ServerCapabilitiesBuilder::enable_logging_with ### Description Enables logging features and configures them with the provided `JsonObject` for logging settings. This method returns a new builder instance. ### Method `enable_logging_with(logging: JsonObject)` ### Parameters - **logging** (`JsonObject`): The configuration for logging capabilities. ### Returns - `ServerCapabilitiesBuilder`: A new builder instance with the specified logging capabilities. ``` -------------------------------- ### Get CustomResult JSON Schema Name Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.CustomResult.html Returns the name of the generated JSON Schema for CustomResult. ```rust fn schema_name() -> Cow<'static, str>; ``` -------------------------------- ### Get Meta Field from CompleteRequestParams Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.CompleteRequestParams.html Retrieves an immutable reference to the meta field of a CompleteRequestParams instance. ```rust fn meta(&self) -> Option<&Meta> ``` -------------------------------- ### Implementing PolicyExt::or Source: https://docs.rs/rmcp/1.5.0/rmcp/service/enum.ServiceError.html Creates a new `Policy` that returns `Action::Follow` if either `self` or `other` policies return `Action::Follow`. Requires `T: Policy` and `P: Policy`. ```rust fn or(self, other: P) -> Or where T: Policy, P: Policy, Create a new `Policy` that returns `Action::Follow` if either `self` or `other` returns `Action::Follow`. Read more Source ``` -------------------------------- ### Get JSON Schema ID Source: https://docs.rs/rmcp/1.5.0/rmcp/model/enum.RawContent.html Returns a unique identifier for the JSON Schema generated for RawContent. ```rust fn schema_id() -> Cow<'static, str> ``` -------------------------------- ### Type Id Method Source: https://docs.rs/rmcp/1.5.0/rmcp/handler/server/router/tool/struct.WithToolAttr.html Gets the TypeId of the current instance. This is a standard method provided by the Any trait. ```rust fn type_id(&self) -> TypeId ``` -------------------------------- ### Create CompletionContext with Arguments Source: https://docs.rs/rmcp/1.5.0/rmcp/model/struct.CompletionContext.html Creates a completion context initialized with a provided HashMap of arguments. Useful for providing initial context. ```rust pub fn with_arguments(arguments: HashMap) -> Self ```