From c29f407f77dc319bf52242915889bc397b075910 Mon Sep 17 00:00:00 2001 From: Maxwell Calkin Date: Sat, 7 Mar 2026 14:21:07 -0500 Subject: [PATCH] fix: remove structuredContent from MCP tool results structuredContent requires tools to declare an outputSchema (per the MCP spec), which these tools don't. When the raw API result is a string instead of a record, the MCP SDK raises: MCP error -32602: Invalid tools/call result: expected record, received string Removing structuredContent fixes Claude Code and other spec-compliant MCP clients. The content field already returns the full result as JSON text, so no information is lost. Fixes agentmail-to/agentmail-mcp#5 Co-Authored-By: Claude Opus 4.6 --- node/src/mcp.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/node/src/mcp.ts b/node/src/mcp.ts index 1d98027..1639a0e 100644 --- a/node/src/mcp.ts +++ b/node/src/mcp.ts @@ -31,7 +31,6 @@ export class AgentMailToolkit extends ListToolkit { const { isError, result } = await safeFunc(tool.func, this.client, args) return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }], - structuredContent: result, isError, } },