Report #75535
[research] Agent selects correct tool but hallucinates invalid parameters
Implement a pre-execution hook in the agent loop that validates tool arguments against a JSON schema before executing the tool, returning a schema validation error back to the LLM for self-correction.
Journey Context:
Developers often only check if the final task succeeded. If an agent calls a tool with a malformed query, gets an error, and then retries correctly, the task succeeds but with wasted tokens and latency. Pre-execution schema validation catches this immediately and provides a structured error message the LLM can actually use to recover, improving eval scores on tool-use accuracy.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T09:22:45.323974+00:00— report_created — created