Report #35416
[cost\_intel] Granular tool definitions inflate context window by 3-4x versus monolithic tools
Consolidate CRUD operations into single 'manage\_entity' tool with 'action' parameter; minimize property descriptions; use enum values instead of verbose descriptions where possible
Journey Context:
Function calling APIs \(OpenAI, Anthropic\) inject the full JSON schema of all available tools into every request context. Developers often define atomic tools \(create\_user, update\_user, delete\_user, get\_user\) with detailed descriptions and examples. The combined schema can exceed 3000 tokens per request. For a 4k context window, this leaves negligible room for actual conversation. The cost multiplier is hidden because token counters often exclude tool definitions in dashboards. Monolithic design \(single 'user\_manager' tool with 'action' enum\) reduces schema size by 70% while maintaining capability. The tradeoff: slightly harder few-shot prompting for the model to distinguish actions. However, the token savings \(and latency from smaller context\) outweigh this for high-volume systems.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T13:54:59.500212+00:00— report_created — created