An agent keeps retrying a request that a tool rejected as not permitted. What change helps most?
Why C is the answer
Return is_error with a message saying it is not permitted and will not succeed
Specific errors let the model choose well. If the message says retrying cannot work, the agent can stop or ask for help.
In detail
- The agent retries because nothing tells it that retrying is pointless.
- A tool result with is_error and a specific message gives the model what it needs to change course.
- Saying the request is not permitted and will not succeed lets it stop or ask for help.
- Say why the call failed and whether a retry could ever work.
Use case
An illustrative scenario, not a real incident.
A customer asks the agent to view another customer's order. The tool refuses, but with a vague error the agent tries again and again. A message saying the request is not permitted and will not succeed lets it stop and explain.
See it in different ways
flowchart TD
A["Tool fails"] --> B["tool_result with is_error"]
B --> C{"Message says what?"}
C -->|"Bad input"| D["Fix the arguments"]
C -->|"Temporary"| E["Retry"]
C -->|"Not allowed"| F["Stop and explain"]sequenceDiagram participant M as Claude participant T as Tool M->>T: Request T-->>M: is_error, not permitted, will not succeed M-->>M: Stops retrying and changes plan
sequenceDiagram participant P0 as Agent participant P1 as Tool P0->>P1: Fetch this order P1-->>P0: is_error, not permitted, do not retry P0->>P0: Explain to the customer
Key point: Tell the agent when retrying is pointless.
Why the other options are wrong
- A. Increase the agent's turn limit, so that it can eventually give up by itself
- A higher turn limit gives the agent more failed attempts.
- B. Remove the tool, so that the agent is not able to make the request again
- Removing the tool also removes every valid use of it.
- D. Add a sleep inside the tool so that each retry takes much longer to complete
- A delay wastes time. The agent still has no reason to stop.

