Skip to main content
Glama
itunified-io

mcp-opnsense

by itunified-io

opnsense_vlan_update

Update an existing VLAN interface by specifying its UUID and only modifying the fields provided, such as parent interface, VLAN tag, description, or priority.

Instructions

Update an existing VLAN interface by UUID. Only provided fields are changed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uuidYesUUID of the VLAN to update
parent_interfaceNoParent physical interface device name
vlan_tagNo802.1Q VLAN ID (1-4094)
descriptionNoDescription
priorityNo802.1p priority (0-7)

Implementation Reference

  • The handler for the 'opnsense_vlan_update' tool. It parses input via VlanUpdateSchema, builds a payload with only the fields provided, sends a POST to /interfaces/vlan_settings/setItem/{uuid}, then triggers reconfigure on the VLAN settings endpoint.
    case "opnsense_vlan_update": {
      const parsed = VlanUpdateSchema.parse(args);
      const payload: Record<string, string> = {};
      if (parsed.parent_interface !== undefined) payload["if"] = parsed.parent_interface;
      if (parsed.vlan_tag !== undefined) payload["tag"] = String(parsed.vlan_tag);
      if (parsed.description !== undefined) payload["descr"] = parsed.description;
      if (parsed.priority !== undefined) payload["pcp"] = String(parsed.priority);
    
      const result = await client.post(
        `/interfaces/vlan_settings/setItem/${parsed.uuid}`,
        { vlan: payload },
      );
      await client.post("/interfaces/vlan_settings/reconfigure");
      return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
    }
  • Zod validation schema for the vlan_update tool input. Validates uuid (required), and optional fields: parent_interface, vlan_tag (1-4094), description, priority (0-7).
    const VlanUpdateSchema = z.object({
      uuid: UuidSchema,
      parent_interface: z.string().min(1).optional(),
      vlan_tag: z.number().int().min(1).max(4094).optional(),
      description: z.string().optional(),
      priority: z.number().int().min(0).max(7).optional(),
    });
  • Tool definition/registration for 'opnsense_vlan_update' in the vlanToolDefinitions array. Defines name, description, and inputSchema (JSON Schema format) with uuid as required and all other fields optional.
    name: "opnsense_vlan_update",
    description:
      "Update an existing VLAN interface by UUID. Only provided fields are changed.",
    inputSchema: {
      type: "object" as const,
      properties: {
        uuid: { type: "string", description: "UUID of the VLAN to update" },
        parent_interface: {
          type: "string",
          description: "Parent physical interface device name",
        },
        vlan_tag: { type: "number", description: "802.1Q VLAN ID (1-4094)" },
        description: { type: "string", description: "Description" },
        priority: { type: "number", description: "802.1p priority (0-7)" },
      },
      required: ["uuid"],
    },
  • src/index.ts:35-35 (registration)
    Import of vlanToolDefinitions and handleVlanTool from the vlan module.
    import { vlanToolDefinitions, handleVlanTool } from './tools/vlan.js';
  • src/index.ts:49-49 (registration)
    vlanToolDefinitions spread into allToolDefinitions, which is returned by ListToolsRequestSchema handler.
    ...vlanToolDefinitions,
  • src/index.ts:68-68 (registration)
    Registration of handleVlanTool as the handler for all vlan tools in the toolHandlers map.
    for (const def of vlanToolDefinitions) toolHandlers.set(def.name, handleVlanTool);
Behavior2/5

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

No annotations exist, so the description should provide behavioral context. It only states 'Update' and partial updates, missing details on authorization, side effects, or reversibility.

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?

Two concise sentences with no unnecessary words. Front-loaded with the action and resource.

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

Completeness3/5

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

The tool has 5 parameters and no output schema. The description covers the core operation but lacks details on return values, errors, or prerequisites, leaving 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?

Schema description coverage is 100%, so the baseline is 3. The description adds no additional parameter meaning 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 the action ('Update'), the resource ('VLAN interface'), and the identifier ('by UUID'). It distinguishes from sibling tools like opnsense_vlan_create and opnsense_vlan_list.

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 description indicates partial updates ('Only provided fields are changed'), but no explicit guidance on when to use vs alternatives or prerequisites.

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