Skip to content

Commit d519a79

Browse files
committed
fix(gateway): forward structuredContent in proxied tool results
Tools with output schemas (e.g. Google Workspace MCP) return structuredContent alongside text content. The gateway was dropping this field when proxying CallToolResult, causing clients to reject otherwise successful tool calls. Signed-off-by: crimsonsunset <jsangio1@gmail.com>
1 parent 5269a18 commit d519a79

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

crates/mcpmux-gateway/src/mcp/handler.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -852,11 +852,12 @@ impl ServerHandler for McpMuxGatewayHandler {
852852
"call_tool result"
853853
);
854854

855-
let result = if tool_result.is_error {
855+
let mut result = if tool_result.is_error {
856856
CallToolResult::error(content)
857857
} else {
858858
CallToolResult::success(content)
859859
};
860+
result.structured_content = tool_result.structured_content;
860861

861862
Ok(result)
862863
}

crates/mcpmux-gateway/src/pool/routing.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ pub struct RoutedResource {
5151
#[derive(Debug)]
5252
pub struct ToolCallResult {
5353
pub content: Vec<Value>,
54+
pub structured_content: Option<Value>,
5455
pub is_error: bool,
5556
}
5657

@@ -304,6 +305,7 @@ impl RoutingService {
304305

305306
Ok(ToolCallResult {
306307
content,
308+
structured_content: res.structured_content,
307309
is_error: res.is_error.unwrap_or(false),
308310
})
309311
}

0 commit comments

Comments
 (0)