(&self, args: &serde_json::Value, _ctx: &ToolContext)
| 59 | } |
| 60 | |
| 61 | async fn execute(&self, args: &serde_json::Value, _ctx: &ToolContext) -> Result<ToolOutput> { |
| 62 | // Call the MCP tool through the manager |
| 63 | let result = self |
| 64 | .manager |
| 65 | .call_tool(&self.full_name, Some(args.clone())) |
| 66 | .await; |
| 67 | |
| 68 | match result { |
| 69 | Ok(tool_result) => { |
| 70 | let output = tool_result_to_string(&tool_result); |
| 71 | if tool_result.is_error { |
| 72 | Ok(ToolOutput::error(output)) |
| 73 | } else { |
| 74 | Ok(ToolOutput::success(output)) |
| 75 | } |
| 76 | } |
| 77 | Err(e) => Ok(ToolOutput::error(format!("MCP tool error: {}", e))), |
| 78 | } |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | /// Create tool wrappers for all tools from an MCP server |
nothing calls this directly
no test coverage detected