opnsense_route_delete
Delete a static route from the routing table. Apply changes with opnsense_route_apply to activate.
Instructions
Delete a static route. Run opnsense_route_apply afterwards to activate.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uuid | Yes | UUID of the route to delete |
Implementation Reference
- src/tools/routing.ts:235-238 (handler)Handler for opnsense_route_delete: parses args with DeleteRouteSchema (expects UUID), then calls POST /routes/routes/delroute/{uuid} to delete the static route.
case "opnsense_route_delete": { const { uuid } = DeleteRouteSchema.parse(args); const result = await client.post(`/routes/routes/delroute/${uuid}`); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; - src/tools/routing.ts:47-49 (schema)DeleteRouteSchema: Zod schema validating that the input contains a 'uuid' field matching the UUID format.
const DeleteRouteSchema = z.object({ uuid: UuidSchema, }); - src/tools/routing.ts:125-136 (registration)Tool definition registration for 'opnsense_route_delete' - defines name, description, and input schema (uuid required).
{ name: "opnsense_route_delete", description: "Delete a static route. Run opnsense_route_apply afterwards to activate.", inputSchema: { type: "object" as const, properties: { uuid: { type: "string", description: "UUID of the route to delete" }, }, required: ["uuid"], }, }, - src/index.ts:67-67 (registration)Binding the routing tool definitions (including opnsense_route_delete) to the handleRoutingTool handler in the central toolHandlers map.
for (const def of routingToolDefinitions) toolHandlers.set(def.name, handleRoutingTool); - src/utils/validation.ts:3-5 (helper)UuidSchema helper used by DeleteRouteSchema to validate the UUID input parameter.
export const UuidSchema = z .string() .uuid("Invalid UUID format");