The worst outcome of a failed tool is not an error message: it is a confident invented answer. The n8n error guides recommend wrapping tool calls so a failure returns a fallback message such as I could not retrieve that information right now, instead of letting the model fill the gap. Write that fallback into the agent’s instructions as the only allowed answer when no tool returned a result, and make it specific enough to be useful: what was tried, and what the user can do next. An agent that must always answer will always invent; give it permission not to.
What you need
- An agent whose tools sometimes return nothing
- A fallback sentence naming what was tried and what to do next
- One test question whose tool returns nothing
Step 1: Write the fallback answer into the instructions
Add a sentence that when no tool returns a result, the agent must use the fallback answer and add nothing to it. The fallback names the tool that was tried and suggests the next step.
Step 2: Run the test question with an empty tool result
Run the test question with the tool returning nothing, and confirm the agent gives the fallback answer instead of an invented one. If it invents, the fallback is not in the instructions.
Step 3: Check the fallback is used only when needed
Run a normal question and confirm the agent answers from the tool result, not from the fallback. A fallback that appears on good runs is a broken trigger.
Worked example: synthetic fallback answer
The table below is a synthetic example. It shows the expected result of the fallback answer; no agent was run.
| Check | Expected | Result |
|---|---|---|
| Tool returns nothing | Yes | Pass |
| Agent gives the fallback | Yes | Pass |
| Agent invents an answer | No | Pass |
| Normal question uses the tool | Yes | Pass |
Expected result (UNTESTED). when the tool returns nothing the agent gives the fallback answer, and normal questions still use the tool result. This check was not run live; the table shows the expected result for the synthetic example.
Limits
- A fallback answer must be honest about what was not found, or it is a polite invention.
- The fallback only helps if the agent knows the tool returned nothing; check the tool result is passed back.
- A generic fallback on every failure hides which tool broke.
- The user needs a next step in the fallback, not just an apology.
