fix(rmcp): return serialized json with structured content (#368)

This commit is contained in:
Allan 2025-08-12 20:06:12 +12:00 • committed by GitHub
commit 3d8e950a52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1229,7 +1229,7 @@ impl CallToolResult {
/// ```
pub fn structured(value: Value) -> Self {
CallToolResult {
content: None,
content: Some(vec![Content::text(value.to_string())]),
structured_content: Some(value),
is_error: Some(false),
}
@ -1254,7 +1254,7 @@ impl CallToolResult {
/// ```
pub fn structured_error(value: Value) -> Self {
CallToolResult {
content: None,
content: Some(vec![Content::text(value.to_string())]),
structured_content: Some(value),
is_error: Some(true),
}