ninja_get_device_network_interfaces
Get network interface details (IP addresses, MAC addresses, adapter type) for a device by providing its ID.
Instructions
Get network interface information for a device (IP addresses, MAC addresses, adapter type).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Device ID |
Implementation Reference
- src/tools/devices.ts:246-246 (handler)The handler function that executes the tool logic - makes a GET request to /device/{id}/network-interfaces
handler: async ({ id }, client: NinjaOneClient) => client.get(`/device/${id}/network-interfaces`), - src/tools/devices.ts:234-245 (schema)Tool definition with schema - defines the tool name, description, and input validation schema requiring a device ID
{ tool: { name: 'ninja_get_device_network_interfaces', description: 'Get network interface information for a device (IP addresses, MAC addresses, adapter type).', inputSchema: { type: 'object', required: ['id'], properties: { id: { type: 'number', description: 'Device ID' }, }, }, }, - src/tools/index.ts:13-24 (registration)Registration of all tool definitions including deviceTools which contains the network interfaces tool
export const ALL_TOOLS = [ ...deviceTools, ...organizationTools, ...alertTools, ...activityTools, ...ticketingTools, ...queryTools, ...policyTools, ...userTools, ...backupTools, ...systemTools, ]; - src/index.ts:24-33 (registration)MCP server registration - builds a tool map from ALL_TOOLS and registers ListToolsRequestSchema and CallToolRequestSchema handlers
const toolMap = new Map(ALL_TOOLS.map((def) => [def.tool.name, def.handler])); const server = new Server( { name: 'ninjaone-mcp', version: '1.0.0' }, { capabilities: { tools: {} } }, ); server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: ALL_TOOLS.map((def) => def.tool), })); - src/tools/types.ts:4-8 (helper)ToolDef interface used to type the tool definition objects, ensuring each tool has a 'tool' schema and a 'handler' function
export interface ToolDef { tool: Tool; // eslint-disable-next-line @typescript-eslint/no-explicit-any handler: (args: any, client: NinjaOneClient) => Promise<unknown>; }