Pre-Hooks and Post-Hooks
Usepre_hook and post_hook on the @tool decorator:
Pre-Hook Signature
- Log the call
- Validate arguments beyond schema checks
- Raise an exception to prevent execution
Post-Hook Signature
- Log or audit the result
- Send notifications
- Update metrics
Hook Chains
Usetool_hooks to attach a list of hooks that run in order: