|
24 | 24 | //! |
25 | 25 | //! fn get_server_info(&self) -> ServerInfo { |
26 | 26 | //! ServerInfo { |
27 | | -//! protocol_version: ProtocolVersion::default(), |
28 | | -//! capabilities: ServerCapabilities::default(), |
29 | | -//! server_info: Implementation { |
30 | | -//! name: "My Server".to_string(), |
31 | | -//! version: "1.0.0".to_string(), |
32 | | -//! }, |
| 27 | +//! protocol_version: ProtocolVersion::default(), // MCP 2025-11-25 |
| 28 | +//! capabilities: ServerCapabilities::builder() |
| 29 | +//! .enable_tools() |
| 30 | +//! .build(), |
| 31 | +//! server_info: Implementation::with_description( |
| 32 | +//! "My Server", |
| 33 | +//! "1.0.0", |
| 34 | +//! "Example MCP server", |
| 35 | +//! ), |
33 | 36 | //! instructions: Some("Example server".to_string()), |
34 | 37 | //! } |
35 | 38 | //! } |
|
39 | 42 | //! } |
40 | 43 | //! |
41 | 44 | //! async fn call_tool(&self, _: CallToolRequestParam) -> Result<CallToolResult, Self::Error> { |
42 | | -//! Ok(CallToolResult { content: vec![], is_error: Some(false) }) |
| 45 | +//! Ok(CallToolResult::empty()) |
43 | 46 | //! } |
44 | 47 | //! |
45 | 48 | //! // Implement other required methods (simplified for example) |
46 | 49 | //! # async fn list_resources(&self, _: PaginatedRequestParam) -> Result<ListResourcesResult, Self::Error> { |
47 | | -//! # Ok(ListResourcesResult { resources: vec![], next_cursor: String::new() }) |
| 50 | +//! # Ok(ListResourcesResult { resources: vec![], next_cursor: None }) |
48 | 51 | //! # } |
49 | 52 | //! # async fn read_resource(&self, _: ReadResourceRequestParam) -> Result<ReadResourceResult, Self::Error> { |
50 | 53 | //! # Err("No resources".into()) |
51 | 54 | //! # } |
52 | 55 | //! # async fn list_prompts(&self, _: PaginatedRequestParam) -> Result<ListPromptsResult, Self::Error> { |
53 | | -//! # Ok(ListPromptsResult { prompts: vec![], next_cursor: String::new() }) |
| 56 | +//! # Ok(ListPromptsResult { prompts: vec![], next_cursor: None }) |
54 | 57 | //! # } |
55 | 58 | //! # async fn get_prompt(&self, _: GetPromptRequestParam) -> Result<GetPromptResult, Self::Error> { |
56 | 59 | //! # Err("No prompts".into()) |
|
0 commit comments