opnsense_vlan_delete
Delete a VLAN interface by UUID. Unassign it from a logical interface first to avoid failure.
Instructions
Delete a VLAN interface by UUID. Fails if the VLAN is still assigned to a logical interface — unassign it first via opnsense_if_assign.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uuid | Yes | UUID of the VLAN to delete |
Implementation Reference
- src/tools/vlan.ts:149-154 (handler)The handler case for opnsense_vlan_delete: parses args with VlanDeleteSchema, calls DELETE API via client.post on /interfaces/vlan_settings/delItem/{uuid}, then triggers reconfigure.
case "opnsense_vlan_delete": { const { uuid } = VlanDeleteSchema.parse(args); const result = await client.post(`/interfaces/vlan_settings/delItem/${uuid}`); await client.post("/interfaces/vlan_settings/reconfigure"); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } - src/tools/vlan.ts:26-28 (schema)VlanDeleteSchema: Zod schema validating that the input contains a 'uuid' field (UUID format).
const VlanDeleteSchema = z.object({ uuid: UuidSchema, }); - src/tools/vlan.ts:87-98 (registration)Tool definition registration for 'opnsense_vlan_delete' with its name, description, and inputSchema (requiring uuid).
{ name: "opnsense_vlan_delete", description: "Delete a VLAN interface by UUID. Fails if the VLAN is still assigned to a logical interface — unassign it first via opnsense_if_assign.", inputSchema: { type: "object" as const, properties: { uuid: { type: "string", description: "UUID of the VLAN to delete" }, }, required: ["uuid"], }, }, - src/index.ts:68-68 (registration)Registration of handleVlanTool as the handler for all vlanToolDefinitions (including opnsense_vlan_delete) in the toolHandlers map.
for (const def of vlanToolDefinitions) toolHandlers.set(def.name, handleVlanTool); - src/utils/validation.ts:3-5 (helper)UuidSchema helper used by VlanDeleteSchema to validate the uuid input.
export const UuidSchema = z .string() .uuid("Invalid UUID format");