ninja_query_processors
Query CPU and processor details across all managed devices with support for device filters and pagination.
Instructions
Query CPU/processor information 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 |
Implementation Reference
- src/tools/queries.ts:159-163 (registration)The tool 'ninja_query_processors' is registered as a query tool in the queryTools array via the queryTool helper function.
queryTool( 'ninja_query_processors', 'Query CPU/processor information across all managed devices.', '/queries/processors', ), - src/tools/queries.ts:11-28 (handler)The handler for ninja_query_processors is defined by the queryTool function which creates a handler that calls client.get('/queries/processors', clean(args)).
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:1-9 (schema)The input schema for ninja_query_processors includes base pagination properties (df, pageSize, cursor) inherited from basePaginationProps.
import { NinjaOneClient } from '../client.js'; import { clean } from '../utils.js'; import { ToolDef } from './types.js'; const basePaginationProps = { df: { type: 'string', description: 'Device filter expression' }, pageSize: { type: 'number', description: 'Max results to return' }, cursor: { type: 'string', description: 'Pagination cursor from previous response' }, }; - src/tools/types.ts:4-8 (helper)The ToolDef interface defines the structure for tool definitions with a tool (name, description, inputSchema) and a handler function.
export interface ToolDef { tool: Tool; // eslint-disable-next-line @typescript-eslint/no-explicit-any handler: (args: any, client: NinjaOneClient) => Promise<unknown>; } - src/tools/index.ts:1-24 (helper)All queryTools including ninja_query_processors are aggregated into the ALL_TOOLS array for registration with the MCP server.
import { activityTools } from './activities.js'; import { alertTools } from './alerts.js'; import { backupTools } from './backup.js'; import { deviceTools } from './devices.js'; import { organizationTools } from './organizations.js'; import { policyTools } from './policies.js'; import { queryTools } from './queries.js'; import { systemTools } from './system.js'; import { ticketingTools } from './ticketing.js'; import { userTools } from './users.js'; export type { ToolDef } from './types.js'; export const ALL_TOOLS = [ ...deviceTools, ...organizationTools, ...alertTools, ...activityTools, ...ticketingTools, ...queryTools, ...policyTools, ...userTools, ...backupTools, ...systemTools, ];