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
+15 -13
View File
@@ -1,7 +1,7 @@
use crate::mcp_utils::ToolResult;
use chrono::Utc;
use rmcp::model::{
AnnotateAble, CallToolRequestParam, CallToolResult, Content, ImageContent, JsonObject,
AnnotateAble, CallToolRequestParams, CallToolResult, Content, ImageContent, JsonObject,
PromptMessage, PromptMessageContent, PromptMessageRole, RawContent, RawImageContent,
RawTextContent, ResourceContents, Role, TextContent,
};
@@ -64,7 +64,7 @@ pub struct ToolRequest {
pub id: String,
#[serde(with = "tool_result_serde")]
#[schema(value_type = Object)]
pub tool_call: ToolResult<CallToolRequestParam>,
pub tool_call: ToolResult<CallToolRequestParams>,
#[serde(skip_serializing_if = "Option::is_none")]
#[schema(value_type = Object)]
pub metadata: Option<ProviderMetadata>,
@@ -156,7 +156,7 @@ pub struct FrontendToolRequest {
pub id: String,
#[serde(with = "tool_result_serde")]
#[schema(value_type = Object)]
pub tool_call: ToolResult<CallToolRequestParam>,
pub tool_call: ToolResult<CallToolRequestParams>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ToSchema)]
@@ -316,7 +316,7 @@ impl MessageContent {
pub fn tool_request<S: Into<String>>(
id: S,
tool_call: ToolResult<CallToolRequestParam>,
tool_call: ToolResult<CallToolRequestParams>,
) -> Self {
MessageContent::ToolRequest(ToolRequest {
id: id.into(),
@@ -328,7 +328,7 @@ impl MessageContent {
pub fn tool_request_with_metadata<S: Into<String>>(
id: S,
tool_call: ToolResult<CallToolRequestParam>,
tool_call: ToolResult<CallToolRequestParams>,
metadata: Option<&ProviderMetadata>,
) -> Self {
MessageContent::ToolRequest(ToolRequest {
@@ -414,7 +414,7 @@ impl MessageContent {
pub fn frontend_tool_request<S: Into<String>>(
id: S,
tool_call: ToolResult<CallToolRequestParam>,
tool_call: ToolResult<CallToolRequestParams>,
) -> Self {
MessageContent::FrontendToolRequest(FrontendToolRequest {
id: id.into(),
@@ -748,7 +748,7 @@ impl Message {
pub fn with_tool_request<S: Into<String>>(
self,
id: S,
tool_call: ToolResult<CallToolRequestParam>,
tool_call: ToolResult<CallToolRequestParams>,
) -> Self {
self.with_content(MessageContent::tool_request(id, tool_call))
}
@@ -756,7 +756,7 @@ impl Message {
pub fn with_tool_request_with_metadata<S: Into<String>>(
self,
id: S,
tool_call: ToolResult<CallToolRequestParam>,
tool_call: ToolResult<CallToolRequestParams>,
metadata: Option<&ProviderMetadata>,
tool_meta: Option<serde_json::Value>,
) -> Self {
@@ -804,7 +804,7 @@ impl Message {
pub fn with_frontend_tool_request<S: Into<String>>(
self,
id: S,
tool_call: ToolResult<CallToolRequestParam>,
tool_call: ToolResult<CallToolRequestParams>,
) -> Self {
self.with_content(MessageContent::frontend_tool_request(id, tool_call))
}
@@ -964,8 +964,8 @@ mod tests {
use crate::conversation::message::{Message, MessageContent, MessageMetadata};
use crate::conversation::*;
use rmcp::model::{
AnnotateAble, CallToolRequestParam, PromptMessage, PromptMessageContent, PromptMessageRole,
RawEmbeddedResource, RawImageContent, ResourceContents,
AnnotateAble, CallToolRequestParams, PromptMessage, PromptMessageContent,
PromptMessageRole, RawEmbeddedResource, RawImageContent, ResourceContents,
};
use rmcp::model::{ErrorCode, ErrorData};
use rmcp::object;
@@ -991,7 +991,8 @@ mod tests {
.with_text("Hello, I'll help you with that.")
.with_tool_request(
"tool123",
Ok(CallToolRequestParam {
Ok(CallToolRequestParams {
meta: None,
task: None,
name: "test_tool".into(),
arguments: Some(object!({"param": "value"})),
@@ -1250,7 +1251,8 @@ mod tests {
#[test]
fn test_message_with_tool_request() {
let tool_call = Ok(CallToolRequestParam {
let tool_call = Ok(CallToolRequestParams {
meta: None,
task: None,
name: "test_tool".into(),
arguments: Some(object!({})),