opnsense_firmware_remove
Remove an installed OPNsense plugin package. Requires explicit confirmation to prevent accidental removal.
Instructions
Remove an installed OPNsense plugin package. DESTRUCTIVE: requires explicit confirmation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| package | Yes | Plugin package name to remove | |
| confirm | Yes | Must be true to confirm the removal |
Implementation Reference
- src/tools/firmware.ts:176-180 (handler)Handler case for opnsense_firmware_remove: parses args with RemovePackageSchema and calls POST /core/firmware/remove/{package}
case "opnsense_firmware_remove": { const parsed = RemovePackageSchema.parse(args); const result = await client.post("/core/firmware/remove/" + encodeURIComponent(parsed.package)); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } - src/tools/firmware.ts:20-23 (schema)Zod schema RemovePackageSchema validating that package (string) and confirm (literal true) are provided
const RemovePackageSchema = z.object({ package: z.string().min(1, "Package name is required"), confirm: ConfirmTrue("confirm must be true to proceed with package removal"), }); - src/tools/firmware.ts:77-96 (registration)Tool definition registration: declares opnsense_firmware_remove with description, input schema (package + confirm boolean)
{ name: "opnsense_firmware_remove", description: "Remove an installed OPNsense plugin package. DESTRUCTIVE: requires explicit confirmation.", inputSchema: { type: "object" as const, properties: { package: { type: "string", description: "Plugin package name to remove", }, confirm: { type: "boolean", description: "Must be true to confirm the removal", enum: [true], }, }, required: ["package", "confirm"], }, }, - src/index.ts:66-66 (registration)All firmware tool definitions (including opnsense_firmware_remove) are mapped to handleFirmwareTool handler in the main tool handler map
for (const def of firmwareToolDefinitions) toolHandlers.set(def.name, handleFirmwareTool); - src/tools/firmware.ts:14-18 (helper)ConfirmTrue helper: pre-processes boolean strings to coerce 'true' string to true boolean before literal validation
const ConfirmTrue = (msg: string) => z.preprocess( (v) => (v === "true" ? true : v === "false" ? false : v), z.literal(true, { errorMap: () => ({ message: msg }) }), );