chore: upgrade to rmcp 0.14.0 (#6674)

This commit is contained in:
Alex Hancock
2026-01-23 14:52:43 -05:00
committed by GitHub
parent ca7577ae49
commit 8233f0afac
37 changed files with 305 additions and 209 deletions
+3 -2
View File
@@ -339,7 +339,7 @@ mod tests {
use goose::providers::base::{Provider, ProviderMetadata, ProviderUsage, Usage};
use goose::providers::errors::ProviderError;
use goose::session::session_manager::SessionType;
use rmcp::model::{CallToolRequestParam, Tool};
use rmcp::model::{CallToolRequestParams, Tool};
use rmcp::object;
use std::path::PathBuf;
@@ -360,7 +360,8 @@ mod tests {
_messages: &[Message],
_tools: &[Tool],
) -> Result<(Message, ProviderUsage), ProviderError> {
let tool_call = CallToolRequestParam {
let tool_call = CallToolRequestParams {
meta: None,
task: None,
name: "test_tool".into(),
arguments: Some(object!({"param": "value"})),
+16 -15
View File
@@ -6,7 +6,7 @@ use std::path::PathBuf;
use std::sync::Arc;
use std::{env, fs};
use rmcp::model::{CallToolRequestParam, CallToolResult, Tool};
use rmcp::model::{CallToolRequestParams, CallToolResult, Tool};
use rmcp::object;
use tokio_util::sync::CancellationToken;
@@ -122,18 +122,18 @@ enum TestMode {
#[test_case(
vec!["npx", "-y", "@modelcontextprotocol/server-everything"],
vec![
CallToolRequestParam { task: None, name: "echo".into(), arguments: Some(object!({"message": "Hello, world!" })) },
CallToolRequestParam { task: None, name: "add".into(), arguments: Some(object!({"a": 1, "b": 2 })) },
CallToolRequestParam { task: None, name: "longRunningOperation".into(), arguments: Some(object!({"duration": 1, "steps": 5 })) },
CallToolRequestParam { task: None, name: "structuredContent".into(), arguments: Some(object!({"location": "11238"})) },
CallToolRequestParam { task: None, name: "sampleLLM".into(), arguments: Some(object!({"prompt": "Please provide a quote from The Great Gatsby", "maxTokens": 100 })) }
CallToolRequestParams { meta: None, task: None, name: "echo".into(), arguments: Some(object!({"message": "Hello, world!" })) },
CallToolRequestParams { meta: None, task: None, name: "add".into(), arguments: Some(object!({"a": 1, "b": 2 })) },
CallToolRequestParams { meta: None, task: None, name: "longRunningOperation".into(), arguments: Some(object!({"duration": 1, "steps": 5 })) },
CallToolRequestParams { meta: None, task: None, name: "structuredContent".into(), arguments: Some(object!({"location": "11238"})) },
CallToolRequestParams { meta: None, task: None, name: "sampleLLM".into(), arguments: Some(object!({"prompt": "Please provide a quote from The Great Gatsby", "maxTokens": 100 })) }
],
vec![]
)]
#[test_case(
vec!["github-mcp-server", "stdio"],
vec![
CallToolRequestParam { task: None, name: "get_file_contents".into(), arguments: Some(object!({
CallToolRequestParams { meta: None, task: None, name: "get_file_contents".into(), arguments: Some(object!({
"owner": "block",
"repo": "goose",
"path": "README.md",
@@ -145,7 +145,7 @@ enum TestMode {
#[test_case(
vec!["uvx", "mcp-server-fetch"],
vec![
CallToolRequestParam { task: None, name: "fetch".into(), arguments: Some(object!({
CallToolRequestParams { meta: None, task: None, name: "fetch".into(), arguments: Some(object!({
"url": "https://example.com",
})) }
],
@@ -154,35 +154,35 @@ enum TestMode {
#[test_case(
vec!["cargo", "run", "--quiet", "-p", "goose-server", "--bin", "goosed", "--", "mcp", "developer"],
vec![
CallToolRequestParam { task: None, name: "text_editor".into(), arguments: Some(object!({
CallToolRequestParams { meta: None, task: None, name: "text_editor".into(), arguments: Some(object!({
"command": "view",
"path": "/tmp/goose_test/goose.txt"
}))},
CallToolRequestParam { task: None, name: "text_editor".into(), arguments: Some(object!({
CallToolRequestParams { meta: None, task: None, name: "text_editor".into(), arguments: Some(object!({
"command": "str_replace",
"path": "/tmp/goose_test/goose.txt",
"old_str": "# goose",
"new_str": "# goose (modified by test)"
}))},
// Test shell command to verify file was modified
CallToolRequestParam { task: None, name: "shell".into(), arguments: Some(object!({
CallToolRequestParams { meta: None, task: None, name: "shell".into(), arguments: Some(object!({
"command": "cat /tmp/goose_test/goose.txt"
})) },
// Test text_editor tool to restore original content
CallToolRequestParam { task: None, name: "text_editor".into(), arguments: Some(object!({
CallToolRequestParams { meta: None, task: None, name: "text_editor".into(), arguments: Some(object!({
"command": "str_replace",
"path": "/tmp/goose_test/goose.txt",
"old_str": "# goose (modified by test)",
"new_str": "# goose"
}))},
CallToolRequestParam { task: None, name: "list_windows".into(), arguments: Some(object!({})) },
CallToolRequestParams { meta: None, task: None, name: "list_windows".into(), arguments: Some(object!({})) },
],
vec![]
)]
#[tokio::test]
async fn test_replayed_session(
command: Vec<&str>,
tool_calls: Vec<CallToolRequestParam>,
tool_calls: Vec<CallToolRequestParams>,
required_envs: Vec<&str>,
) {
std::env::set_var("GOOSE_MCP_CLIENT_VERSION", "0.0.0");
@@ -270,7 +270,8 @@ async fn test_replayed_session(
.await?;
let mut results = Vec::new();
for tool_call in tool_calls {
let tool_call = CallToolRequestParam {
let tool_call = CallToolRequestParams {
meta: None,
task: None,
name: format!("test__{}", tool_call.name).into(),
arguments: tool_call.arguments,
+3 -2
View File
@@ -16,7 +16,7 @@ use goose::providers::sagemaker_tgi::SAGEMAKER_TGI_DEFAULT_MODEL;
use goose::providers::snowflake::SNOWFLAKE_DEFAULT_MODEL;
use goose::providers::xai::XAI_DEFAULT_MODEL;
use rmcp::model::{AnnotateAble, Content, RawImageContent};
use rmcp::model::{CallToolRequestParam, Tool};
use rmcp::model::{CallToolRequestParams, Tool};
use rmcp::object;
use std::collections::HashMap;
use std::sync::Arc;
@@ -329,7 +329,8 @@ impl ProviderTester {
let user_message = Message::user().with_text("Take a screenshot please");
let tool_request = Message::assistant().with_tool_request(
"test_id",
Ok(CallToolRequestParam {
Ok(CallToolRequestParams {
meta: None,
task: None,
name: "get_screenshot".into(),
arguments: Some(object!({})),
@@ -1,5 +1,5 @@
use goose::tool_monitor::RepetitionInspector;
use rmcp::model::CallToolRequestParam;
use rmcp::model::CallToolRequestParams;
use rmcp::object;
// This test targets RepetitionInspector::check_tool_call
@@ -13,7 +13,8 @@ fn test_repetition_inspector_denies_after_exceeding_and_resets_on_param_change()
let mut inspector = RepetitionInspector::new(Some(2));
// First identical call → allowed
let call_v1 = CallToolRequestParam {
let call_v1 = CallToolRequestParams {
meta: None,
task: None,
name: "fetch_user".into(),
arguments: Some(object!({"id": 123})),
@@ -27,7 +28,8 @@ fn test_repetition_inspector_denies_after_exceeding_and_resets_on_param_change()
assert!(!inspector.check_tool_call(call_v1.clone()));
// Change parameters; this should reset the consecutive counter
let call_v2 = CallToolRequestParam {
let call_v2 = CallToolRequestParams {
meta: None,
task: None,
name: "fetch_user".into(),
arguments: Some(object!({"id": 456})),