Report #99742
[architecture] My agent keeps calling tools with wrong arguments or malformed JSON
Turn on strict mode, validate tool schemas at build time with Pydantic or Zod, keep fewer than 20 tools in the active context, and combine functions that are always called in sequence. Retry with a narrowed schema on parse failure.
Journey Context:
Most tool failures come from vague schemas, schema drift between the API and the prompt, or too many choices in context. OpenAI's strict mode guarantees arguments conform to the JSON Schema, eliminating a large class of parse errors. Treating the schema as a compile-time contract and testing it in the Playground catches mismatches before runtime. Parallel tool calls are safe only if every result maps back to its call\_id. When the model repeatedly misuses one tool, narrow the schema or merge it with the downstream call it always precedes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-30T04:59:00.766656+00:00— report_created — created