arcade-mcp/examples/mcp_servers
Eric Gustin 05682d54fe
Don't return structuredContent when error (#817)
We recently added outputSchema support for our MCP tools (not yet for
worker routes yet). Today, we always return structuredContent. On tool
execution errors we return structuredContent: {"error": "..."} with
isError: True, even when that shape does not match the tool’s declared
outputSchema. Since the MCP spec says clients SHOULD validate
structuredContent against outputSchema, some clients reject these
responses.

Since structuredContent is optional, we’re going to omit it when
isError: true.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes the shape of tool error responses across the MCP server, which
may break clients or tools that previously relied on
`structuredContent["error"]` for failures. Behavior is more
spec-compliant but touches core request/response paths and test
expectations.
> 
> **Overview**
> Prevents MCP tool error responses from violating a tool’s declared
`outputSchema` by **always setting `structuredContent=None` when
`isError=True`** (server execution errors, unknown tools, middleware
exceptions, and `Context.tools.call_raw` JSON-RPC errors).
> 
> Updates requirement-failure error formatting to put the human-friendly
message in `content[0]` and (when present) serialize extra
machine-readable fields (e.g. `authorization_url`, `llm_instructions`)
into an additional `content` item. Examples and integration/unit tests
are updated to read errors from `content[0].text`, and
`arcade-mcp-server` is bumped to `1.19.2`.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
4213bdd4aa44362de85c30f5f31c576243c132d5. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-04-10 15:27:07 -07:00
..
authorization Improve .env discovery (#737) 2026-02-25 23:20:28 -08:00
custom_server_with_prebuilt_tools Fix changed files gha (#662) 2025-10-30 13:45:41 -07:00
echo Add Tool Metadata (#766) 2026-02-17 14:31:45 -08:00
local_filesystem Fix MCP capabilities, examples, tests, and more (#657) 2025-10-30 11:59:00 -07:00
logging Rename example servers (#675) 2025-11-12 10:21:25 -08:00
progress_reporting Fix MCP capabilities, examples, tests, and more (#657) 2025-10-30 11:59:00 -07:00
resources Add full support for MCP Resources (#803) 2026-03-27 15:27:57 -07:00
sampling Fix MCP capabilities, examples, tests, and more (#657) 2025-10-30 11:59:00 -07:00
server_with_evaluations Rename example servers (#675) 2025-11-12 10:21:25 -08:00
simple Improve .env discovery (#737) 2026-02-25 23:20:28 -08:00
telemetry_passback feat: Add TelemetryPassbackMiddleware for serverExecutionTelemetry capability (#797) 2026-03-25 15:57:50 -07:00
tool_chaining Don't return structuredContent when error (#817) 2026-04-10 15:27:07 -07:00
tool_metadata Add Tool Metadata (#766) 2026-02-17 14:31:45 -08:00
tools_with_output_schema fix: TypedDict total=False output breaks validation (#816) 2026-04-09 17:47:57 -07:00
user_elicitation Fix MCP capabilities, examples, tests, and more (#657) 2025-10-30 11:59:00 -07:00