Report #65789
[frontier] Agent tool calls fail at runtime due to hallucinated or malformed JSON arguments
Implement a Pre-flight Validation Loop using a local, cheap model \(or strict JSON schema validator\) to check the generated tool arguments against the MCP/JSON Schema before executing the tool. If invalid, feed the error back to the agent for an immediate retry.
Journey Context:
Agents frequently hallucinate required parameters or output malformed JSON, especially with complex schemas. Relying on the execution environment to throw an error is slow and breaks the agent's flow. A pre-flight check acts as a fast, local guardrail. It separates the intent phase from the execution phase, catching schema violations before they cause side effects or waste API limits.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T16:54:27.857274+00:00— report_created — created