turnToolTokens
@forge/monorepo / backend/src / turnToolTokens
Function: turnToolTokens()
turnToolTokens(
tool):number
Defined in: backend/src/agents/engine.ts:67
What one tool costs the model's context.
A ModelTurnTool is not a catalogue entry — it carries the full input schema, because that is what a provider
puts in the request — so this deliberately does not reuse entryTokens. Using the compact estimate here
would understate a schema-heavy tool by an order of magnitude and produce a budget that never binds.
Parameters
tool
Returns
number