opnsense_firmware_install
Install an OPNsense plugin package by specifying its name, such as 'os-acme-client' or 'os-haproxy'. May require a service restart.
Instructions
Install an OPNsense plugin package by name (e.g. 'os-acme-client'). May require a service restart.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| package | Yes | Plugin package name (e.g. 'os-acme-client', 'os-haproxy') |
Implementation Reference
- src/tools/firmware.ts:170-174 (handler)Handler case for opnsense_firmware_install: validates args with PackageSchema, then POSTs to /core/firmware/install/{package} via OPNsenseClient.
case "opnsense_firmware_install": { const parsed = PackageSchema.parse(args); const result = await client.post("/core/firmware/install/" + encodeURIComponent(parsed.package)); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } - src/tools/firmware.ts:8-10 (schema)Zod schema validating that the 'package' argument is a non-empty string.
const PackageSchema = z.object({ package: z.string().min(1, "Package name is required"), }); - src/tools/firmware.ts:62-76 (registration)Tool definition registration in firmwareToolDefinitions array, listing name, description, and inputSchema.
{ name: "opnsense_firmware_install", description: "Install an OPNsense plugin package by name (e.g. 'os-acme-client'). May require a service restart.", inputSchema: { type: "object" as const, properties: { package: { type: "string", description: "Plugin package name (e.g. 'os-acme-client', 'os-haproxy')", }, }, required: ["package"], }, }, - src/index.ts:66-66 (registration)Maps the firmware tool name to the handleFirmwareTool handler function in the central toolHandlers map.
for (const def of firmwareToolDefinitions) toolHandlers.set(def.name, handleFirmwareTool); - src/client/opnsense-client.ts:49-58 (helper)OPNsenseClient.post helper used to make the HTTP POST request to the OPNsense firmware install API endpoint.
async post<T>(path: string, data?: unknown): Promise<T> { try { const response = await this.http.post<T>(path, data ?? {}, { headers: { "Content-Type": "application/json" }, }); return response.data; } catch (error: unknown) { throw extractError(error, `POST ${path}`); } }