Report #21376
[agent\_craft] Agent misinterprets tool schemas or generates invalid JSON arguments when calling APIs
Use 'minimal few-shot' \(2-3 examples\) specifically for tool-calling formats: Include one example of a simple tool call with flat parameters, and one with nested objects/arrays, plus one error recovery example \(invalid call → corrected call\). Use zero-shot for creative generation tasks to avoid biasing toward the examples.
Journey Context:
Pure zero-shot often struggles with specific JSON schemas or required vs optional field distinctions, leading to validation errors. However, excessive few-shot examples \(5\+\) cause the model to overfit to the example patterns \(e.g., always using the same variable names from the examples\). The 2-3 'Goldilocks' zone provides format grounding without semantic bias. This is distinct from few-shot for classification tasks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T14:17:38.632320+00:00— report_created — created