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—Okwith the original inputrewrite—Okwithpayload.inputfrom the rewritten tool payload;toolNameandsourceare the tool’s identity and cannot changedeny—Errwith the gate’s reason (callers decide how a denial reaches the model)suspend— throw unless the host wrapped the gate withparkingEffectGate
Emits effect_intent / effect_settled via ToolEffectScope.recordEffect.
Type Parameters
Section titled “Type Parameters”TInput
Section titled “TInput”TInput
Parameters
Section titled “Parameters”ToolCallArgs<TInput>
Returns
Section titled “Returns”Promise<Result<TInput, string>>