ninja_query_software_patches
Query pending, failed, or rejected software patches across managed devices to track update status and resolve issues.
Instructions
Query pending, failed, or rejected software patches across all managed devices.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| df | No | Device filter expression | |
| pageSize | No | Max results to return | |
| cursor | No | Pagination cursor from previous response | |
| status | No | Filter by patch status | |
| productIdentifier | No | Filter by software product identifier | |
| impact | No | Filter by impact level | |
| type | No | Filter by patch type |
Implementation Reference
- src/tools/queries.ts:11-27 (handler)The queryTool factory function generates the handler for ninja_query_software_patches. The handler calls client.get('/queries/software-patches', clean(args)), passing filtered arguments.
function queryTool( name: string, description: string, path: string, extraProps: Record<string, unknown> = {}, ): ToolDef { return { tool: { name, description, inputSchema: { type: 'object', properties: { ...basePaginationProps, ...extraProps }, }, }, handler: async (args, client: NinjaOneClient) => client.get(path, clean(args)), }; - src/tools/queries.ts:58-68 (schema)Input schema definition for ninja_query_software_patches. Defines the tool name, description ('Query pending, failed, or rejected software patches across all managed devices.'), API path '/queries/software-patches', and input properties: status, productIdentifier, impact, type plus inherited pagination props (df, pageSize, cursor).
queryTool( 'ninja_query_software_patches', 'Query pending, failed, or rejected software patches across all managed devices.', '/queries/software-patches', { status: { type: 'string', description: 'Filter by patch status' }, productIdentifier: { type: 'string', description: 'Filter by software product identifier' }, impact: { type: 'string', description: 'Filter by impact level' }, type: { type: 'string', description: 'Filter by patch type' }, }, ), - src/tools/index.ts:13-24 (registration)The tool is registered in the ALL_TOOLS array via the spread of queryTools (line 19), which is then used to build the toolMap and list tools in the MCP server (src/index.ts lines 24, 32).
export const ALL_TOOLS = [ ...deviceTools, ...organizationTools, ...alertTools, ...activityTools, ...ticketingTools, ...queryTools, ...policyTools, ...userTools, ...backupTools, ...systemTools, ]; - src/tools/queries.ts:11-27 (helper)The queryTool factory function (lines 11-28) generates both the schema and handler for all query tools, including ninja_query_software_patches. It wraps NinjaOneClient.get() with clean() argument filtering.
function queryTool( name: string, description: string, path: string, extraProps: Record<string, unknown> = {}, ): ToolDef { return { tool: { name, description, inputSchema: { type: 'object', properties: { ...basePaginationProps, ...extraProps }, }, }, handler: async (args, client: NinjaOneClient) => client.get(path, clean(args)), };