The Model Context Protocol (MCP) servers were incorrectly packaging error objects into the structuredContent field of tool responses. This led to client-side schema validation failures because the error object did not match the outputSchema defined for successful tool calls.
Problem: When a tool execution resulted in an error, the server would return a response like {"structuredContent": {"error": "..."}, "isError": true}. The client, expecting structuredContent to conform to the tool's success outputSchema, would then throw a schema validation error.
Fix Implemented in github-workflow server:
The ai/mcp/server/github-workflow/mcp-stdio.mjs file was modified to correctly handle error responses. Now, when a tool returns an error object, the server:
- Sets
isError: true.
- Populates the
content field with a clear, human-readable error message (e.g., "Tool Error: GitHub CLI command failed. Message: ...").
- Omits the
structuredContent field entirely. This aligns with the MCP specification, which states that structuredContent should only be provided when it conforms to the outputSchema.
Action Required:
This fix needs to be propagated to the other two MCP servers to ensure consistent and correct error handling:
ai/mcp/server/knowledge-base/mcp-stdio.mjs
ai/mcp/server/memory-core/mcp-stdio.mjs
Reference Change:
See the changes made in ai/mcp/server/github-workflow/mcp-stdio.mjs for the implementation details.
The Model Context Protocol (MCP) servers were incorrectly packaging error objects into the
structuredContentfield of tool responses. This led to client-side schema validation failures because the error object did not match theoutputSchemadefined for successful tool calls.Problem: When a tool execution resulted in an error, the server would return a response like
{"structuredContent": {"error": "..."}, "isError": true}. The client, expectingstructuredContentto conform to the tool's successoutputSchema, would then throw a schema validation error.Fix Implemented in
github-workflowserver: Theai/mcp/server/github-workflow/mcp-stdio.mjsfile was modified to correctly handle error responses. Now, when a tool returns an error object, the server:isError: true.contentfield with a clear, human-readable error message (e.g.,"Tool Error: GitHub CLI command failed. Message: ...").structuredContentfield entirely. This aligns with the MCP specification, which states thatstructuredContentshould only be provided when it conforms to theoutputSchema.Action Required: This fix needs to be propagated to the other two MCP servers to ensure consistent and correct error handling:
ai/mcp/server/knowledge-base/mcp-stdio.mjsai/mcp/server/memory-core/mcp-stdio.mjsReference Change: See the changes made in
ai/mcp/server/github-workflow/mcp-stdio.mjsfor the implementation details.