Update to rmcp 1.1.0 (#7619)

Co-authored-by: Alex Hancock <alexhancock@block.xyz>
This commit is contained in:
Jack Amadeo
2026-03-05 21:40:52 -05:00
committed by GitHub
parent abadb87892
commit 325bf396af
61 changed files with 729 additions and 1757 deletions
+8 -15
View File
@@ -4,8 +4,8 @@ use indoc::formatdoc;
use rmcp::{
handler::server::{router::tool::ToolRouter, wrapper::Parameters},
model::{
CallToolResult, Content, ErrorCode, ErrorData, Implementation, ResourceContents, Role,
ServerCapabilities, ServerInfo,
CallToolResult, Content, ErrorCode, ErrorData, Implementation, InitializeResult,
ResourceContents, Role, ServerCapabilities, ServerInfo,
},
tool, tool_handler, tool_router, ServerHandler,
};
@@ -412,19 +412,12 @@ impl Default for AutoVisualiserRouter {
#[tool_handler(router = self.tool_router)]
impl ServerHandler for AutoVisualiserRouter {
fn get_info(&self) -> ServerInfo {
ServerInfo {
server_info: Implementation {
name: "goose-autovisualiser".to_string(),
version: env!("CARGO_PKG_VERSION").to_owned(),
title: None,
description: None,
icons: None,
website_url: None,
},
capabilities: ServerCapabilities::builder().enable_tools().build(),
instructions: Some(self.instructions.clone()),
..Default::default()
}
InitializeResult::new(ServerCapabilities::builder().enable_tools().build())
.with_server_info(Implementation::new(
"goose-autovisualiser",
env!("CARGO_PKG_VERSION"),
))
.with_instructions(self.instructions.clone())
}
}
+12 -18
View File
@@ -8,8 +8,9 @@ use rmcp::{
handler::server::{router::tool::ToolRouter, wrapper::Parameters},
model::{
AnnotateAble, CallToolResult, Content, ErrorCode, ErrorData, Implementation,
ListResourcesResult, PaginatedRequestParams, RawResource, ReadResourceRequestParams,
ReadResourceResult, Resource, ResourceContents, ServerCapabilities, ServerInfo,
InitializeResult, ListResourcesResult, PaginatedRequestParams, RawResource,
ReadResourceRequestParams, ReadResourceResult, Resource, ResourceContents,
ServerCapabilities, ServerInfo,
},
schemars::JsonSchema,
service::RequestContext,
@@ -1584,22 +1585,17 @@ impl ComputerControllerServer {
#[tool_handler(router = self.tool_router)]
impl ServerHandler for ComputerControllerServer {
fn get_info(&self) -> ServerInfo {
ServerInfo {
server_info: Implementation {
name: "goose-computercontroller".to_string(),
version: env!("CARGO_PKG_VERSION").to_owned(),
title: None,
description: None,
icons: None,
website_url: None,
},
capabilities: ServerCapabilities::builder()
InitializeResult::new(
ServerCapabilities::builder()
.enable_tools()
.enable_resources()
.build(),
instructions: Some(self.instructions.clone()),
..Default::default()
}
)
.with_server_info(Implementation::new(
"goose-computercontroller",
env!("CARGO_PKG_VERSION"),
))
.with_instructions(self.instructions.clone())
}
async fn list_resources(
@@ -1640,8 +1636,6 @@ impl ServerHandler for ComputerControllerServer {
})?;
// Clone the resource to return
Ok(ReadResourceResult {
contents: vec![resource.clone()],
})
Ok(ReadResourceResult::new(vec![resource.clone()]))
}
}
+8 -15
View File
@@ -3,8 +3,8 @@ use indoc::formatdoc;
use rmcp::{
handler::server::{router::tool::ToolRouter, wrapper::Parameters},
model::{
CallToolResult, Content, ErrorCode, ErrorData, Implementation, Meta, ServerCapabilities,
ServerInfo,
CallToolResult, Content, ErrorCode, ErrorData, Implementation, InitializeResult, Meta,
ServerCapabilities, ServerInfo,
},
schemars::JsonSchema,
service::RequestContext,
@@ -544,19 +544,12 @@ impl MemoryServer {
#[tool_handler(router = self.tool_router)]
impl ServerHandler for MemoryServer {
fn get_info(&self) -> ServerInfo {
ServerInfo {
server_info: Implementation {
name: "goose-memory".to_string(),
version: env!("CARGO_PKG_VERSION").to_owned(),
title: None,
description: None,
icons: None,
website_url: None,
},
capabilities: ServerCapabilities::builder().enable_tools().build(),
instructions: Some(self.instructions.clone()),
..Default::default()
}
InitializeResult::new(ServerCapabilities::builder().enable_tools().build())
.with_server_info(Implementation::new(
"goose-memory",
env!("CARGO_PKG_VERSION"),
))
.with_instructions(self.instructions.clone())
}
}
+8 -15
View File
@@ -3,8 +3,8 @@ use indoc::formatdoc;
use rmcp::{
handler::server::{router::tool::ToolRouter, wrapper::Parameters},
model::{
CallToolResult, Content, ErrorCode, ErrorData, Implementation, Role, ServerCapabilities,
ServerInfo,
CallToolResult, Content, ErrorCode, ErrorData, Implementation, InitializeResult, Role,
ServerCapabilities, ServerInfo,
},
schemars::JsonSchema,
tool, tool_handler, tool_router, ServerHandler,
@@ -109,19 +109,12 @@ impl TutorialServer {
#[tool_handler(router = self.tool_router)]
impl ServerHandler for TutorialServer {
fn get_info(&self) -> ServerInfo {
ServerInfo {
server_info: Implementation {
name: "goose-tutorial".to_string(),
version: env!("CARGO_PKG_VERSION").to_owned(),
title: None,
description: None,
icons: None,
website_url: None,
},
capabilities: ServerCapabilities::builder().enable_tools().build(),
instructions: Some(self.instructions.clone()),
..Default::default()
}
InitializeResult::new(ServerCapabilities::builder().enable_tools().build())
.with_server_info(Implementation::new(
"goose-tutorial",
env!("CARGO_PKG_VERSION"),
))
.with_instructions(self.instructions.clone())
}
}