ninja_get_devices_detailed
Fetch all devices with detailed data, custom fields, and policy assignments. Use filters and pagination to control results.
Instructions
List all devices with detailed information including custom fields and policy assignments.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| df | No | Device filter expression | |
| pageSize | No | Max devices to return | |
| after | No | Last device ID for pagination cursor |
Implementation Reference
- src/tools/devices.ts:49-50 (handler)Handler function for 'ninja_get_devices_detailed' that makes a GET request to '/devices-detailed' endpoint with cleaned query parameters.
handler: async (args, client: NinjaOneClient) => client.get('/devices-detailed', clean(args)), }, - src/tools/devices.ts:40-47 (schema)Input schema definition for 'ninja_get_devices_detailed' accepting optional 'df', 'pageSize', and 'after' parameters.
inputSchema: { type: 'object', properties: { df: { type: 'string', description: 'Device filter expression' }, pageSize: { type: 'number', description: 'Max devices to return' }, after: { type: 'number', description: 'Last device ID for pagination cursor' }, }, }, - src/tools/devices.ts:36-50 (registration)Tool registration object in deviceTools array, which is exported and included in ALL_TOOLS via src/tools/index.ts.
{ tool: { name: 'ninja_get_devices_detailed', description: 'List all devices with detailed information including custom fields and policy assignments.', inputSchema: { type: 'object', properties: { df: { type: 'string', description: 'Device filter expression' }, pageSize: { type: 'number', description: 'Max devices to return' }, after: { type: 'number', description: 'Last device ID for pagination cursor' }, }, }, }, handler: async (args, client: NinjaOneClient) => client.get('/devices-detailed', clean(args)), }, - src/utils.ts:2-6 (helper)Helper utility 'clean' that filters out null/undefined/empty values from query parameter objects before sending the API request.
export function clean(args: Record<string, any>): Record<string, unknown> { return Object.fromEntries( Object.entries(args).filter(([, v]) => v != null && v !== ''), ); }