ninja_submit_os_patch_scan
Initiate an OS patch scan on a device to refresh its pending patch list.
Instructions
Trigger an OS patch scan on a device to refresh its pending patch list.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Device ID |
Implementation Reference
- src/tools/devices.ts:422-436 (handler)The handler function for ninja_submit_os_patch_scan. It accepts { id } (device ID) and sends a POST to /device/{id}/patch/os/scan via the NinjaOne client.
{ tool: { name: 'ninja_submit_os_patch_scan', description: 'Trigger an OS patch scan on a device to refresh its pending patch list.', inputSchema: { type: 'object', required: ['id'], properties: { id: { type: 'number', description: 'Device ID' }, }, }, }, handler: async ({ id }, client: NinjaOneClient) => client.post(`/device/${id}/patch/os/scan`), }, - src/tools/devices.ts:422-436 (schema)The input schema for ninja_submit_os_patch_scan requires an 'id' (number) property representing the Device ID, with no other parameters.
{ tool: { name: 'ninja_submit_os_patch_scan', description: 'Trigger an OS patch scan on a device to refresh its pending patch list.', inputSchema: { type: 'object', required: ['id'], properties: { id: { type: 'number', description: 'Device ID' }, }, }, }, handler: async ({ id }, client: NinjaOneClient) => client.post(`/device/${id}/patch/os/scan`), }, - src/tools/devices.ts:5-5 (registration)The tool is defined as part of the deviceTools array (ToolDef[]) which is exported from src/tools/devices.ts.
export const deviceTools: ToolDef[] = [ - src/tools/index.ts:13-24 (registration)ALL_TOOLS aggregates all tool arrays including deviceTools, which contains ninja_submit_os_patch_scan, for registration with the MCP server.
export const ALL_TOOLS = [ ...deviceTools, ...organizationTools, ...alertTools, ...activityTools, ...ticketingTools, ...queryTools, ...policyTools, ...userTools, ...backupTools, ...systemTools, ]; - src/tools/types.ts:4-8 (helper)The ToolDef interface defines the shape of each tool: a 'tool' (Tool spec from MCP SDK) and a 'handler' function that takes args and a NinjaOneClient.
export interface ToolDef { tool: Tool; // eslint-disable-next-line @typescript-eslint/no-explicit-any handler: (args: any, client: NinjaOneClient) => Promise<unknown>; }