Skip to content

Recover from tool failure

Time: 3–5 minutes · No edits required

The weather tool throws an actionable error when a date is outside Open-Meteo’s forecast window. Trigger that path deliberately:

Terminal window
npm run deploy
sleep 5
TIMEOUT_S=200 npm run smoke -- https://field-trip-agent.<subdomain>.workers.dev failure-live-1 \
"We're planning a Lisbon offsite on 2099-03-01 for 8 people. Call the weather tools and explain the result."
TIMEOUT_S=200 npm run smoke -- https://field-trip-agent.<subdomain>.workers.dev failure-live-1 \
"Change the offsite dates to <START> through <END>. Save the corrected brief and try the weather tools again."

Save your workers.dev subdomain to open this test ↗https://field-trip-agent.<subdomain>.workers.dev/?id=failure-live-1

This opens the same conversation as the smoke test. If you repeat this checkpoint, before copying its commands.

Verification gate

Prove it works

  • save_trip_brief and geocode_city succeed.
  • get_forecast displays an error rather than invented weather.
  • The agent catches the tool outcome and explains the 16-day limit.
  • The second request updates the saved dates and gets a real forecast in the same conversation.
  • The first execute_tool get_forecast span records an error while the enclosing agent turn can still complete.
  • The corrected forecast succeeds in the next turn’s trace.

Compare both turns in the Agents dashboard. The trace waterfall separates a failed tool operation from the final status of the complete agent response.

No code reset is needed. The saved brief now contains the corrected dates. Use a fresh conversation ID for your next experiment.