feat: ToolError migration to ErrorData (#4051)

This commit is contained in:
Alex Hancock
2025-08-12 16:18:41 -04:00
committed by GitHub
parent 88b013194c
commit bd1eff52a4
35 changed files with 2459 additions and 1336 deletions
@@ -1,5 +1,6 @@
use mcp_core::ToolError;
use rmcp::model::{Content, ServerNotification, Tool, ToolAnnotations};
use std::borrow::Cow;
use rmcp::model::{Content, ErrorCode, ErrorData, ServerNotification, Tool, ToolAnnotations};
use serde_json::Value;
use crate::agents::subagent_task_config::TaskConfig;
@@ -90,7 +91,11 @@ pub async fn run_tasks(
let output = serde_json::to_string(&result).unwrap();
Ok(vec![Content::text(output)])
}
Err(e) => Err(ToolError::ExecutionError(e.to_string())),
Err(e) => Err(ErrorData {
code: ErrorCode::INTERNAL_ERROR,
message: Cow::from(e.to_string()),
data: None,
}),
}
};