Error Handling Instructions for an Assistant That Uses Tools
Tell an agent exactly what to do when a tool fails or returns nonsense.
Added October 15, 2026. Written with AI assistance and checked for clarity and placeholders; not reviewed by a lawyer, accountant, clinician or other professional. How these prompts are made
The Open buttons send the prompt text as currently shown below to that site only when you click. Fill in the placeholders first.
Write error-handling instructions for an assistant that calls tools. Tools and typical failures: [TOOLS_AND_FAILURES]. Actions that must not be repeated blindly: [NON_IDEMPOTENT_ACTIONS]. How the user should be told: [USER_COMMUNICATION]. Create a table with Failure type (timeout, auth error, empty result, partial result, rate limit, malformed output, conflicting data), What the assistant checks first, Whether it may retry (how many times), What it tells the user in plain words, and When it hands over. Write the instruction block (under 300 words) with rules such as: never claim success without a confirming result; never retry actions that send or charge without checking whether the first attempt worked; report what was and was not done; offer a safe next step. Provide three example transcripts: a harmless retry, a possible duplicate action, and a failed action that must be reported honestly. Add a short test plan to simulate each failure. Add a decision table for duplicates: before retrying a 'send email' call that timed out, the assistant checks the sent folder or the tool's status endpoint, and only retries if it finds no record. Write the exact user message for each outcome: confirmed sent, not sent and retried, and unknown.
Fill in before use
Optional: type your details and the prompt above updates. Nothing is saved or sent.
Replace each bracketed placeholder with your own details, then paste into Any AI or another assistant.