ninja_update_device
Update device attributes including display name, location, role, policy, and organization assignment.
Instructions
Update device settings such as display name, location, role, or policy.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Device ID | |
| displayName | No | Device display name | |
| locationId | No | Location ID to assign | |
| nodeRoleId | No | Node role ID to assign | |
| policyId | No | Policy ID to assign | |
| organizationId | No | Organization ID to move device to |
Implementation Reference
- src/tools/devices.ts:69-80 (schema)Input schema for ninja_update_device tool: defines required id and optional fields for updating device settings (displayName, locationId, nodeRoleId, policyId, organizationId).
inputSchema: { type: 'object', required: ['id'], properties: { id: { type: 'number', description: 'Device ID' }, displayName: { type: 'string', description: 'Device display name' }, locationId: { type: 'number', description: 'Location ID to assign' }, nodeRoleId: { type: 'number', description: 'Node role ID to assign' }, policyId: { type: 'number', description: 'Policy ID to assign' }, organizationId: { type: 'number', description: 'Organization ID to move device to' }, }, }, - src/tools/devices.ts:82-82 (handler)Handler for ninja_update_device: extracts id from args, sends PATCH request to /device/{id} with remaining fields as the request body.
handler: async ({ id, ...body }, client: NinjaOneClient) => client.patch(`/device/${id}`, body), - src/tools/devices.ts:65-83 (registration)The tool definition and handler are registered as an element in the deviceTools array, which is exported and aggregated into ALL_TOOLS in src/tools/index.ts.
{ tool: { name: 'ninja_update_device', description: 'Update device settings such as display name, location, role, or policy.', inputSchema: { type: 'object', required: ['id'], properties: { id: { type: 'number', description: 'Device ID' }, displayName: { type: 'string', description: 'Device display name' }, locationId: { type: 'number', description: 'Location ID to assign' }, nodeRoleId: { type: 'number', description: 'Node role ID to assign' }, policyId: { type: 'number', description: 'Policy ID to assign' }, organizationId: { type: 'number', description: 'Organization ID to move device to' }, }, }, }, handler: async ({ id, ...body }, client: NinjaOneClient) => client.patch(`/device/${id}`, body), },