Skip to main content
Glama

ninja_approve_devices

Approve or reject pending devices in bulk using device IDs to manage device approval workflows.

Instructions

Approve or reject devices that are pending approval.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeYesApproval action to take
deviceIdsYesDevice IDs to approve or reject

Implementation Reference

  • The handler function that executes the tool logic. It accepts mode ('APPROVE' or 'REJECT') and deviceIds, then makes a POST request to /devices/approval/{mode} with the device IDs.
    handler: async ({ mode, deviceIds }, client: NinjaOneClient) =>
      client.post(`/devices/approval/${mode}`, { devices: deviceIds }),
  • Input schema for the tool, requiring 'mode' (string enum APPROVE/REJECT) and 'deviceIds' (array of numbers).
    inputSchema: {
      type: 'object',
      required: ['mode', 'deviceIds'],
      properties: {
        mode: {
          type: 'string',
          enum: ['APPROVE', 'REJECT'],
          description: 'Approval action to take',
        },
        deviceIds: {
          type: 'array',
          items: { type: 'number' },
          description: 'Device IDs to approve or reject',
        },
      },
    },
  • Tool is registered as part of the deviceTools array in src/tools/devices.ts, which is re-exported via src/tools/index.ts and used in src/index.ts to build the tool map and list available tools.
    {
      tool: {
        name: 'ninja_approve_devices',
        description: 'Approve or reject devices that are pending approval.',
        inputSchema: {
          type: 'object',
          required: ['mode', 'deviceIds'],
          properties: {
            mode: {
              type: 'string',
              enum: ['APPROVE', 'REJECT'],
              description: 'Approval action to take',
            },
            deviceIds: {
              type: 'array',
              items: { type: 'number' },
              description: 'Device IDs to approve or reject',
            },
          },
        },
      },
      handler: async ({ mode, deviceIds }, client: NinjaOneClient) =>
        client.post(`/devices/approval/${mode}`, { devices: deviceIds }),
    },
  • src/index.ts:24-24 (registration)
    The tool handler is dynamically registered into a Map at server startup by mapping ALL_TOOLS by name.
    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 provided; the description does not disclose behavioral traits such as permissions required, side effects, or whether the action is reversible.

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 a single sentence that is efficient and to the point, front-loading the verb and resource.

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?

The description lacks any mention of what the tool returns (e.g., success/failure) or the effect of the operation, which is important for a write action without an output schema.

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 has 100% description coverage, but the tool description adds the meaningful context that devices must be 'pending approval', which is not in the parameter descriptions.

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

Purpose5/5

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

The description clearly states the verb (approve or reject) and resource (devices pending approval), distinguishing it from other device tools like get, list, or update.

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 implies usage for pending devices but offers no explicit guidance on when to use this tool versus alternatives like ninja_update_device, and no when-not-to-use advice.

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