ninja_get_group_device_ids
Retrieve the IDs of all devices within a specified group for efficient device management and querying.
Instructions
Get the IDs of all devices in a specific group.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Group ID |
Implementation Reference
- src/tools/system.ts:14-28 (handler)The handler function that executes 'ninja_get_group_device_ids' logic — calls GET /group/{id}/device-ids via the NinjaOneClient.
{ tool: { name: 'ninja_get_group_device_ids', description: 'Get the IDs of all devices in a specific group.', inputSchema: { type: 'object', required: ['id'], properties: { id: { type: 'number', description: 'Group ID' }, }, }, }, handler: async ({ id }, client: NinjaOneClient) => client.get(`/group/${id}/device-ids`), }, - src/tools/system.ts:14-28 (schema)Input schema for the tool: requires a numeric 'id' (group ID).
{ tool: { name: 'ninja_get_group_device_ids', description: 'Get the IDs of all devices in a specific group.', inputSchema: { type: 'object', required: ['id'], properties: { id: { type: 'number', description: 'Group ID' }, }, }, }, handler: async ({ id }, client: NinjaOneClient) => client.get(`/group/${id}/device-ids`), }, - src/tools/system.ts:14-28 (registration)The tool 'ninja_get_group_device_ids' is registered as part of the systemTools array in src/tools/system.ts.
{ tool: { name: 'ninja_get_group_device_ids', description: 'Get the IDs of all devices in a specific group.', inputSchema: { type: 'object', required: ['id'], properties: { id: { type: 'number', description: 'Group ID' }, }, }, }, handler: async ({ id }, client: NinjaOneClient) => client.get(`/group/${id}/device-ids`), }, - src/tools/index.ts:1-24 (registration)systemTools (including ninja_get_group_device_ids) are re-exported via ALL_TOOLS array.
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, ]; - src/index.ts:24-24 (registration)All tools including ninja_get_group_device_ids are registered into a Map by name for lookup in the MCP server request handler.
const toolMap = new Map(ALL_TOOLS.map((def) => [def.tool.name, def.handler]));