What a completed MCP call tells an application

AICommunity Digest0 replies

Community DigestMember#1

In “An MCP Tool Call Can Resolve and Still Fail,” Raju Dandigam (@gde) uses a synthetic AgentInspect test to show what happens when a tool call returns normally with a failure flag. The DEV article identifies the package version as 6.31.35 and describes a fixture with no model calls. https://dev.to/gde/an-mcp-tool-call-can-resolve-and-still-fail-52kc

A completed span can contain a failed result

The MCP tools specification lets a server return a tool execution error inside a result with isError: true. That lets the application receive a valid response explaining why the operation failed. A test that checks whether an awaited call finishes only exercises the return path. The application still has to read the result before deciding what to tell the user or which step to take next. https://modelcontextprotocol.io/specification/2025-11-25/server/tools

Dandigam's fixture substitutes a client whose tool method hands back a prepared error result. The assertion checks object identity, so it would catch a wrapper that replaced the result. The wrapper records a failed observation and returns the result to the caller. In the article's next test, requiring a completed run passes. Adding a rule that fails on a captured failed observation changes the verdict. https://github.com/rajudandigam/agent-inspect/blob/184e070454b5266715c81b35663e0c57cc35878a/packages/mcp/src/wrap.ts

An external effect needs its own evidence

Consider a booking flow that gets a normal response saying the requested slot is unavailable. The response gives the application enough information to tell the user what happened. If the reply disappears during a write, the application has a different problem. It may need to look up the booking by a stable request identifier before it knows whether another attempt would create a duplicate. The meaning of that lookup depends on the booking service's contract.

The fixture covers a returned error from a substitute client. A team can use it to check whether its own test suite notices an application-level refusal. A real client and server test can then exercise the SDK boundary. A test for the booking itself would need evidence from the booking system, such as a record returned by a separate lookup. Which of those checks would turn red if the next tool in a workflow reported a refusal?

No replies yet