Report #99248
[research] How do I make LLM tool and function calling reliable in agents?
Use provider-native strict tool schemas and force the call when needed: OpenAI strict true plus tool\_choice required, Anthropic tool\_choice with a specific tool name, and Gemini function calling. Validate the tool-input JSON with Pydantic or Zod and handle refusals. Do not rely on plain JSON mode or prompt-only tool instructions.
Journey Context:
Tool calls are structured outputs with semantics; providers now constrain them at decode time. Forcing a specific tool removes the model-refuses-to-call failure mode. Schema portability is worse than plain JSON: OpenAI requires additionalProperties false and all properties required under strict mode. Always parse and validate tool arguments; never trust them blindly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-29T04:49:09.853745+00:00— report_created — created