Skip to main content
Glama
itunified-io

mcp-opnsense

by itunified-io

opnsense_vlan_create

Create an 802.1Q VLAN interface on a parent device. After creation, assign it to a logical interface and configure an IP address.

Instructions

Create a new 802.1Q VLAN interface on a parent interface. After create, run opnsense_if_assign to bind the VLAN to a logical interface (opt1, opt2, ...) and opnsense_if_configure to assign an IP.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
parent_interfaceYesParent physical interface device name (e.g. 're0', 'igb0')
vlan_tagYes802.1Q VLAN ID (1-4094)
descriptionNoHuman-readable description of the VLAN
priorityNo802.1p priority (0-7, default 0)

Implementation Reference

  • The handler function for the opnsense_vlan_create tool. Parses input via VlanCreateSchema, POSTs to /interfaces/vlan_settings/addItem with vlan payload (parent interface, tag, description, priority), then triggers reconfigure.
    case "opnsense_vlan_create": {
      const parsed = VlanCreateSchema.parse(args);
      const result = await client.post("/interfaces/vlan_settings/addItem", {
        vlan: {
          if: parsed.parent_interface,
          tag: String(parsed.vlan_tag),
          descr: parsed.description ?? "",
          pcp: String(parsed.priority ?? 0),
          vlanif: "",
        },
      });
      // Trigger reconfigure so the tagged interface becomes available
      await client.post("/interfaces/vlan_settings/reconfigure");
      return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
    }
  • Zod schema for validating vlan_create input: parent_interface (string), vlan_tag (int 1-4094), optional description and priority (0-7).
    const VlanCreateSchema = z.object({
      parent_interface: z
        .string()
        .min(1, "Parent interface is required (e.g. 're0', 'igb0')"),
      vlan_tag: z.number().int().min(1).max(4094),
      description: z.string().optional(),
      priority: z.number().int().min(0).max(7).optional(),
    });
  • Tool definition registration in the vlanToolDefinitions array with name, description, and inputSchema for the opnsense_vlan_create tool.
    {
      name: "opnsense_vlan_create",
      description:
        "Create a new 802.1Q VLAN interface on a parent interface. After create, run opnsense_if_assign to bind the VLAN to a logical interface (opt1, opt2, ...) and opnsense_if_configure to assign an IP.",
      inputSchema: {
        type: "object" as const,
        properties: {
          parent_interface: {
            type: "string",
            description: "Parent physical interface device name (e.g. 're0', 'igb0')",
          },
          vlan_tag: {
            type: "number",
            description: "802.1Q VLAN ID (1-4094)",
          },
          description: {
            type: "string",
            description: "Human-readable description of the VLAN",
          },
          priority: {
            type: "number",
            description: "802.1p priority (0-7, default 0)",
          },
        },
        required: ["parent_interface", "vlan_tag"],
      },
    },
  • src/index.ts:68-68 (registration)
    Registration of all vlan tool definitions (including opnsense_vlan_create) with the shared handleVlanTool handler in the central toolHandlers map.
    for (const def of vlanToolDefinitions) toolHandlers.set(def.name, handleVlanTool);
  • src/index.ts:35-35 (registration)
    Import of vlanToolDefinitions and handleVlanTool from the vlan.ts module into the main index.ts entry point.
    import { vlanToolDefinitions, handleVlanTool } from './tools/vlan.js';
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 states the creation action but lacks details on prerequisites, error handling, or idempotency. It does add value by noting that additional steps are required for full functionality, but more behavioral context would improve transparency.

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 extremely concise, consisting of just two sentences. The first states the purpose, and the second provides critical follow-up instructions. Every word earns its place with no redundancy.

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 creation tool without an output schema, the description is largely complete. It explains the main action and the necessary subsequent steps. However, it does not mention whether the VLAN is immediately active or if any apply action is needed, but the presence of sibling tools like opnsense_if_configure fills some 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?

The input schema has 100% description coverage, so each parameter is already well-documented. The tool description does not add new meaning beyond the schema, achieving only the baseline of 3.

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 'Create a new 802.1Q VLAN interface on a parent interface,' specifying the exact verb and resource. It distinguishes from sibling tools like opnsense_vlan_delete, opnsense_vlan_list, and opnsense_vlan_update, which perform different actions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit post-creation steps: 'After create, run opnsense_if_assign to bind the VLAN to a logical interface and opnsense_if_configure to assign an IP.' This tells the agent exactly what to do next, leaving no ambiguity.

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