> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2-studio-tools-doc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# RetryAgentRun

> API reference for the RetryAgentRun exception used to provide feedback to the model within the tool call loop.

The `RetryAgentRun` exception allows you to provide instructions to the model for how to change its behavior and have the model retry within the current agent run. The exception message is passed to the model as a tool call error, allowing the model to adjust its approach in the next iteration of the LLM loop.

<Note>
  This does **not** retry the full agent run—it only provides feedback to the model within the current run's tool call loop.
</Note>

## Constructor

```python theme={null}
RetryAgentRun(
    exc: str,
    user_message: Optional[Union[str, Message]] = None,
    agent_message: Optional[Union[str, Message]] = None,
    messages: Optional[List[Union[dict, Message]]] = None,
)
```

### Parameters

<ResponseField name="exc" type="str" required>
  The error message to pass to the model. This message provides instructions or feedback to help the model adjust its behavior in the next iteration.
</ResponseField>

<ResponseField name="user_message" type="Union[str, Message]" optional>
  An optional message to display to the user about the retry.
</ResponseField>

<ResponseField name="agent_message" type="Union[str, Message]" optional>
  An optional message from the agent's perspective about the retry.
</ResponseField>

<ResponseField name="messages" type="List[Union[dict, Message]]" optional>
  An optional list of messages to add to the conversation history.
</ResponseField>

## When to Use

Use `RetryAgentRun` when:

* **Validation fails**: Input doesn't meet requirements, and you want the model to try again with corrected input
* **State requirements**: The current state doesn't meet prerequisites, and you want the model to perform additional actions
* **Business logic**: A condition isn't met, and you want to guide the model on how to proceed
* **Iterative refinement**: You want the model to improve its approach based on feedback

## Behavior

When `RetryAgentRun` is raised:

1. The exception message is added to the tool call result as an error
2. The model receives this error in the next LLM call
3. The model can adjust its approach and retry the tool call or try a different approach
4. The agent run continues (does not stop or exit)
5. All messages and tool calls are preserved in the session

## See Also

* [StopAgentRun Exception](/reference/tools/stop-agent-run)
* [Exceptions & Retries Guide](/tools/exceptions)
