Skip to main content
Glama

Run command on a device

mesh_run_command
Destructive

Runs shell commands on a MeshCentral-managed device through its agent and returns the output; commands must be enabled and may execute with root/SYSTEM privileges.

Instructions

Run a shell command through the MeshCentral agent and return its output. Needs MESH_MCP_ALLOW_COMMANDS=1. The agent usually runs as root/SYSTEM, so treat this as full control of the machine.

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": "<device>",
      "command": "<command>"
    },
    "name": "mesh_run_command"
  }
}

Input Schema

NameRequiredDescriptionDefault
deviceYes
commandYes
powershellNoWindows only: run in PowerShell
run_as_userNoTry to run as the logged-in user
timeout_secondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and openWorldHint=true, so the risk class is known. The description adds context annotations cannot express: the feature must be enabled via an environment variable, the agent typically runs as root/SYSTEM, and the call returns command output. It omits timeout enforcement and output size limits.

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?

Three short sentences, front-loaded with the action, then the prerequisite, then the risk. Every sentence carries information an agent needs before calling.

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?

No output schema exists, and the description does state that output is returned and characterizes the privilege context. What is missing is timeout semantics (max 300s) and how failures/truncated output surface, which matters for a remote shell tool.

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

Parameters2/5

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

Schema description coverage is only 40% and the description explains none of the five parameters – not device, command, timeout_seconds, nor the PowerShell/run-as-user flags. With this coverage gap, the description needed to compensate and does not.

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?

States a specific verb and resource: run a shell command through the MeshCentral agent and return its output. That is clearly distinct from the sibling tools (device info, message, toast, power, reboot), though no sibling is named as an alternative.

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?

Gives a hard prerequisite (MESH_MCP_ALLOW_COMMANDS=1) and a strong warning about privilege level, but never says when to prefer this over mesh_device_message or a reboot tool, and no when-not-to-use guidance beyond the implicit danger.

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