Skip to main content
Glama

firewall_rule_add

Destructive

Adds an OpenWrt traffic rule with preview-first changes, applying only after confirmation and auto-rolling back if the router stops responding.

Instructions

Add a traffic rule. src/dest: zone names or "*" (dest omitted = traffic to the router itself). target: ACCEPT, REJECT or DROP. proto: tcp, udp, "tcp udp", icmp or all. family: ipv4, ipv6 or any. Without confirm=true this only returns a preview of the UCI changes and changes nothing. With confirm=true it applies them with the router's rollback timer, checks the router still answers, and confirms; if the check fails, the router restores the old config by itself.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "name": "<name>",
      "src": "<src>"
    },
    "name": "firewall_rule_add"
  }
}

Input Schema

NameRequiredDescriptionDefault
srcYes
destNo
nameYes
protoNotcp udp
familyNoany
src_ipNo
targetNoACCEPT
confirmNo
dest_ipNo
enabledNo
dest_portNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses the two-phase commit (preview vs apply), the router's rollback timer, the post-apply reachability check, and the automatic config restore on failure. These are exactly the safety traits an agent needs for a destructiveHint=true mutation and are not encoded in any structured field.

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?

Dense and front-loaded: the core action comes first, field semantics next, and the confirm/rollback contract last. The telegraphic "src/dest: zone names" style is efficient rather than wasteful, though the colon-list fragments take a moment to parse.

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 an 11-parameter destructive mutation, the definition covers the highest-risk aspect (preview, confirmation, auto-rollback), and an output schema exists so return values need not be described. It is incomplete on address/port/enabled parameter semantics and omits prerequisites like required permissions.

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

Parameters3/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 carry parameter meaning; it explains src/dest wildcard and omitted-dest behavior, target values, proto values, family values, and confirm. However, five parameters go undocumented, including the required 'name' plus src_ip, dest_ip, dest_port, and enabled, leaving meaningful gaps in a low-coverage schema.

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 ("Add a traffic rule") and immediately defines the field semantics for src/dest/target/proto/family, so an agent knows exactly what is being created. It does not explicitly distinguish itself from siblings such as port_forward_add or firewall_rule_remove, relying on the names alone for that separation.

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?

Gives clear conditional guidance for the critical decision: without confirm=true it is a no-op preview, with confirm=true it applies the change. This tells the agent how to safely stage the operation. It stops short of naming alternatives (e.g., when to prefer a port forward or a config-level change instead).

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