Skip to main content

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

  1. 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 text module, because tyk.redact_pattern() does not work with tool responses.
  2. Attach the filter to the tool.

Example Scripts

Block Tool Responses Containing Errors

Redact PII from Tool Responses

Filter Based on Tool Name