Skip to main content
Glama

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
NameRequiredDescriptionDefault
device_idYesNinjaOne device ID

Implementation Reference

  • 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,
          );
        }
      },
    );
  • Input schema definition using Zod - validates that device_id is a required number parameter
    {
      device_id: z.number().describe("NinjaOne device ID"),
    },
  • 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,
        );
      }
    },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fredriksknese/mcp-ninjaone'

If you have feedback or need assistance with the MCP directory API, please join our Discord server