ninja_get_device_software_patches
Retrieve pending, failed, or rejected software patches for a specific device using its ID. Optionally filter by status, product, type, or impact.
Instructions
Get pending, failed, or rejected software patches for a device.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Device ID | |
| status | No | Filter by status | |
| productIdentifier | No | Filter by software product identifier | |
| type | No | Filter by patch type | |
| impact | No | Filter by impact level |
Implementation Reference
- src/tools/devices.ts:169-187 (handler)Tool definition and handler for ninja_get_device_software_patches. The handler extracts the 'id' from arguments (destructured as {id,...params}) and calls client.get with the path `/device/${id}/software-patches` after cleaning null/empty params.
{ tool: { name: 'ninja_get_device_software_patches', description: 'Get pending, failed, or rejected software patches for a device.', inputSchema: { type: 'object', required: ['id'], properties: { id: { type: 'number', description: 'Device ID' }, status: { type: 'string', description: 'Filter by status' }, productIdentifier: { type: 'string', description: 'Filter by software product identifier' }, type: { type: 'string', description: 'Filter by patch type' }, impact: { type: 'string', description: 'Filter by impact level' }, }, }, }, handler: async ({ id, ...params }, client: NinjaOneClient) => client.get(`/device/${id}/software-patches`, clean(params)), }, - src/tools/devices.ts:173-183 (schema)Input schema for ninja_get_device_software_patches. Requires 'id' (number). Optional filters: status, productIdentifier, type, impact (all strings).
inputSchema: { type: 'object', required: ['id'], properties: { id: { type: 'number', description: 'Device ID' }, status: { type: 'string', description: 'Filter by status' }, productIdentifier: { type: 'string', description: 'Filter by software product identifier' }, type: { type: 'string', description: 'Filter by patch type' }, impact: { type: 'string', description: 'Filter by impact level' }, }, }, - src/tools/index.ts:13-24 (registration)The tool is registered as part of deviceTools (exported from devices.ts) which is spread into ALL_TOOLS array for registration with MCP.
export const ALL_TOOLS = [ ...deviceTools, ...organizationTools, ...alertTools, ...activityTools, ...ticketingTools, ...queryTools, ...policyTools, ...userTools, ...backupTools, ...systemTools, ]; - src/tools/devices.ts:5-5 (registration)deviceTools is exported as an array of ToolDef objects. The ninja_get_device_software_patches tool is one of the entries in this array.
export const deviceTools: ToolDef[] = [ - src/utils.ts:1-6 (helper)The 'clean' utility function used by the handler. It filters out null/empty values from the params object before passing them as query parameters.
// eslint-disable-next-line @typescript-eslint/no-explicit-any export function clean(args: Record<string, any>): Record<string, unknown> { return Object.fromEntries( Object.entries(args).filter(([, v]) => v != null && v !== ''), ); }