[Bug]: MCP App tools/call fails with SchemaError when an argument is undefined, so the call never reaches the server#33763

opened1d agobySsooheon

Note

🤖 Claude Fable 5.2 responding on behalf of sooheon

Area

packages/contracts or packages/shared (and packages/client-runtime/src/mcpApps/host.ts)

Steps to reproduce

  1. Install Atlas 0.1.1 and connect its Claude Code plugin.

  2. In a T3 Claude thread, have the agent call the plugin's show_screen tool. Its MCP App (ui://atlas/screen.html) renders as a card.

  3. The card polls its server with tools/call. Its first poll passes an argument whose value is undefined:

    js
    1since: model.frame ? model.frame.id : undefined,

Any MCP App that puts an undefined property in tools/call arguments will do the same.

Expected behavior

The call reaches the MCP server with the undefined key left out, as it would be on any JSON transport (JSON.stringify drops it). The MCP Apps messages are JSON-RPC carried by postMessage, whose structured clone keeps undefined properties, so a host has to drop them itself.

Actual behavior

Every tools/call from the card fails in the web client before it is sent. The server never sees it: the trace has ws.rpc.mcpApps.toolInfo spans but no ws.rpc.mcpApps.callTool span at all. The card shows its generic failure text ("Atlas isn't answering") and never gets a frame. Because the app only sets since once it has a first frame, it cannot recover.

host.ts passes the arguments through unchanged (options.callTool({ name, arguments: args as Record<string, unknown> }), around line 250 at e4d86abc), and the RPC payload encoding then rejects the undefined value.

Impact

The MCP App is unusable in T3 while the same app works in Claude Code and the Claude app. The failure is silent on the T3 side: nothing in the thread says the host rejected the call, so it looks like the MCP server is down.

Version or commit

0.1.8 (desktop, stable channel). Line reference is at main e4d86abc.

Environment

macOS 27.2 (arm64), desktop app with local server, Claude Code 2.1.322, Atlas 0.1.1

Logs or stack traces

From server.trace.ndjson, 16 of 16 client mcpApps.callTool spans in one thread, each 0.1–0.5 ms:

1SchemaError: Expected JSON value
2 at ["arguments"]["since"]
3 at mcpApps.callTool
4 at EnvironmentRpc.request (t3code://app/assets/utils-CE33Pid-.js:31:34948)
5 at EnvironmentRegistry.run (t3code://app/assets/utils-CE33Pid-.js:31:40183)

Suggested fix

In the tools/call case of packages/client-runtime/src/mcpApps/host.ts, normalise params.arguments to plain JSON before callTool (drop undefined properties, for example with a JSON round trip), and answer the frame with -32602 when a value cannot be represented. I have not tested a patch.

Workaround

None in T3. The app's author can omit the key; reported there too.