Skip to main content
Glama
itunified-io

mcp-opnsense

by itunified-io

opnsense_nat_source_get

Retrieve a specific OPNsense Source NAT rule by UUID. Returns full configuration details for read-only access.

Instructions

Get a single Source NAT rule by UUID with full configuration. Read-only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uuidYesSource NAT rule UUID

Implementation Reference

  • Handler for opnsense_nat_source_get: parses the UUID from args, then calls client.get() on the OPNsense firewall/source_nat/get_rule/{uuid} API endpoint, returning the full rule configuration as JSON.
    case "opnsense_nat_source_get": {
      const uuid = z.object({ uuid: UuidSchema }).parse(args).uuid;
      const result = await client.get(
        `/firewall/source_nat/get_rule/${encodeURIComponent(uuid)}`,
      );
      return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
    }
  • UuidSchema is imported and used to validate that the 'uuid' argument is a valid UUID string.
    export const UuidSchema = z
      .string()
      .uuid("Invalid UUID format");
  • Registration entry defining the 'opnsense_nat_source_get' tool with its name, description, and input schema (requires a uuid string).
    {
      name: "opnsense_nat_source_get",
      description: "Get a single Source NAT rule by UUID with full configuration. Read-only.",
      inputSchema: {
        type: "object" as const,
        properties: {
          uuid: { type: "string", description: "Source NAT rule UUID" },
        },
        required: ["uuid"],
      },
  • src/index.ts:70-70 (registration)
    Maps the tool name 'opnsense_nat_source_get' (and all other NAT tools) to the handleNatTool handler function in the MCP server.
    for (const def of natToolDefinitions) toolHandlers.set(def.name, handleNatTool);
  • src/index.ts:51-51 (registration)
    natToolDefinitions (which includes opnsense_nat_source_get) is spread into allToolDefinitions so it's exposed via the MCP ListTools endpoint.
    ...natToolDefinitions,
Behavior3/5

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

No annotations provided, so description bears full burden. It declares 'Read-only', which is a key behavioral trait. However, it does not disclose potential side effects, auth requirements, or rate limits. For read-only, this is acceptable but not exemplary.

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?

Single sentence, concise, front-loaded with action. No unnecessary words. Perfect for a simple tool.

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 1-parameter, no-output-schema tool, the description is complete: it tells what it does, how to identify the rule, and that it's read-only. No gaps.

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 100%, and the only parameter 'uuid' is described. The description adds 'by UUID' confirming usage but no extra constraints or formatting details. Baseline 3 is appropriate.

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 it retrieves a single Source NAT rule by UUID, distinguishing it from list, add, delete siblings. The verb 'Get' and resource 'Source NAT rule' are specific, and 'by UUID' adds precision.

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 implies when to use (need a specific rule's full config), but does not explicitly list alternatives or when not to use. For a simple retrieval 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