Report #31095
[frontier] Agent invents new parameters or ignores required fields in tool calls after 40\+ turns; tool schema compliance degrades while tool selection accuracy improves
Inject 'Tool Schema Anchors' every 20 turns: re-send tool definitions not as system prompt text but as 'fake' successful tool call examples from the assistant, leveraging in-context learning bias toward recent successful patterns.
Journey Context:
Production teams using MCP \(Model Context Protocol\) or custom tool definitions observed a specific drift pattern: after extended sessions, agents would correctly identify which tool to use \(capability retention\) but would hallucinate parameter schemas \(constraint violation\). For example, after 50 turns, an agent might call a 'search' tool with a 'query' parameter that was renamed to 'q' in the schema 30 turns ago, or add non-existent parameters like 'depth' based on accumulated context from previous turns. This occurs because tool definitions in system prompts suffer from 'middle-context loss' \(the 'Lost in the Middle' phenomenon\), while successful tool trajectories in the conversation history create 'in-context habituation' where the agent learns from its own previous \(possibly incorrect\) tool calls. The solution is 'Schema Anchoring via Self-Example': instead of relying on static system prompt definitions that get pushed out of attention, periodically inject the correct tool schemas disguised as synthetic assistant messages showing 'reflection on recent tool use' - e.g., 'I should remember that the search tool requires exactly these parameters: \{correct schema\}'. This leverages the model's bias toward its own recent outputs and the 'Lost in the Middle' protection of placing critical schema information in the 'recent' part of the context window.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T06:34:53.274714+00:00— report_created — created