ninja_get_device_installed_software_patches
Get the installed software patch history for a device, filtering by install status or date range.
Instructions
Get software patch install history for a device.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Device ID | |
| status | No | Filter by install status | |
| installedBefore | No | Filter patches installed before this date | |
| installedAfter | No | Filter patches installed after this date |
Implementation Reference
- src/tools/devices.ts:203-204 (handler)The handler function that executes the tool logic. Makes a GET request to /device/{id}/software-patch-installs with cleaned params.
handler: async ({ id, ...params }, client: NinjaOneClient) => client.get(`/device/${id}/software-patch-installs`, clean(params)), - src/tools/devices.ts:192-201 (schema)Input schema definition for the tool. Requires 'id' (number) and accepts optional filters: status, installedBefore, installedAfter.
inputSchema: { type: 'object', required: ['id'], properties: { id: { type: 'number', description: 'Device ID' }, status: { type: 'string', description: 'Filter by install status' }, installedBefore: { type: 'string', description: 'Filter patches installed before this date' }, installedAfter: { type: 'string', description: 'Filter patches installed after this date' }, }, }, - src/tools/devices.ts:188-205 (registration)The tool registration within the deviceTools array. Defines the tool name 'ninja_get_device_installed_software_patches' and its full metadata.
{ tool: { name: 'ninja_get_device_installed_software_patches', description: 'Get software patch install history for a device.', inputSchema: { type: 'object', required: ['id'], properties: { id: { type: 'number', description: 'Device ID' }, status: { type: 'string', description: 'Filter by install status' }, installedBefore: { type: 'string', description: 'Filter patches installed before this date' }, installedAfter: { type: 'string', description: 'Filter patches installed after this date' }, }, }, }, handler: async ({ id, ...params }, client: NinjaOneClient) => client.get(`/device/${id}/software-patch-installs`, clean(params)), }, - src/tools/index.ts:13-24 (registration)The deviceTools array is spread into ALL_TOOLS, which is used by the MCP server to register all tools.
export const ALL_TOOLS = [ ...deviceTools, ...organizationTools, ...alertTools, ...activityTools, ...ticketingTools, ...queryTools, ...policyTools, ...userTools, ...backupTools, ...systemTools, ]; - src/tools/types.ts:4-8 (helper)The ToolDef interface that defines the structure of each tool (tool metadata + handler function).
export interface ToolDef { tool: Tool; // eslint-disable-next-line @typescript-eslint/no-explicit-any handler: (args: any, client: NinjaOneClient) => Promise<unknown>; }