UseDocumentation Index
Fetch the complete documentation index at: https://redop.useagents.site/docs/llms.txt
Use this file to discover all available pages before exploring further.
onBeforeHandle(...) when you need shared logic that should run before middleware and the handler.
This is a global lifecycle hook. It runs for tools, resources, and prompts.
What it is for
onBeforeHandle(...) is a good fit when you want to:
- observe incoming work before execution
- attach timing or request metadata to
ctx - perform shared logging before execution
- run lightweight setup that should happen for every request
Example
Where it runs in the lifecycle
For tools, Redop runs this sequence:onBeforeHandle(...) runs:
- after tool input parsing when the request is a tool call
- before local
before - before middleware
- before the handler
tool is the normalized identifier Redop exposes for global hooks:
- tool calls use the tool name
- resources use the resource URI
- prompts use the prompt name
Use it vs local before
Use onBeforeHandle(...) when the logic is shared across many tools, resources, or prompts.
Use local before when the logic belongs to one tool, resource, or prompt only.