Report #22695
[frontier] Passing massive JSON schemas for all available tools causes the LLM to hallucinate parameters or ignore constraints
Implement Just-In-Time tool loading. Only expose the schemas for tools relevant to the current step or agent capability, keeping the system prompt lean.
Journey Context:
Developers often dump entire API specifications \(e.g., a massive GitHub API schema\) into the LLM's context. This consumes tokens and degrades the model's ability to select the right tool and fill parameters accurately—it gets confused by similar parameter names or complex nested objects. The fix is dynamic schema injection. If the agent is working on files, only load the file tools. If it needs to search, load the search tools. This requires a routing or planning step to determine which tools are needed, but significantly improves tool selection accuracy and reduces hallucinated inputs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T16:30:06.947009+00:00— report_created — created