From 0ea65dfd1699b410064943d27d55ff7e1af69c08 Mon Sep 17 00:00:00 2001 From: Ali Hashemi Date: Sat, 22 Mar 2025 09:41:21 -0300 Subject: [PATCH] feat: add associated methods to structs for static values --- src/generated_schema/2024_11_05/mcp_schema.rs | 94 +++++++++++++++++- src/generated_schema/draft/mcp_schema.rs | 97 ++++++++++++++++++- 2 files changed, 187 insertions(+), 4 deletions(-) diff --git a/src/generated_schema/2024_11_05/mcp_schema.rs b/src/generated_schema/2024_11_05/mcp_schema.rs index 75c0f2c..769d9e9 100644 --- a/src/generated_schema/2024_11_05/mcp_schema.rs +++ b/src/generated_schema/2024_11_05/mcp_schema.rs @@ -1,12 +1,12 @@ /// ---------------------------------------------------------------------------- -/// This file is auto-generated by mcp-schema-gen v0.1.11. +/// This file is auto-generated by mcp-schema-gen v0.1.15. /// WARNING: /// It is not recommended to modify this file directly. You are free to /// modify or extend the implementations as needed, but please do so at your own risk. /// /// Generated from : /// Hash : eb4abdf2bb91e0d5afd94510741eadd416982350 -/// Generated at : 2025-03-20 17:51:47 +/// Generated at : 2025-03-22 09:38:48 /// ---------------------------------------------------------------------------- /// /// MCP Protocol Version @@ -184,6 +184,9 @@ impl CallToolRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "tools/call".to_string() + } } ///CallToolRequestParams /// @@ -369,6 +372,9 @@ impl CancelledNotification { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "notifications/cancelled".to_string() + } } ///CancelledNotificationParams /// @@ -773,6 +779,9 @@ impl CompleteRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "completion/complete".to_string() + } } ///CompleteRequestParams /// @@ -1067,6 +1076,9 @@ impl CreateMessageRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "sampling/createMessage".to_string() + } } ///CreateMessageRequestParams /// @@ -1360,6 +1372,9 @@ impl EmbeddedResource { pub fn type_(&self) -> &::std::string::String { &self.type_ } + pub fn type_name() -> ::std::string::String { + "resource".to_string() + } } ///EmbeddedResourceAnnotations /// @@ -1496,6 +1511,9 @@ impl GetPromptRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "prompts/get".to_string() + } } ///GetPromptRequestParams /// @@ -1649,6 +1667,9 @@ impl ImageContent { pub fn type_(&self) -> &::std::string::String { &self.type_ } + pub fn type_name() -> ::std::string::String { + "image".to_string() + } } ///ImageContentAnnotations /// @@ -1768,6 +1789,9 @@ impl InitializeRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "initialize".to_string() + } } ///InitializeRequestParams /// @@ -1905,6 +1929,9 @@ impl InitializedNotification { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "notifications/initialized".to_string() + } } ///InitializedNotificationParams /// @@ -2369,6 +2396,9 @@ impl ListPromptsRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "prompts/list".to_string() + } } ///ListPromptsRequestParams /// @@ -2480,6 +2510,9 @@ impl ListResourceTemplatesRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "resources/templates/list".to_string() + } } ///ListResourceTemplatesRequestParams /// @@ -2592,6 +2625,9 @@ impl ListResourcesRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "resources/list".to_string() + } } ///ListResourcesRequestParams /// @@ -2714,6 +2750,9 @@ impl ListRootsRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "roots/list".to_string() + } } ///ListRootsRequestParams /// @@ -2847,6 +2886,9 @@ impl ListToolsRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "tools/list".to_string() + } } ///ListToolsRequestParams /// @@ -3025,6 +3067,9 @@ impl LoggingMessageNotification { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "notifications/message".to_string() + } } ///LoggingMessageNotificationParams /// @@ -3359,6 +3404,9 @@ impl PingRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "ping".to_string() + } } ///PingRequestParams /// @@ -3468,6 +3516,9 @@ impl ProgressNotification { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "notifications/progress".to_string() + } } ///ProgressNotificationParams /// @@ -3659,6 +3710,9 @@ impl PromptListChangedNotification { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "notifications/prompts/list_changed".to_string() + } } ///PromptListChangedNotificationParams /// @@ -3810,6 +3864,9 @@ impl PromptReference { pub fn type_(&self) -> &::std::string::String { &self.type_ } + pub fn type_name() -> ::std::string::String { + "ref/prompt".to_string() + } } ///Sent from the client to the server, to read a specific resource URI. /// @@ -3860,6 +3917,9 @@ impl ReadResourceRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "resources/read".to_string() + } } ///ReadResourceRequestParams /// @@ -4266,6 +4326,9 @@ impl ResourceListChangedNotification { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "notifications/resources/list_changed".to_string() + } } ///ResourceListChangedNotificationParams /// @@ -4336,6 +4399,9 @@ impl ResourceReference { pub fn type_(&self) -> &::std::string::String { &self.type_ } + pub fn type_name() -> ::std::string::String { + "ref/resource".to_string() + } } ///A template description for resources available on the server. /// @@ -4490,6 +4556,9 @@ impl ResourceUpdatedNotification { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "notifications/resources/updated".to_string() + } } ///ResourceUpdatedNotificationParams /// @@ -4658,6 +4727,9 @@ impl RootsListChangedNotification { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "notifications/roots/list_changed".to_string() + } } ///RootsListChangedNotificationParams /// @@ -5179,6 +5251,9 @@ impl SetLevelRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "logging/setLevel".to_string() + } } ///SetLevelRequestParams /// @@ -5253,6 +5328,9 @@ impl SubscribeRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "resources/subscribe".to_string() + } } ///SubscribeRequestParams /// @@ -5342,6 +5420,9 @@ impl TextContent { pub fn type_(&self) -> &::std::string::String { &self.type_ } + pub fn type_name() -> ::std::string::String { + "text".to_string() + } } ///TextContentAnnotations /// @@ -5540,6 +5621,9 @@ impl ToolInputSchema { pub fn type_(&self) -> &::std::string::String { &self.type_ } + pub fn type_name() -> ::std::string::String { + "object".to_string() + } } ///An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client. /// @@ -5588,6 +5672,9 @@ impl ToolListChangedNotification { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "notifications/tools/list_changed".to_string() + } } ///ToolListChangedNotificationParams /// @@ -5664,6 +5751,9 @@ impl UnsubscribeRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "resources/unsubscribe".to_string() + } } ///UnsubscribeRequestParams /// diff --git a/src/generated_schema/draft/mcp_schema.rs b/src/generated_schema/draft/mcp_schema.rs index 7688626..848e954 100644 --- a/src/generated_schema/draft/mcp_schema.rs +++ b/src/generated_schema/draft/mcp_schema.rs @@ -1,12 +1,12 @@ /// ---------------------------------------------------------------------------- -/// This file is auto-generated by mcp-schema-gen v0.1.11. +/// This file is auto-generated by mcp-schema-gen v0.1.15. /// WARNING: /// It is not recommended to modify this file directly. You are free to /// modify or extend the implementations as needed, but please do so at your own risk. /// /// Generated from : /// Hash : eb4abdf2bb91e0d5afd94510741eadd416982350 -/// Generated at : 2025-03-20 17:51:48 +/// Generated at : 2025-03-22 09:38:49 /// ---------------------------------------------------------------------------- /// /// MCP Protocol Version @@ -122,6 +122,9 @@ impl AudioContent { pub fn type_(&self) -> &::std::string::String { &self.type_ } + pub fn type_name() -> ::std::string::String { + "audio".to_string() + } } ///BlobResourceContents /// @@ -214,6 +217,9 @@ impl CallToolRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "tools/call".to_string() + } } ///CallToolRequestParams /// @@ -411,6 +417,9 @@ impl CancelledNotification { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "notifications/cancelled".to_string() + } } ///CancelledNotificationParams /// @@ -806,6 +815,9 @@ impl CompleteRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "completion/complete".to_string() + } } ///CompleteRequestParams /// @@ -1100,6 +1112,9 @@ impl CreateMessageRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "sampling/createMessage".to_string() + } } ///CreateMessageRequestParams /// @@ -1392,6 +1407,9 @@ impl EmbeddedResource { pub fn type_(&self) -> &::std::string::String { &self.type_ } + pub fn type_name() -> ::std::string::String { + "resource".to_string() + } } ///EmbeddedResourceResource /// @@ -1494,6 +1512,9 @@ impl GetPromptRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "prompts/get".to_string() + } } ///GetPromptRequestParams /// @@ -1634,6 +1655,9 @@ impl ImageContent { pub fn type_(&self) -> &::std::string::String { &self.type_ } + pub fn type_name() -> ::std::string::String { + "image".to_string() + } } ///Describes the name and version of an MCP implementation. /// @@ -1719,6 +1743,9 @@ impl InitializeRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "initialize".to_string() + } } ///InitializeRequestParams /// @@ -1856,6 +1883,9 @@ impl InitializedNotification { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "notifications/initialized".to_string() + } } ///InitializedNotificationParams /// @@ -2320,6 +2350,9 @@ impl ListPromptsRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "prompts/list".to_string() + } } ///ListPromptsRequestParams /// @@ -2431,6 +2464,9 @@ impl ListResourceTemplatesRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "resources/templates/list".to_string() + } } ///ListResourceTemplatesRequestParams /// @@ -2543,6 +2579,9 @@ impl ListResourcesRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "resources/list".to_string() + } } ///ListResourcesRequestParams /// @@ -2665,6 +2704,9 @@ impl ListRootsRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "roots/list".to_string() + } } ///ListRootsRequestParams /// @@ -2798,6 +2840,9 @@ impl ListToolsRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "tools/list".to_string() + } } ///ListToolsRequestParams /// @@ -2976,6 +3021,9 @@ impl LoggingMessageNotification { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "notifications/message".to_string() + } } ///LoggingMessageNotificationParams /// @@ -3310,6 +3358,9 @@ impl PingRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "ping".to_string() + } } ///PingRequestParams /// @@ -3423,6 +3474,9 @@ impl ProgressNotification { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "notifications/progress".to_string() + } } ///ProgressNotificationParams /// @@ -3621,6 +3675,9 @@ impl PromptListChangedNotification { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "notifications/prompts/list_changed".to_string() + } } ///PromptListChangedNotificationParams /// @@ -3784,6 +3841,9 @@ impl PromptReference { pub fn type_(&self) -> &::std::string::String { &self.type_ } + pub fn type_name() -> ::std::string::String { + "ref/prompt".to_string() + } } ///Sent from the client to the server, to read a specific resource URI. /// @@ -3834,6 +3894,9 @@ impl ReadResourceRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "resources/read".to_string() + } } ///ReadResourceRequestParams /// @@ -4185,6 +4248,9 @@ impl ResourceListChangedNotification { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "notifications/resources/list_changed".to_string() + } } ///ResourceListChangedNotificationParams /// @@ -4255,6 +4321,9 @@ impl ResourceReference { pub fn type_(&self) -> &::std::string::String { &self.type_ } + pub fn type_name() -> ::std::string::String { + "ref/resource".to_string() + } } ///A template description for resources available on the server. /// @@ -4362,6 +4431,9 @@ impl ResourceUpdatedNotification { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "notifications/resources/updated".to_string() + } } ///ResourceUpdatedNotificationParams /// @@ -4530,6 +4602,9 @@ impl RootsListChangedNotification { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "notifications/roots/list_changed".to_string() + } } ///RootsListChangedNotificationParams /// @@ -5054,6 +5129,9 @@ impl SetLevelRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "logging/setLevel".to_string() + } } ///SetLevelRequestParams /// @@ -5128,6 +5206,9 @@ impl SubscribeRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "resources/subscribe".to_string() + } } ///SubscribeRequestParams /// @@ -5204,6 +5285,9 @@ impl TextContent { pub fn type_(&self) -> &::std::string::String { &self.type_ } + pub fn type_name() -> ::std::string::String { + "text".to_string() + } } ///TextResourceContents /// @@ -5368,6 +5452,9 @@ impl ToolInputSchema { pub fn type_(&self) -> &::std::string::String { &self.type_ } + pub fn type_name() -> ::std::string::String { + "object".to_string() + } } ///An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client. /// @@ -5416,6 +5503,9 @@ impl ToolListChangedNotification { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "notifications/tools/list_changed".to_string() + } } ///ToolListChangedNotificationParams /// @@ -5492,6 +5582,9 @@ impl UnsubscribeRequest { pub fn method(&self) -> &::std::string::String { &self.method } + pub fn method_name() -> ::std::string::String { + "resources/unsubscribe".to_string() + } } ///UnsubscribeRequestParams ///