Return Orbit MCP client errors as tool results

What does this MR do and why?

The Orbit MCP endpoint turned every gRPC error from Orbit into JSON-RPC -32603 "Internal error". When an agent sent a bad command name, it did not see the Orbit error, such as Tool not found: no_such_command. Now a client error comes back as an isError tool result with the Orbit error text. Client errors are the codes INVALID_ARGUMENT, NOT_FOUND, and FAILED_PRECONDITION. Other errors still return the generic error.

References

Screenshots or screen recordings

Before After
{"jsonrpc":"2.0","error":{"code":-32603,"message":"Internal error"},"id":3} after-vm1-call-3

How to set up and validate locally

  1. Run GDK with Orbit and Duo Agent Platform.
  2. Call the MCP endpoint with an unknown command:
    curl -sk "https://gdk.test:3443/api/v4/orbit/mcp" \
      -H "PRIVATE-TOKEN: $TOKEN" -H "Content-Type: application/json" \
      -H "Accept: application/json, text/event-stream" \
      -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"invoke_command","arguments":{"command_name":"no_such_command","parameters":{}}}}'
  3. The response is {"jsonrpc":"2.0","result":{"content":[{"type":"text","text":"Tool not found: no_such_command"}],"isError":true},"id":3}.
  4. A valid query_graph call still returns isError: false. If Orbit is down, the response is still -32603.

Specs: call_tool_spec.rb, grpc_client_spec.rb, and the Orbit MCP request spec ran 274 examples with 0 failures. Before the fix, the new examples failed.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Michael Angelo Rivera

Merge request reports

Loading
Loading