ninja_query_policy_overrides
Retrieve policy overrides across managed devices with optional filtering and pagination for efficient querying.
Instructions
Query policy overrides across all managed devices.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "ninja_query_policy_overrides"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| df | No | Device filter expression | |
| pageSize | No | Max results to return | |
| cursor | No | Pagination cursor |
Implementation Reference
- src/tools/policies.ts:42-44 (handler)Handler function that calls GET /queries/policy-overrides with cleaned arguments
handler: async (args, client: NinjaOneClient) => client.get('/queries/policy-overrides', clean(args)), }, - src/tools/policies.ts:33-40 (schema)Input schema defining optional parameters: df (string), pageSize (number), cursor (string)
inputSchema: { type: 'object', properties: { df: { type: 'string', description: 'Device filter expression' }, pageSize: { type: 'number', description: 'Max results to return' }, cursor: { type: 'string', description: 'Pagination cursor' }, }, }, - src/tools/policies.ts:29-53 (registration)Tool definition registered within the policyTools array, exported and aggregated into ALL_TOOLS
{ tool: { name: 'ninja_query_policy_overrides', description: 'Query policy overrides across all managed devices.', inputSchema: { type: 'object', properties: { df: { type: 'string', description: 'Device filter expression' }, pageSize: { type: 'number', description: 'Max results to return' }, cursor: { type: 'string', description: 'Pagination cursor' }, }, }, }, handler: async (args, client: NinjaOneClient) => client.get('/queries/policy-overrides', clean(args)), }, { tool: { name: 'ninja_list_node_roles', description: 'List all available device/node roles.', inputSchema: { type: 'object', properties: {} }, }, handler: async (_args, client: NinjaOneClient) => client.get('/roles'), }, ]; - src/utils.ts:2-6 (helper)Helper function that filters out null/undefined/empty values from args before passing as query params
export function clean(args: Record<string, any>): Record<string, unknown> { return Object.fromEntries( Object.entries(args).filter(([, v]) => v != null && v !== ''), ); }