Skip to main content
Glama

Set port forwarding rule

set_port_forwarding
Destructive

Create or update a port forwarding rule on a Keenetic router to expose internal services, targeting a host by MAC or IP with dry-run default.

Instructions

Create or update a port forwarding rule ('ip static'). The target is addressed by MAC: pass to_host as a MAC, or as an IP that belongs to a registered host (it is resolved, and refused if unknown). dry_run is TRUE by default - it returns the payload without sending it. A real write is saved to startup-config and verified by re-reading the tree. Ports serving MCP endpoints are refused in code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portYesExternal port
enableNofalse disables the rule (per-rule flag)
commentNoRule comment
dry_runNoDefault true
to_hostYesTarget MAC, or IP of a registered host
to_portNoInternal port, if different
end_portNoEnd of external port range
protocolNotcp (default) or udp
interfaceNoWAN interface, default GigabitEthernet1

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.9.0

TDQS

A4.7/5.0
Behavior5/5

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

Adds substantial context beyond annotations: dry_run defaults to TRUE and returns the payload without sending, a real write persists to startup-config and is verified by re-reading the tree, and endpoint ports are refused in code. This meaningfully qualifies the destructiveHint and non-idempotent flags.

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?

Four tight sentences, front-loaded with purpose, then targeting rules, then the dry_run safety default, then refusal behavior. No sentence is redundant or padding.

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?

For a 9-parameter mutation tool with no output schema, the description covers the critical agent-facing facts: default-safe dry_run, persistence/verification behavior, target resolution, and code-level refusal. Nothing essential for correct invocation is missing.

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 already 100%, so the baseline is 3, but the description adds real semantics: to_host resolution behavior (MAC vs registered-host IP, refusal on unknown) and the exact default and effect of dry_run, which the schema only labels 'Default true'.

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 (Create or update) and resource (port forwarding rule, aliased to 'ip static'), and contrasts implicitly with get_port_forwarding and remove_port_forwarding in the sibling list. An agent can tell what it 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?

Gives clear usage conditions: pass to_host as MAC or as an IP of a registered host (resolved, refused if unknown), and notes that MCP-endpoint ports are refused in code. It does not explicitly name an alternative tool for viewing or removing rules, so it stops short of full when/when-not routing.

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