Skip to content

ToolPreExecutionHook

reference
1 min readUpdated

Kind: Type

Source: atloria-monorepo/libs/agent-core/src/runtime/types.ts

Called BEFORE a tool executes. Can block execution entirely and return an error/guidance message instead — the tool never runs.

This enables hard tool blocking (e.g., plan mode) where write tools are genuinely prevented from executing, matching Claude Code's behavior.

Return undefined or null to allow execution. Return a string to BLOCK execution and use that string as the tool output.

Definition

ts
(
  toolName: string,
  toolInput: string,
) => string | null | undefined | Promise<string | null | undefined>

Was this page helpful?

Download as PDF