Problem
When a tool fails, the error message is sometimes just a raw {"error": "..."} string. This makes it harder for the model to recover gracefully.
Proposed solution
- Define a standard error response format with error codes, categories, and human-readable messages.
- Apply this format consistently across all tools.
Implementation notes
- Create an
ErrorCode enum in core/errors.py.
- Define categories like
FILE_NOT_FOUND, PERMISSION_DENIED, INVALID_INPUT, TIMEOUT.
- Return structured error dicts with
code, message, recoverable, and suggestion fields.
Acceptance criteria
- All tool errors return a structured error dict with at least
code and message.
- Error codes are documented.
- The model can distinguish between recoverable and non-recoverable errors.
Problem
When a tool fails, the error message is sometimes just a raw
{"error": "..."}string. This makes it harder for the model to recover gracefully.Proposed solution
Implementation notes
ErrorCodeenum incore/errors.py.FILE_NOT_FOUND,PERMISSION_DENIED,INVALID_INPUT,TIMEOUT.code,message,recoverable, andsuggestionfields.Acceptance criteria
codeandmessage.