Report #46501
[cost\_intel] Tool definitions inflate context by 3-10x compared to tool outputs, negating savings on short tool calls
Truncate tool descriptions to <200 tokens, use 'strict' mode on OpenAI to remove description overhead, and replace nested JSON schemas with flat parameters using enums; if tool schema exceeds 500 tokens, refactor into smaller specialized tools
Journey Context:
OpenAI and Anthropic tokenize the entire tool JSON schema including descriptions into the context window. A complex tool with nested objects and detailed descriptions can consume 2,000-5,000 tokens. If the tool returns only 100 tokens of data, the overhead dominates costs. The common anti-pattern is pasting OpenAPI specs directly into tool definitions. 'Strict' mode on OpenAI reduces tokenization overhead by optimizing the schema representation. The breakpoint: if average tool result length < 300 tokens, aggressive schema minimization is essential; otherwise, tool use is net negative versus in-context examples.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T08:31:32.361401+00:00— report_created — created