Skip to main content
Glama
crunchtools

mcp-cloudflare-crunchtools

by crunchtools

Create Waf Rule Tool

create_waf_rule_tool

Create 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.

Input Schema

NameRequiredDescriptionDefault
actionNoAction to take (managed_challenge, block, js_challenge, challenge, skip, log)managed_challenge
enabledNoWhether the rule is enabled (default: true)
zone_idNoZone ID (32-character hex string)
zone_nameNoZone name (domain like example.com)
expressionNoCloudflare filter expression (e.g., '(http.request.uri.path contains "xmlrpc.php")')
descriptionNoHuman-readable description of the rule

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

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

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It adds genuine context by disclosing the free-plan quota (5 custom rules) and the zone selector mutual exclusivity. However, it says nothing about required permissions, idempotency, or mutation/reversibility behavior for a write operation.

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?

Three short sentences, front-loaded with the core purpose, then quota, then the selector constraint. Every sentence earns its place with no redundancy or filler.

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

Completeness3/5

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

An output schema exists, so return values need not be explained, and the purpose, quota, and selector exclusivity are covered. Still, for a mutation tool with zero annotation coverage, the description omits permissions, validation expectations for the expression field, and failure modes.

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 coverage is 100%, so the baseline is 3. The description adds meaning beyond the schema by declaring that zone_id and zone_name are mutually exclusive ('not both'), a constraint not expressed anywhere in the schema properties. This is genuine value-add over the structured fields.

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

Purpose4/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.' An agent can immediately understand the operation. It does not explicitly differentiate from siblings like update_waf_rule_tool or delete_waf_rule_tool, but the create semantics are self-evident among the WAF rule family.

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 a real constraint ('Provide either zone_id or zone_name, not both') and a plan limitation, but gives no explicit when-to-use guidance relative to alternatives such as update_waf_rule_tool, nor any prerequisites. Usage is implied rather than directed.

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