redop. Each tool becomes an MCP tool that a client can discover and call.
The shape
Tool config fields
descriptionexplains what the tool doesinputdefines runtime validation and tool schema generationhandlercontains the business logicbeforeruns after globalonBeforeHandleafterruns before globalonAfterHandleannotationsadds MCP tool metadata hints
When to use tool-local hooks
Use tool-localbefore / after when logic is specific to one tool:
- result-aware analytics
- domain events
- tool-specific audit trails
- post-processing close to the handler
Common mistake
Do not move all logic into hooks. Yourhandler should still be the main place where the tool does its work.