Skip to content

CLI: generic mcp call exits 0 for isError:true tool results #127

Description

@sapph1re

The generic calle mcp call get_call_run route reports exit code 0 and top-level ok: true for an MCP tool result with isError: true. The dedicated calle call status route reports the same failed lookup with exit code 1 and ok: false.

Reproduced against commit 4a53b01ec92cbe9ccae506bd9ea77935a73f3bf7, CLI 0.5.1/core 0.3.1, Node v22.23.2. The raw nested result.isError is preserved, but shell automation checking exit status or top-level ok can take its success branch incorrectly.

Reproduction, complete before/after results and minimal patch.

The fixture injects an HTTP 200 JSON-RPC response containing result: { isError: true, content: [{ type: 'text', text: 'Fixture status lookup failed' }] }. It exercises both CLI routes against tool success, tool failure and JSON-RPC failure. Only generic MCP + tool failure signals success before the patch. All six cases behave consistently after checking result?.isError === true, setting top-level ok accordingly and returning exit code 1 for a failed tool.

No real API calls, phone calls or credentials were used. The fixture blocks global network access, disables telemetry and browser access, and deletes its synthetic temporary cache. This is an offline command-signaling report, separate from SSE parsing issue #110.

Suggested documentation addition: show how HTTP/JSON-RPC transport success, tool execution success and the call lifecycle state differ, including the exit code for each. A successful status lookup does not necessarily mean a successful telephone call.

Prepared with OpenAI Codex assistance for Roman Vinogradov. The reproduction and patched control cases were executed locally.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions