ninja_get_backup_jobs
Retrieve backup job history and status across managed devices using device filters and pagination.
Instructions
Get backup job history and status across 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/backup.ts:19-20 (handler)The handler function that executes the tool logic. It calls client.get('/backup/jobs', clean(args)) to fetch backup job data.
handler: async (args, client: NinjaOneClient) => client.get('/backup/jobs', clean(args)), - src/tools/backup.ts:10-17 (schema)Input schema definition for the tool, specifying three optional properties: df (string), pageSize (number), and 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 from previous response' }, }, }, - src/tools/backup.ts:5-21 (registration)The tool is defined as an entry in the backupTools array (line 5-21) with the name 'ninja_get_backup_jobs'. This array is then exported and spread into ALL_TOOLS in src/tools/index.ts (line 22).
export const backupTools: ToolDef[] = [ { tool: { name: 'ninja_get_backup_jobs', description: 'Get backup job history and status across 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 from previous response' }, }, }, }, handler: async (args, client: NinjaOneClient) => client.get('/backup/jobs', clean(args)), }, - src/tools/index.ts:22-24 (registration)The backupTools array (containing this tool) is imported and spread into the ALL_TOOLS central registry.
...backupTools, ...systemTools, ]; - src/tools/backup.ts:2-2 (helper)The 'clean' utility is imported from '../utils.js' and used in the handler to remove undefined/null properties from args before sending the request.
import { clean } from '../utils.js';