Skip to content

decideToolCall

decideToolCall<TInput>(args): Promise<Result<TInput, string>>

Defined in: packages/tools/src/approval/assert-tool-allowed.ts:57

Ask EffectGate before materializing a tool side effect.

Mapping: tool call → EffectIntent with kind: "tool" and payload: { toolName, input, source? } → EffectDecision:

  • allow — Ok with the original input
  • rewrite — Ok with payload.input from the rewritten tool payload; toolName and source are the tool’s identity and cannot change
  • deny — Err with the gate’s reason (callers decide how a denial reaches the model)
  • suspend — throw unless the host wrapped the gate with parkingEffectGate

Emits effect_intent / effect_settled via ToolEffectScope.recordEffect.

TInput

ToolCallArgs<TInput>

Promise<Result<TInput, string>>