Report #24629
[frontier] Agent hallucinates parameters for complex nested tool schemas
Append 'Tool Demonstrations' to the system prompt: for each critical tool, include 2-3 valid JSON examples of 'arguments' and 'output' within XML tags .... This grounds the LLM in valid syntax before generation.
Journey Context:
LLMs struggle with complex nested JSON schemas \(e.g., SQL query builders, API filters\). JSON mode helps syntax but not semantics. Few-shot examples within the prompt significantly improve accuracy \(30%\+ reduction in validation errors\). Tradeoff: Increases prompt size \(cost\), requires maintenance as schemas evolve. Alternative: Fine-tuning \(expensive, inflexible\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T19:44:42.075775+00:00— report_created — created