Skip to main content
Glama

Add a Cloudflare firewall rule

cf_firewall_add
Destructive

Add one firewall rule or rate limit to a Cloudflare zone. What it matches comes from ip or ips (addresses or CIDR), asn, country or countries, path (starts with), user_agent (contains), host and not_verified_bot, combined with and; or a raw expression in Cloudflare's rule language. A rule can block real visitors, so it is undone with cf_undo or cf_firewall_remove.

Input Schema

NameRequiredDescriptionDefault
ipNo
asnNo
ipsNo
hostNo
pathNo
ruleYesblock; challenge (a managed challenge most bots fail); js_challenge; allow (skip the other custom rules); log; rate_limit (block an address making more than requests_per_period requests in period_seconds).
zoneNoThe zone (domain) at Cloudflare, or any host inside it. Not needed when the user has one zone.
countryNo
enabledNo
countriesNo
expressionNoA raw Cloudflare expression instead of the fields above.
user_agentNo
descriptionNo
period_secondsNorate_limit: default 10 (the only value on Free).
not_verified_botNoLeave verified search engines (Googlebot, Bingbot) out of the rule.
blocked_for_secondsNorate_limit: default 10 (the only value on Free).
requests_per_periodNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and openWorldHint=true, but the description adds genuinely new context: that the rule 'can block real visitors' and the exact reversal path via cf_undo/cf_firewall_remove. This is meaningful beyond the safety flags, though it omits permission requirements and success behavior.

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

Conciseness4/5

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

Three dense but front-loaded sentences: the action leads, the matching model follows, and the safety/reversal note closes. Every sentence earns its place, though the middle sentence is long and packs many fields together.

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 destructive, open-world write tool with no output schema and partial param coverage, the description supplies the matching model and the critical reversal path. It is largely complete, missing only success/permission details that the annotations partly cover.

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?

With 17 params at 35% schema coverage, the description carries real weight by explaining how matching fields combine ('combined with and') and field semantics like path (starts with) and user_agent (contains), plus the raw-expression alternative. It leaves parameters like enabled and description unexplained, so not fully compensating.

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+resource ('Add one firewall rule or rate limit to a Cloudflare zone'), distinguishing it cleanly from cf_firewall_list and cf_firewall_remove. An agent can identify exactly what this tool does 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 Guidelines4/5

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

Explicitly routes the agent to cf_undo and cf_firewall_remove for reversal and explains the match-combination model, giving clear operational context. It stops short of naming when NOT to add a rule (e.g., preferring cf_firewall_list to inspect existing rules first), so it lacks full exclusions.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources