Skip to content
1 min read · 95 words

Function: runToolGate()

ts
function runToolGate(
  gate: ToolGateFn | undefined,
  ctx: unknown,
  tool: string,
  args: unknown,
): Promise<void>;

Defined in: src/batteries/tools/_shared/index.ts:288

Await a configured ToolGateFn (no-op when absent). Factory batteries call this at the top of their handlers so the gate runs before any side effect.

Parameters

ParameterTypeDescription
gateToolGateFn | undefinedThe configured gate, if any.
ctxunknownThe dispatch context the handler received.
toolstringThe tool name (post-override).
argsunknownThe validated tool args.

Returns

Promise<void>