Skip to main content
Glama

ninja_list_devices

List all managed devices in NinjaOne. Apply filters by organization or status, and paginate results using page size and cursor.

Instructions

List all managed devices. Use df for device filter expressions (e.g. "org = 1", "status = APPROVED"). Paginate with pageSize and after (last device ID).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dfNoDevice filter expression
pageSizeNoMax devices to return
afterNoLast device ID for pagination cursor

Implementation Reference

  • Handler for ninja_list_devices tool. Calls GET /devices with optional query parameters (df, pageSize, after), filtering out null/empty values via the clean() utility.
    export const deviceTools: ToolDef[] = [
      {
        tool: {
          name: 'ninja_list_devices',
          description:
            'List all managed devices. Use df for device filter expressions (e.g. "org = 1", "status = APPROVED"). Paginate with pageSize and after (last device ID).',
          inputSchema: {
            type: 'object',
            properties: {
              df: { type: 'string', description: 'Device filter expression' },
              pageSize: { type: 'number', description: 'Max devices to return' },
              after: { type: 'number', description: 'Last device ID for pagination cursor' },
            },
          },
        },
        handler: async (args, client: NinjaOneClient) => client.get('/devices', clean(args)),
      },
  • Input schema for ninja_list_devices: an object with optional 'df' (string filter), 'pageSize' (number), and 'after' (number cursor for pagination) properties.
    export const deviceTools: ToolDef[] = [
      {
        tool: {
          name: 'ninja_list_devices',
          description:
            'List all managed devices. Use df for device filter expressions (e.g. "org = 1", "status = APPROVED"). Paginate with pageSize and after (last device ID).',
          inputSchema: {
            type: 'object',
            properties: {
              df: { type: 'string', description: 'Device filter expression' },
              pageSize: { type: 'number', description: 'Max devices to return' },
              after: { type: 'number', description: 'Last device ID for pagination cursor' },
            },
          },
        },
        handler: async (args, client: NinjaOneClient) => client.get('/devices', clean(args)),
      },
  • src/tools/index.ts:4-4 (registration)
    Import of deviceTools from devices.ts into the ALL_TOOLS collection, which is registered with the MCP server via toolMap.
    import { deviceTools } from './devices.js';
  • src/index.ts:24-24 (registration)
    The toolMap is built from ALL_TOOLS by mapping tool name to handler. This is where ninja_list_devices gets registered for runtime dispatch.
    const toolMap = new Map(ALL_TOOLS.map((def) => [def.tool.name, def.handler]));
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must fully disclose behavior. It states it lists devices (implying read-only), but does not mention permissions, rate limits, or output structure. For a tool with no output schema, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise: two sentences, front-loaded with the core purpose, followed by two specific usage tips. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the absence of an output schema and the large set of sibling tools, the description is incomplete. It does not differentiate from ninja_search_devices or ninja_get_devices_detailed, nor does it describe the return format (e.g., device objects).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already covers parameters with 100% description coverage. The description adds valuable examples for df expressions and clarifies that after is the last device ID for pagination, going beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists all managed devices, with optional filtering and pagination. However, it does not explicitly differentiate from similar siblings like ninja_search_devices or ninja_get_devices_detailed.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains how to use the df parameter with examples and how to paginate using pageSize and after. But it lacks guidance on when to use this tool versus alternatives, which are numerous among the siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/Allied-Business-Solutions/ninjaone-mcp'

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