Skip to main content
Glama
itunified-io

mcp-opnsense

by itunified-io

opnsense_nat_source_delete

Remove a source NAT rule by UUID. Requires explicit confirmation to prevent accidental deletion.

Instructions

Delete a Source NAT rule. DESTRUCTIVE: requires explicit confirmation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uuidYesRule UUID
confirmYes

Implementation Reference

  • The handler for the 'opnsense_nat_source_delete' tool. Parses args with SourceNatUuidConfirmSchema (uuid + confirm), then calls the OPNsense API endpoint /firewall/source_nat/del_rule/{uuid} via POST.
    case "opnsense_nat_source_delete": {
      const p = SourceNatUuidConfirmSchema.parse(args);
      const result = await client.post(
        `/firewall/source_nat/del_rule/${encodeURIComponent(p.uuid)}`,
      );
      return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
    }
  • The input validation schema (SourceNatUuidConfirmSchema) used by the delete handler. Requires a valid UUID and a confirm field that must be true.
    const SourceNatUuidConfirmSchema = z.object({
      uuid: UuidSchema,
      confirm: ConfirmTrue("confirm must be true to proceed"),
    });
  • The tool definition registration for 'opnsense_nat_source_delete' in the natToolDefinitions array, including its name, description, and input JSON schema.
    {
      name: "opnsense_nat_source_delete",
      description: "Delete a Source NAT rule. DESTRUCTIVE: requires explicit confirmation.",
      inputSchema: {
        type: "object" as const,
        properties: {
          uuid: { type: "string", description: "Rule UUID" },
          confirm: { type: "boolean", enum: [true] },
        },
        required: ["uuid", "confirm"],
      },
    },
  • src/index.ts:70-70 (registration)
    The tool handler is registered in the MCP server's toolHandlers map by matching the definition name to the handleNatTool function.
    for (const def of natToolDefinitions) toolHandlers.set(def.name, handleNatTool);
  • The UuidSchema helper used by SourceNatUuidConfirmSchema to validate that the uuid parameter is a valid UUID.
    export const UuidSchema = z
      .string()
      .uuid("Invalid UUID format");
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses destructiveness and the need for confirmation. However, it fails to mention that changes may require a subsequent apply (as sibling opnsense_nat_apply exists), which is important behavioral context.

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 a single sentence plus a warning, efficiently conveying the action and key requirement. No unnecessary words, front-loaded with the verb.

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

Completeness2/5

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

The tool is simple, but the description omits whether deletion takes effect immediately or requires a separate apply step (sibling opnsense_nat_apply suggests staged changes). Also lacks information on error handling or response behavior. Incomplete for a destructive tool.

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

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 50% (only uuid has a description 'Rule UUID'). The description adds 'requires explicit confirmation' for the confirm parameter, but does not elaborate on uuid. Given the low coverage, the description should compensate more, but it adds minimal value beyond the 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 clearly states 'Delete a Source NAT rule,' which is a specific verb and resource. It distinguishes itself from sibling tools like opnsense_nat_source_add and opnsense_nat_source_get.

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 explicitly mentions 'requires explicit confirmation,' guiding the agent to use the confirm parameter. However, it does not provide context about when to use this delete tool versus other alternatives like toggling, but for a delete tool this is adequate.

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/itunified-io/mcp-opnsense'

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