get_device_processor_info
Retrieve CPU and processor details for a NinjaOne device by providing its device ID to access hardware specifications.
Instructions
Get CPU/processor information for a specific device.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device_id | Yes | NinjaOne device ID |
Implementation Reference
- src/tools/devices.ts:155-165 (handler)The handler function for get_device_processor_info tool. It takes a device_id parameter, calls the NinjaOne API endpoint `/device/${device_id}/processors`, and returns the processor information as JSON or an error message.
async ({ device_id }) => { try { const result = await client.get(`/device/${device_id}/processors`); return toolResult(JSON.stringify(result, null, 2)); } catch (error) { return toolResult( `Error fetching processor info: ${error}`, true, ); } }, - src/tools/devices.ts:152-154 (schema)Zod schema definition for the get_device_processor_info tool input. Defines a required device_id parameter as a number with description 'NinjaOne device ID'.
{ device_id: z.number().describe("NinjaOne device ID"), }, - src/tools/devices.ts:149-166 (registration)Complete tool registration for get_device_processor_info using server.tool(). Includes the tool name, description ('Get CPU/processor information for a specific device.'), input schema, and handler function.
server.tool( "get_device_processor_info", "Get CPU/processor information for a specific device.", { device_id: z.number().describe("NinjaOne device ID"), }, async ({ device_id }) => { try { const result = await client.get(`/device/${device_id}/processors`); return toolResult(JSON.stringify(result, null, 2)); } catch (error) { return toolResult( `Error fetching processor info: ${error}`, true, ); } }, ); - src/tools/devices.ts:5-7 (helper)Helper function toolResult() that formats the response content for MCP tools. Returns an object with content array containing text type, and optional isError flag for error handling.
function toolResult(text: string, isError = false) { return { content: [{ type: "text" as const, text }], isError }; }