Skip to main content
Glama

ufw_rule

Add or delete UFW firewall rules on managed Linux hosts to open or close ports, with a dry-run plan before applying changes.

Instructions

Add or delete a UFW rule on hosts, e.g. open a new public port for an inbound (allow 8443/tcp on the internet interface) or close one. Public exposure of 22/2222/5443/5444/9100 is blocked unless allowDangerous. The rule list before the change is shown in the dry run.

Input Schema

NameRequiredDescriptionDefault
opYes
fromNosource IP/CIDR; default Anywhere
portYes
applyNofalse (default) = dry run: show what will happen on which hosts and a planHash. true = run it; needs planHash
ifaceNointerface, e.g. eth0 (public) or tailscale0; default: any
protoNotcp
targetNohosts: all | <host> | <glob nl-*> | <group> | role:<edge|remnanode|panel|docker> | tag:<tag>; comma-separated, !x excludesall
planHashNoplanHash from the dry run of the very same call, good for one apply; refused if targets or their state changed since
allowDangerousNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does disclose meaningful behavior: certain ports (22/2222/5443/5444/9100) are blocked from public exposure unless allowDangerous, and a dry run shows the rule list before the change. That is real safety context beyond the schema, though it omits privilege requirements and what the apply step returns.

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 tight sentences, front-loaded with purpose then the safety caveat then the dry-run behavior. Every sentence contributes; minimal waste.

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 9-param mutation tool with no output schema and no annotations, the description covers the crucial safety gate and the dry-run/apply workflow. Targeting semantics and planHash mechanics live in the schema, so coverage is adequate though not exhaustive.

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 coverage is only 56% across 9 params, so the description must compensate. It clarifies allowDangerous (which dangerous ports are gated) and apply (dry run vs execute), but adds nothing for from, proto, target, or planHash beyond what the schema already says. Partial compensation warrants a 3.

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 concrete verb+resource ('Add or delete a UFW rule on hosts') and reinforces it with a worked example ('allow 8443/tcp on the internet interface'). An agent immediately knows this manages host firewall rules. It does not explicitly distinguish itself from the sibling host_firewall, so it stops short of a 5.

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?

The example ('open a new public port ... or close one') implies the usage context, and the dry-run sentence hints at the intended workflow. However, there is no explicit when-to-use/when-not guidance and no routing to alternatives such as host_firewall, leaving selection to inference.

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