Skip to content

Commit f5a97a3

Browse files
authored
feat: add associated methods to structs for static values (#56)
1 parent 870a859 commit f5a97a3

File tree

2 files changed

+187
-4
lines changed

2 files changed

+187
-4
lines changed

src/generated_schema/2024_11_05/mcp_schema.rs

Lines changed: 92 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/// ----------------------------------------------------------------------------
2-
/// This file is auto-generated by mcp-schema-gen v0.1.11.
2+
/// This file is auto-generated by mcp-schema-gen v0.1.15.
33
/// WARNING:
44
/// It is not recommended to modify this file directly. You are free to
55
/// modify or extend the implementations as needed, but please do so at your own risk.
66
///
77
/// Generated from : <https://github.com/modelcontextprotocol/specification.git>
88
/// Hash : eb4abdf2bb91e0d5afd94510741eadd416982350
9-
/// Generated at : 2025-03-20 17:51:47
9+
/// Generated at : 2025-03-22 09:38:48
1010
/// ----------------------------------------------------------------------------
1111
///
1212
/// MCP Protocol Version
@@ -184,6 +184,9 @@ impl CallToolRequest {
184184
pub fn method(&self) -> &::std::string::String {
185185
&self.method
186186
}
187+
pub fn method_name() -> ::std::string::String {
188+
"tools/call".to_string()
189+
}
187190
}
188191
///CallToolRequestParams
189192
///
@@ -369,6 +372,9 @@ impl CancelledNotification {
369372
pub fn method(&self) -> &::std::string::String {
370373
&self.method
371374
}
375+
pub fn method_name() -> ::std::string::String {
376+
"notifications/cancelled".to_string()
377+
}
372378
}
373379
///CancelledNotificationParams
374380
///
@@ -773,6 +779,9 @@ impl CompleteRequest {
773779
pub fn method(&self) -> &::std::string::String {
774780
&self.method
775781
}
782+
pub fn method_name() -> ::std::string::String {
783+
"completion/complete".to_string()
784+
}
776785
}
777786
///CompleteRequestParams
778787
///
@@ -1067,6 +1076,9 @@ impl CreateMessageRequest {
10671076
pub fn method(&self) -> &::std::string::String {
10681077
&self.method
10691078
}
1079+
pub fn method_name() -> ::std::string::String {
1080+
"sampling/createMessage".to_string()
1081+
}
10701082
}
10711083
///CreateMessageRequestParams
10721084
///
@@ -1360,6 +1372,9 @@ impl EmbeddedResource {
13601372
pub fn type_(&self) -> &::std::string::String {
13611373
&self.type_
13621374
}
1375+
pub fn type_name() -> ::std::string::String {
1376+
"resource".to_string()
1377+
}
13631378
}
13641379
///EmbeddedResourceAnnotations
13651380
///
@@ -1496,6 +1511,9 @@ impl GetPromptRequest {
14961511
pub fn method(&self) -> &::std::string::String {
14971512
&self.method
14981513
}
1514+
pub fn method_name() -> ::std::string::String {
1515+
"prompts/get".to_string()
1516+
}
14991517
}
15001518
///GetPromptRequestParams
15011519
///
@@ -1649,6 +1667,9 @@ impl ImageContent {
16491667
pub fn type_(&self) -> &::std::string::String {
16501668
&self.type_
16511669
}
1670+
pub fn type_name() -> ::std::string::String {
1671+
"image".to_string()
1672+
}
16521673
}
16531674
///ImageContentAnnotations
16541675
///
@@ -1768,6 +1789,9 @@ impl InitializeRequest {
17681789
pub fn method(&self) -> &::std::string::String {
17691790
&self.method
17701791
}
1792+
pub fn method_name() -> ::std::string::String {
1793+
"initialize".to_string()
1794+
}
17711795
}
17721796
///InitializeRequestParams
17731797
///
@@ -1905,6 +1929,9 @@ impl InitializedNotification {
19051929
pub fn method(&self) -> &::std::string::String {
19061930
&self.method
19071931
}
1932+
pub fn method_name() -> ::std::string::String {
1933+
"notifications/initialized".to_string()
1934+
}
19081935
}
19091936
///InitializedNotificationParams
19101937
///
@@ -2369,6 +2396,9 @@ impl ListPromptsRequest {
23692396
pub fn method(&self) -> &::std::string::String {
23702397
&self.method
23712398
}
2399+
pub fn method_name() -> ::std::string::String {
2400+
"prompts/list".to_string()
2401+
}
23722402
}
23732403
///ListPromptsRequestParams
23742404
///
@@ -2480,6 +2510,9 @@ impl ListResourceTemplatesRequest {
24802510
pub fn method(&self) -> &::std::string::String {
24812511
&self.method
24822512
}
2513+
pub fn method_name() -> ::std::string::String {
2514+
"resources/templates/list".to_string()
2515+
}
24832516
}
24842517
///ListResourceTemplatesRequestParams
24852518
///
@@ -2592,6 +2625,9 @@ impl ListResourcesRequest {
25922625
pub fn method(&self) -> &::std::string::String {
25932626
&self.method
25942627
}
2628+
pub fn method_name() -> ::std::string::String {
2629+
"resources/list".to_string()
2630+
}
25952631
}
25962632
///ListResourcesRequestParams
25972633
///
@@ -2714,6 +2750,9 @@ impl ListRootsRequest {
27142750
pub fn method(&self) -> &::std::string::String {
27152751
&self.method
27162752
}
2753+
pub fn method_name() -> ::std::string::String {
2754+
"roots/list".to_string()
2755+
}
27172756
}
27182757
///ListRootsRequestParams
27192758
///
@@ -2847,6 +2886,9 @@ impl ListToolsRequest {
28472886
pub fn method(&self) -> &::std::string::String {
28482887
&self.method
28492888
}
2889+
pub fn method_name() -> ::std::string::String {
2890+
"tools/list".to_string()
2891+
}
28502892
}
28512893
///ListToolsRequestParams
28522894
///
@@ -3025,6 +3067,9 @@ impl LoggingMessageNotification {
30253067
pub fn method(&self) -> &::std::string::String {
30263068
&self.method
30273069
}
3070+
pub fn method_name() -> ::std::string::String {
3071+
"notifications/message".to_string()
3072+
}
30283073
}
30293074
///LoggingMessageNotificationParams
30303075
///
@@ -3359,6 +3404,9 @@ impl PingRequest {
33593404
pub fn method(&self) -> &::std::string::String {
33603405
&self.method
33613406
}
3407+
pub fn method_name() -> ::std::string::String {
3408+
"ping".to_string()
3409+
}
33623410
}
33633411
///PingRequestParams
33643412
///
@@ -3468,6 +3516,9 @@ impl ProgressNotification {
34683516
pub fn method(&self) -> &::std::string::String {
34693517
&self.method
34703518
}
3519+
pub fn method_name() -> ::std::string::String {
3520+
"notifications/progress".to_string()
3521+
}
34713522
}
34723523
///ProgressNotificationParams
34733524
///
@@ -3659,6 +3710,9 @@ impl PromptListChangedNotification {
36593710
pub fn method(&self) -> &::std::string::String {
36603711
&self.method
36613712
}
3713+
pub fn method_name() -> ::std::string::String {
3714+
"notifications/prompts/list_changed".to_string()
3715+
}
36623716
}
36633717
///PromptListChangedNotificationParams
36643718
///
@@ -3810,6 +3864,9 @@ impl PromptReference {
38103864
pub fn type_(&self) -> &::std::string::String {
38113865
&self.type_
38123866
}
3867+
pub fn type_name() -> ::std::string::String {
3868+
"ref/prompt".to_string()
3869+
}
38133870
}
38143871
///Sent from the client to the server, to read a specific resource URI.
38153872
///
@@ -3860,6 +3917,9 @@ impl ReadResourceRequest {
38603917
pub fn method(&self) -> &::std::string::String {
38613918
&self.method
38623919
}
3920+
pub fn method_name() -> ::std::string::String {
3921+
"resources/read".to_string()
3922+
}
38633923
}
38643924
///ReadResourceRequestParams
38653925
///
@@ -4266,6 +4326,9 @@ impl ResourceListChangedNotification {
42664326
pub fn method(&self) -> &::std::string::String {
42674327
&self.method
42684328
}
4329+
pub fn method_name() -> ::std::string::String {
4330+
"notifications/resources/list_changed".to_string()
4331+
}
42694332
}
42704333
///ResourceListChangedNotificationParams
42714334
///
@@ -4336,6 +4399,9 @@ impl ResourceReference {
43364399
pub fn type_(&self) -> &::std::string::String {
43374400
&self.type_
43384401
}
4402+
pub fn type_name() -> ::std::string::String {
4403+
"ref/resource".to_string()
4404+
}
43394405
}
43404406
///A template description for resources available on the server.
43414407
///
@@ -4490,6 +4556,9 @@ impl ResourceUpdatedNotification {
44904556
pub fn method(&self) -> &::std::string::String {
44914557
&self.method
44924558
}
4559+
pub fn method_name() -> ::std::string::String {
4560+
"notifications/resources/updated".to_string()
4561+
}
44934562
}
44944563
///ResourceUpdatedNotificationParams
44954564
///
@@ -4658,6 +4727,9 @@ impl RootsListChangedNotification {
46584727
pub fn method(&self) -> &::std::string::String {
46594728
&self.method
46604729
}
4730+
pub fn method_name() -> ::std::string::String {
4731+
"notifications/roots/list_changed".to_string()
4732+
}
46614733
}
46624734
///RootsListChangedNotificationParams
46634735
///
@@ -5179,6 +5251,9 @@ impl SetLevelRequest {
51795251
pub fn method(&self) -> &::std::string::String {
51805252
&self.method
51815253
}
5254+
pub fn method_name() -> ::std::string::String {
5255+
"logging/setLevel".to_string()
5256+
}
51825257
}
51835258
///SetLevelRequestParams
51845259
///
@@ -5253,6 +5328,9 @@ impl SubscribeRequest {
52535328
pub fn method(&self) -> &::std::string::String {
52545329
&self.method
52555330
}
5331+
pub fn method_name() -> ::std::string::String {
5332+
"resources/subscribe".to_string()
5333+
}
52565334
}
52575335
///SubscribeRequestParams
52585336
///
@@ -5342,6 +5420,9 @@ impl TextContent {
53425420
pub fn type_(&self) -> &::std::string::String {
53435421
&self.type_
53445422
}
5423+
pub fn type_name() -> ::std::string::String {
5424+
"text".to_string()
5425+
}
53455426
}
53465427
///TextContentAnnotations
53475428
///
@@ -5540,6 +5621,9 @@ impl ToolInputSchema {
55405621
pub fn type_(&self) -> &::std::string::String {
55415622
&self.type_
55425623
}
5624+
pub fn type_name() -> ::std::string::String {
5625+
"object".to_string()
5626+
}
55435627
}
55445628
///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.
55455629
///
@@ -5588,6 +5672,9 @@ impl ToolListChangedNotification {
55885672
pub fn method(&self) -> &::std::string::String {
55895673
&self.method
55905674
}
5675+
pub fn method_name() -> ::std::string::String {
5676+
"notifications/tools/list_changed".to_string()
5677+
}
55915678
}
55925679
///ToolListChangedNotificationParams
55935680
///
@@ -5664,6 +5751,9 @@ impl UnsubscribeRequest {
56645751
pub fn method(&self) -> &::std::string::String {
56655752
&self.method
56665753
}
5754+
pub fn method_name() -> ::std::string::String {
5755+
"resources/unsubscribe".to_string()
5756+
}
56675757
}
56685758
///UnsubscribeRequestParams
56695759
///

0 commit comments

Comments
 (0)