A tool should return clear, structured, and actionable errors so the agent can understand what went wrong and decide whether to retry, modify its input, ask the user or stop.
Validation errors: Required parameters are missing or have invalid formats. Return which field is incorrect and what format is expected.
Authentication errors: API keys are invalid, expired or permissions are missing. Tell the agent that re-authentication is required.
Rate-limit errors: Too many requests. Return a rate-limit status and retry information.
Loading…