mcp_protocol/
constants.rs1pub const PROTOCOL_VERSION: &str = "2024-11-05";
5
6pub mod methods {
8 pub const INITIALIZE: &str = "initialize";
10 pub const INITIALIZED: &str = "notifications/initialized";
11
12 pub const TOOLS_LIST: &str = "tools/list";
14 pub const TOOLS_CALL: &str = "tools/call";
15
16 pub const TOOLS_LIST_CHANGED: &str = "notifications/tools/list_changed";
18
19 pub const RESOURCES_LIST: &str = "resources/list";
21 pub const RESOURCES_READ: &str = "resources/read";
22 pub const RESOURCES_SUBSCRIBE: &str = "resources/subscribe";
23 pub const RESOURCES_UNSUBSCRIBE: &str = "resources/unsubscribe";
24
25 pub const RESOURCES_TEMPLATES_LIST: &str = "resources/templates/list";
27
28 pub const PROMPTS_LIST: &str = "prompts/list";
30 pub const PROMPTS_GET: &str = "prompts/get";
31
32 pub const PROMPTS_LIST_CHANGED: &str = "notifications/prompts/list_changed";
34
35 pub const COMPLETION_COMPLETE: &str = "completion/complete";
37
38 pub const RESOURCES_UPDATED: &str = "notifications/resources/updated";
40 pub const RESOURCES_LIST_CHANGED: &str = "notifications/resources/list_changed";
41
42 pub const SAMPLING_CREATE_MESSAGE: &str = "sampling/createMessage";
44
45 pub const LOG: &str = "notifications/log";
47}
48
49pub mod error_codes {
51 pub const PARSE_ERROR: i32 = -32700;
53 pub const INVALID_REQUEST: i32 = -32600;
54 pub const METHOD_NOT_FOUND: i32 = -32601;
55 pub const INVALID_PARAMS: i32 = -32602;
56 pub const INTERNAL_ERROR: i32 = -32603;
57
58 pub const RESOURCE_NOT_FOUND: i32 = -32002;
60 pub const SERVER_NOT_INITIALIZED: i32 = -32003;
61 pub const SAMPLING_NOT_ENABLED: i32 = -32004;
62 pub const SAMPLING_NO_CALLBACK: i32 = -32005;
63 pub const SAMPLING_ERROR: i32 = -32006;
64}