Skip to main content
Glama

cf_get_rule

Retrieve a specific Cloudflare rule by its ID from a ruleset to identify the rule behind a firewall event.

Instructions

Look up a single rule by ID.

Cloudflare exposes rule lookup via the parent ruleset; this is a
convenience wrapper that fetches the ruleset and projects the matching
rule. Used heavily for "what does rule X do" resolution when a firewall
event reports an unknown rule ID.

Args:
    scope: 'zone' or 'account'.
    scope_id: matching CF ID.
    ruleset_id: parent ruleset ID.
    rule_id: rule ID to extract.

Calls: GET /{zones|accounts}/{scope_id}/rulesets/{ruleset_id} → project rule.

Errors:
    not_found when the ruleset returns 200 but no rule matches the ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scopeYes
scope_idYes
ruleset_idYes
rule_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Without annotations, the description carries the full burden. It explains the underlying API call, the projection behavior, and an error case (not_found when rule ID not in ruleset). It does not mention auth or rate limits, but the behavioral description is sufficient for an agent.

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?

The description is concise and well-structured: a one-line summary, a sentence on motivation, then Args, call syntax, and errors. Every sentence adds value without redundancy.

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

Completeness5/5

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

Given the tool's complexity (5 sibling tools dealing with rulesets/rules), the description covers purpose, usage, parameters, behavior, and errors. An output schema exists, so return values need not be explained. The description is complete for an agent to use the tool correctly.

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 0% schema description coverage, the description compensates by explaining each parameter (scope, scope_id, ruleset_id, rule_id) and providing context for scope values. This adds significant meaning beyond the bare schema.

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?

The description states it's a convenience wrapper for looking up a single rule by ID, specifically for resolving unknown rule IDs from firewall events. This is a specific verb+resource that clearly distinguishes from siblings like cf_get_ruleset.

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?

The description provides clear context on when to use the tool ('what does rule X do' resolution) and implies it's an alternative to fetching the full ruleset. However, it does not explicitly state when not to use it or name alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/wojtekkura/cf-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server