|
| 1 | +use rust_mcp_sdk::macros::JsonSchema; |
1 | 2 | use rust_mcp_sdk::schema::{schema_utils::CallToolError, CallToolResult, TextContent}; |
2 | 3 | use rust_mcp_sdk::{macros::mcp_tool, tool_box}; |
| 4 | +// use rust_mcp_sdk::schema::RpcError; |
| 5 | +// use std::str::FromStr; |
3 | 6 |
|
4 | | -use rust_mcp_sdk::macros::JsonSchema; |
5 | | -use rust_mcp_sdk::schema::RpcError; |
6 | | -use std::str::FromStr; |
7 | | - |
8 | | -// Simple enum with FromStr trait implemented |
9 | | -#[derive(JsonSchema, Debug)] |
10 | | -pub enum Colors { |
11 | | - #[json_schema(title = "Green Color")] |
12 | | - Green, |
13 | | - #[json_schema(title = "Red Color")] |
14 | | - Red, |
15 | | -} |
16 | | -impl FromStr for Colors { |
17 | | - type Err = RpcError; |
| 7 | +// // Simple enum with FromStr trait implemented |
| 8 | +// #[derive(JsonSchema, Debug)] |
| 9 | +// pub enum Colors { |
| 10 | +// #[json_schema(title = "Green Color")] |
| 11 | +// Green, |
| 12 | +// #[json_schema(title = "Red Color")] |
| 13 | +// Red, |
| 14 | +// } |
| 15 | +// impl FromStr for Colors { |
| 16 | +// type Err = RpcError; |
18 | 17 |
|
19 | | - fn from_str(s: &str) -> Result<Self, Self::Err> { |
20 | | - match s.to_lowercase().as_str() { |
21 | | - "green" => Ok(Colors::Green), |
22 | | - "red" => Ok(Colors::Red), |
23 | | - _ => Err(RpcError::parse_error().with_message("Invalid color".to_string())), |
24 | | - } |
25 | | - } |
26 | | -} |
| 18 | +// fn from_str(s: &str) -> Result<Self, Self::Err> { |
| 19 | +// match s.to_lowercase().as_str() { |
| 20 | +// "green" => Ok(Colors::Green), |
| 21 | +// "red" => Ok(Colors::Red), |
| 22 | +// _ => Err(RpcError::parse_error().with_message("Invalid color".to_string())), |
| 23 | +// } |
| 24 | +// } |
| 25 | +// } |
27 | 26 |
|
28 | 27 | //****************// |
29 | 28 | // SayHelloTool // |
|
0 commit comments