Report #35880
[cost\_intel] Function tool definitions inflating context by 500\+ tokens per tool unnoticed
Measure tool definition tokens using the API tokenizer before deployment; compress schemas by removing redundant descriptions and using shorter property names; implement dynamic tool selection to inject only the 2-3 relevant tools per request rather than the full 20-tool library. Expect 100-500 tokens per tool definition depending on JSON schema complexity.
Journey Context:
Developers calculate user message tokens but forget that tool definitions are injected into the context window every request. A complex tool with nested objects and detailed descriptions can consume 500\+ tokens. With 10 tools, that's 5k tokens of overhead before the user says 'hello'. At GPT-4o rates, that's $0.15 per request in tool overhead alone. The fix is treating tool definitions like code that needs minification and lazy loading.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T14:42:09.905044+00:00— report_created — created