A housing-authority document-verification MCP tool sometimes fails because the applicant's uploaded file is corrupted, and sometimes fails because the verification service is temporarily down. Both currently return the same generic error object. How should the tool's structured error distinguish them for the agent?
Select an answer to reveal the explanation.
Short Explanation
A corrupted upload and a downed server need opposite next moves. A structured error is the difference between a doctor saying something is wrong and one naming the organ and whether it heals on its own.
Full Explanation
An error is an input to the agent's next decision, so it must carry enough structure to drive a branch. A housing-authority verification tool that returns the same generic object for a corrupted applicant file and a temporarily unavailable service has erased the only distinction that matters: whether waiting will help.
Distinct errorCategory values—invalid_input for the corrupted upload, service_unavailable for the outage—paired with an isRetryable flag give the agent a machine-readable branch. It retries the outage on a backoff and, for the bad file, stops retrying and asks the applicant to re-upload, which is the only action that can actually succeed.
A bare error flag with no fields leaves the agent inferring cause from the tool name, which is the ambiguity being fixed; marking both failures retryable sends the agent into an unbounded retry loop against a file that will never parse, burning time while the applicant hears nothing; logging the distinction only server-side puts the information somewhere the decision-maker cannot read, so it informs a post-mortem but not the run.
Exam caveat: category and retryability are related but not identical—an invalid_input failure can become retryable once the input changes, so the flag should describe retrying this same call rather than the situation in general. Operational check: force each failure mode in a test harness and assert the agent takes a different observable action for each, not merely that it receives a different string.