Skip to content
1 min read · 151 words

Type Alias: RenderToolsFn ​

ts
type RenderToolsFn = (tools: ReadonlyArray<WorkingTool>) => string;

Defined in: src/batteries/context/thrift/contracts.ts:257

Renders a set of tools into the EXACT prompt text a caller's LLM battery will send to the model (e.g. a <tool_definitions> block with full JSON-Schema per tool), so the tools bucket is measured against the REAL dispatched size rather than a cheap name: description proxy. Injecting this is the difference between an accurate budget and one that silently undercounts by an order of magnitude for schema-heavy tools — see the calibration note on @nhtio/adk/batteries/context/thrift/subtractive_pass!subtractToFit. Optional: when omitted, the pass falls back to the name: description proxy (keeps the battery usable standalone/in tests without a real tool-rendering pipeline).

Parameters ​

ParameterTypeDescription
toolsReadonlyArray<WorkingTool>The subset of tools currently visible (post-hiding), to render/measure.

Returns ​

string

The exact rendered text the caller's battery would send for these tools.