Skip to main content
Glama

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
NameRequiredDescriptionDefault
device_idYesNinjaOne device ID

Implementation Reference

  • 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,
        );
      }
    },
  • 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"),
    },
  • 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,
          );
        }
      },
    );
  • 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 };
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fredriksknese/mcp-ninjaone'

If you have feedback or need assistance with the MCP directory API, please join our Discord server