alexhancock/mcp-crate-cleanup (#4885)

This commit is contained in:
Alex Hancock
2025-09-29 17:00:17 -04:00
committed by GitHub
parent 2bd18a757b
commit cb0eca9966
78 changed files with 1039 additions and 1090 deletions
@@ -1,7 +1,7 @@
//! MockClient is a mock implementation of the McpClientTrait for testing purposes.
//! add a tool you want to have around and then add the client to the extension router
use mcp_client::client::{Error, McpClientTrait};
use goose::agents::mcp_client::{Error, McpClientTrait};
use rmcp::{
model::{
CallToolResult, Content, ErrorData, GetPromptResult, ListPromptsResult,
@@ -91,11 +91,11 @@ impl McpClientTrait for MockClient {
async fn call_tool(
&self,
name: &str,
arguments: Value,
arguments: Option<serde_json::Map<String, Value>>,
_cancel_token: CancellationToken,
) -> Result<CallToolResult, Error> {
if let Some(handler) = self.handlers.get(name) {
match handler(&arguments) {
match handler(&Value::Object(arguments.unwrap_or_default())) {
Ok(content) => Ok(CallToolResult {
content,
is_error: None,