build_retry_prompt
Generates retry feedback prompts from prior attempts, appending validation errors to guide LLM towards correct structured output.
Instructions
Given an attempt history, produce the retry feedback message agentcast would append to the conversation when the model returned the wrong shape. Codifies the "validation error as feedback" pattern for non-Node MCP clients.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| attempts | Yes | List of prior attempts. Each item should have the assistant text plus either a parsed value or an error string. | |
| expected_shape | No | Optional agentcast shape spec to include in the feedback for extra grounding. |