opnsense_route_update
Modify an existing static route's destination, gateway, or disabled state. Use the route apply tool to activate updates.
Instructions
Update an existing static route. Run opnsense_route_apply afterwards to activate.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uuid | Yes | UUID of the route to update | |
| network | No | Destination network in CIDR notation | |
| gateway | No | Gateway name or UUID | |
| disabled | No | Whether the route is disabled | |
| description | No | Optional description |
Implementation Reference
- src/tools/routing.ts:213-233 (handler)Handler case for 'opnsense_route_update': parses args with UpdateRouteSchema, fetches existing route via GET /routes/routes/getroute/{uuid}, merges only provided fields, then POSTs to /routes/routes/setroute/{uuid}.
case "opnsense_route_update": { const parsed = UpdateRouteSchema.parse(args); const existing = await client.get<{ route: Record<string, unknown> }>( `/routes/routes/getroute/${parsed.uuid}`, ); const route = existing.route; const result = await client.post(`/routes/routes/setroute/${parsed.uuid}`, { route: { network: parsed.network ?? route["network"], gateway: parsed.gateway ?? route["gateway"], disabled: parsed.disabled !== undefined ? parsed.disabled ? "1" : "0" : route["disabled"], description: parsed.description ?? route["description"], }, }); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } - src/tools/routing.ts:39-45 (schema)UpdateRouteSchema: Zod object validating uuid (required UUID), optional network (CIDR), gateway (string), disabled (boolean), description (string).
const UpdateRouteSchema = z.object({ uuid: UuidSchema, network: NetworkSchema.optional(), gateway: z.string().min(1).optional(), disabled: z.boolean().optional(), description: z.string().optional(), }); - src/tools/routing.ts:109-123 (registration)Tool definition registration in routingToolDefinitions array with name 'opnsense_route_update', description, and inputSchema listing all parameters.
{ name: "opnsense_route_update", description: "Update an existing static route. Run opnsense_route_apply afterwards to activate.", inputSchema: { type: "object" as const, properties: { uuid: { type: "string", description: "UUID of the route to update" }, network: { type: "string", description: "Destination network in CIDR notation" }, gateway: { type: "string", description: "Gateway name or UUID" }, disabled: { type: "boolean", description: "Whether the route is disabled" }, description: { type: "string", description: "Optional description" }, }, required: ["uuid"], }, - src/index.ts:67-67 (registration)Tool handler registration: maps 'opnsense_route_update' (via routingToolDefinitions) to handleRoutingTool in the main toolHandlers map.
for (const def of routingToolDefinitions) toolHandlers.set(def.name, handleRoutingTool);