Lesson 2 · 5 min
Tool Error Contracts
Return errors that teach Claude how to recover.
Tool errors should be machine-readable and actionable. Include an error_code, a message, and a hint field. "404: file not found" is worse than {code: "NOT_FOUND", hint: "List files first with ls()"}.
Quick check
Tool Design & MCPSelect all that apply
Which fields belong in a good tool error response? (Select all that apply)
