get_device_os_patch_status
Check OS patch status for a device to identify pending, installed, and failed patches in NinjaOne RMM platform.
Instructions
Get the OS patch status for a specific device, showing pending, installed, and failed patches.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device_id | Yes | NinjaOne device ID |
Implementation Reference
- src/tools/devices.ts:108-126 (registration)Tool registration for 'get_device_os_patch_status' - registers the tool with the MCP server, including its name, description, input schema, and handler function
// ── Get Device OS Patch Status ─────────────────────────────────────── server.tool( "get_device_os_patch_status", "Get the OS patch status for a specific device, showing pending, installed, and failed patches.", { device_id: z.number().describe("NinjaOne device ID"), }, async ({ device_id }) => { try { const result = await client.get(`/device/${device_id}/os-patch-installs`); return toolResult(JSON.stringify(result, null, 2)); } catch (error) { return toolResult( `Error fetching OS patch status: ${error}`, true, ); } }, ); - src/tools/devices.ts:112-114 (schema)Input schema definition using Zod - validates that device_id is a required number parameter
{ device_id: z.number().describe("NinjaOne device ID"), }, - src/tools/devices.ts:115-125 (handler)Handler function that executes the tool logic - makes an HTTP GET request to /device/{device_id}/os-patch-installs endpoint and returns the OS patch status as JSON
async ({ device_id }) => { try { const result = await client.get(`/device/${device_id}/os-patch-installs`); return toolResult(JSON.stringify(result, null, 2)); } catch (error) { return toolResult( `Error fetching OS patch status: ${error}`, true, ); } },