Availability
For how tool filters run and what the caller sees when a filter blocks, refer to Tool Filters.
Write a script filter for the tool arguments or the tool response, then attach it to the tool.
Create a Tool Filter
- Create a script filter.
- To check the tool call arguments, clear Is this a Response Filter?. The script gets the arguments as JSON. For the format, refer to Tool Filter Input.
- To check the tool response, select Is this a Response Filter?. The script gets the response body as a plain string. Use the
textmodule, becausetyk.redact_pattern()does not work with tool responses.
- Attach the filter to the tool.