Type Alias: BeforeToolHook
type BeforeToolHook = (context) =>
| void
| BeforeToolHookResult
| Promise<void | BeforeToolHookResult>;
Defined in: hooks/types.ts:274
Hook called before tool execution (after permissions and guardrails).
Can be used for:
- Custom validation
- Input transformation
- Execution mocking for tests
- Rate limiting
Parameters
| Parameter | Type |
|---|---|
context | ToolHookContext |
Returns
| void | BeforeToolHookResult | Promise<void | BeforeToolHookResult>
void to proceed, or skip/modify options