Skip to main content
Glama

Run Device Script

ninjaone_run_device_script
Destructive

Run a script or built-in action on one device using valid NinjaOne scripting options, then verify results via device activities.

Instructions

Run a script or built-in action on one device. Get valid ids and parameters from ninjaone_get_device_scripting_options first. Needs the control scope. Never retried automatically; check the result with ninjaone_list_device_activities. Body (object) per NinjaOne runScriptOnDevice. Fields: type ("ACTION"|"SCRIPT"), id (integer), uid (string), parameters (string), runAs (string). Example: {"type": "SCRIPT", "id": 42, "parameters": "-Verbose", "runAs": "system"}. Destructive tier: needs NINJAONE_MODE=write, NINJAONE_ALLOW_DESTRUCTIVE=true and confirm: true.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "device_id": "<device_id>",
      "body": "<body>",
      "confirm": "<confirm>"
    },
    "name": "ninjaone_run_device_script"
  }
}

Input Schema

NameRequiredDescriptionDefault
bodyYesRequest body as NinjaOne documents it for runScriptOnDevice. Field names are NinjaOne's (camelCase).
confirmYesMust be exactly true. States that this call changes live data. There is no undo from this server.
device_idYesDevice id (from ninjaone_list_devices or ninjaone_search_devices).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and idempotentHint=false, but the description adds value beyond them: no automatic retry, the NINJAONE_MODE/NINJAONE_ALLOW_DESTRUCTIVE/confirm gating, the control-scope requirement, and how to confirm the outcome. Nothing here contradicts the annotations.

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

Conciseness4/5

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

Dense, front-loaded, and essentially waste-free: purpose, prerequisite, constraints, body shape, example, and gating all appear in a tight sequence. The telegraphic phrasing ("Needs the control scope") is economical but slightly terse.

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

Completeness4/5

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

For a destructive mutation with no output schema and an opaque nested body, the definition covers prerequisites, body fields, example payload, and result verification. Remaining gaps (valid runAs values, whether script output is surfaced) are minor given the pointer to the activities tool.

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?

Schema coverage is 100% for the three top-level parameters, but the body is an unconstrained object (additionalProperties: {}), so the description carries real weight by enumerating type/id/uid/parameters/runAs with a worked example. It stops short of explaining when uid is used versus id.

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?

States a specific verb+resource ("Run a script or built-in action on one device"), and the scope (single device) distinguishes it from the sibling list/patch/reboot tools. An agent can identify it immediately without opening the schema.

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

Usage Guidelines5/5

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

Gives explicit preconditions (fetch valid ids/params from ninjaone_get_device_scripting_options first, control scope required) and an explicit follow-up path (verify with ninjaone_list_device_activities), plus the gating requirements for the destructive tier. This is exactly the when/how guidance an agent needs before an irreversible call.

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

Deploy Server

Other Tools