Skip to main content
Glama
crunchtools

mcp-cloudflare-crunchtools

by crunchtools

create_waf_rule_tool

Create a Cloudflare WAF custom rule to block, challenge, or log requests matching a filter expression, enforcing zone access policies without manual dashboard setup.

Instructions

Create a new WAF custom rule.

Free plans support up to 5 custom rules. Provide either zone_id or zone_name, not both.

Args: zone_id: Zone ID (32-character hex string) zone_name: Zone name (domain like example.com) expression: Cloudflare filter expression (e.g., '(http.request.uri.path contains "xmlrpc.php")') action: Action to take (managed_challenge, block, js_challenge, challenge, skip, log) description: Human-readable description of the rule enabled: Whether the rule is enabled (default: true)

Returns: Created rule details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionNomanaged_challenge
enabledNo
zone_idNo
zone_nameNo
expressionNo
descriptionNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv0.5.1
    • removedInput schema / additionalProperties
      Removed value: -false
    • removedInput schema / properties / action / description
      Removed value: -"Action to take (managed_challenge, block, js_challenge,\nchallenge, skip, log)"
    • removedInput schema / properties / description / description
      Removed value: -"Human-readable description of the rule"
    • removedInput schema / properties / enabled / description
      Removed value: -"Whether the rule is enabled (default: true)"
    • removedInput schema / properties / expression / description
      Removed value: -"Cloudflare filter expression\n(e.g., '(http.request.uri.path contains \"xmlrpc.php\")')"
    • removedInput schema / properties / zone_id / description
      Removed value: -"Zone ID (32-character hex string)"
    • removedInput schema / properties / zone_name / description
      Removed value: -"Zone name (domain like example.com)"
  2. First observedv0.5.0

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It discloses the free-plan rule cap, the either/or zone identifier constraint, and the enabled default, which is meaningful context. However, it omits permission requirements, whether the rule is created enabled/attached immediately, and validation failure behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the purpose, then constraints, then a clean Args list. Every sentence earns its place with no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a create tool with an output schema (so return values need not be described), it covers purpose, limits, and all parameters adequately. The main gap is auth/permission context and post-creation behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it does: it documents all six parameters including zone_id format (32-char hex), zone_name format (domain), the action enum values, the enabled default, and an example filter expression. It adds real value beyond the bare schema, though it could cover expression syntax more fully.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Create a new WAF custom rule'), which cleanly distinguishes it from the sibling update_waf_rule_tool, delete_waf_rule_tool, and list_waf_rules_tool. An agent can select it without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides useful operational constraints — the free-plan limit of 5 custom rules and the mutual exclusivity of zone_id vs zone_name — but never says when to prefer this over the sibling update/delete tools or what prerequisites (plan tier, permissions) are needed. Usage is implied rather than stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.