Create Waf Rule Tool
create_waf_rule_toolCreate a Cloudflare WAF custom rule to block, challenge, or log requests matching an expression, using a zone ID or zone name.
Instructions
Create a new WAF custom rule.
Free plans support up to 5 custom rules. Provide either zone_id or zone_name, not both.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "create_waf_rule_tool"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | Action to take (managed_challenge, block, js_challenge, challenge, skip, log) | managed_challenge |
| enabled | No | Whether the rule is enabled (default: true) | |
| zone_id | No | Zone ID (32-character hex string) | |
| zone_name | No | Zone name (domain like example.com) | |
| expression | No | Cloudflare filter expression (e.g., '(http.request.uri.path contains "xmlrpc.php")') | |
| description | No | Human-readable description of the rule |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||