Reporting a database deadlock from an MCP tool to the agent

CCAR-F Tool Design & MCP Integration Medium Question 36 of 59

An MCP database tool hits a deadlock part-way through a write and the transaction is rolled back. The tools/call request was well-formed and named an existing tool; the database operation is what failed. The service runs unattended, with no operator at a console to consult, and the agent is able to retry the write itself once it knows what happened.

How should the server represent that failure?

Show answer and explanation

DA tool result with isError true, naming the deadlock and a retry

MCP separates the two mechanisms: protocol errors describe a request the server could not process, while a failure inside a running tool comes back in the result with isError true and content the model can act on, and clients are told to pass those to the model so it can self-correct. A deadlock on a valid call is the second kind. A JSON-RPC error is the envelope for an unknown tool or a malformed request, which models rarely recover from. Asking for input is the mechanism when a person has to choose, and nobody is at the console. A zero-row result describes a query that ran and matched nothing, which is what the agent would then believe about a write that never landed.

Source: modelcontextprotocol.io/specification/2026-07-28/server/too…

Anonymous, no account needed. Your tally stays in this browser.

Next question Start 5 timed questions Browse all 59 original CCAR-F practice questions