Skip to main content
Glama

Run a User Script

user_script_run
Destructive

Run a saved Unraid User Scripts script over SSH with required confirmation and risk acknowledgment, then return its exit code, stdout, and stderr.

Instructions

⚠ Runs one User Scripts plugin script by name over SSH — user scripts are arbitrary code, executed here as the SSH user (typically root). Requires confirm: true AND acknowledge_risk: true. The flash drive is mounted non-executable, so the script is copied to a temp file (CRs stripped) and run via bash, exactly like the plugin's own runner. Get names from user_script_list; a non-zero exit is reported faithfully, not as a tool error. Waits for the script to finish and returns its exit code, stdout, and stderr. For a one-off command that is not a saved script use shell_exec instead.

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": {
      "name": "<name>"
    },
    "name": "user_script_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesScript name exactly as returned by user_script_list (its folder name).
confirmNoSet `true` only after the user approves this specific change; otherwise the tool refuses or prompts them.
response_formatNo`detailed` returns full JSON instead of readable text.concise
timeout_secondsNoSeconds to wait for the script; on timeout the call fails but the script may keep running on the host.
acknowledge_riskNoSet `true` only after the user accepts running arbitrary code as the SSH user; needed on every call.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.1.3
    • addedInput schema / properties / acknowledge_risk / description
      Added value: +"Set `true` only after the user accepts running arbitrary code as the SSH user; needed on every call."
    • addedInput schema / properties / confirm / description
      Added value: +"Set `true` only after the user approves this specific change; otherwise the tool refuses or prompts them."
    • addedInput schema / properties / name / description
      Added value: +"Script name exactly as returned by user_script_list (its folder name)."
    • addedInput schema / properties / response_format / description
      Added value: +"`detailed` returns full JSON instead of readable text."
    • addedInput schema / properties / timeout_seconds / description
      Added value: +"Seconds to wait for the script; on timeout the call fails but the script may keep running on the host."
  2. First observedv0.1.1

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the annotations (destructive, openWorld, non-idempotent) by disclosing that arbitrary code runs as the SSH user, typically root, and explaining the temp-file/bash execution path forced by the non-executable mount. It also clarifies a subtle contract: a non-zero exit is reported faithfully rather than surfaced as a tool error, and it waits for completion returning exit code, stdout, and stderr.

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?

Front-loads the risk warning, then the gating requirements, then execution mechanics, then the alternative. Five dense sentences with no filler; even the parenthetical about CR stripping and the plugin's own runner carries decision-relevant meaning.

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

Completeness5/5

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

With no output schema, the description still describes the return payload (exit code, stdout, stderr) and the exit-code-vs-tool-error distinction. For a destructive, arbitrary-code-execution tool, the risk profile, preconditions, and timeout caveat are all covered.

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

Parameters3/5

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

Schema description coverage is 100%, so all five parameters including the response_format enum and timeout bounds are already documented. The description reinforces the dual-confirmation requirement and the name source, but adds no syntax or format detail beyond what the schema states. Baseline 3 applies when the schema carries the parameter burden.

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 and resource — runs one User Scripts plugin script by name over SSH — and immediately distinguishes it from user_script_list (name discovery) and shell_exec (one-off commands). An agent can pick the right tool without opening any 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 routing: get names from user_script_list, and use shell_exec instead when the command is not a saved script. It also states the two preconditions (confirm and acknowledge_risk) that gate invocation, leaving no inference needed.

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