Skip to main content
Glama

Run command on VPS

vps_exec
Destructive

Execute a one-shot SSH command on a VPS and return { stdout, stderr, exitCode }.

Use timeoutSeconds (default 30, max 300) for the per-command timeout.

For long-running commands (>300s) such as apt full-upgrade, large rsync, or package builds, do NOT block the call. Instead launch the work in the background and poll a log file:

vps_exec(id, "nohup bash -c 'apt-get update && apt-get full-upgrade -y' >/root/job.log 2>&1 & echo $! > /root/job.pid; echo started")

then poll:

vps_exec(id, "if kill -0 $(cat /root/job.pid) 2>/dev/null; then echo RUNNING; tail -20 /root/job.log; else echo DONE; tail -50 /root/job.log; fi")

stdout and stderr are limited to 256 KB each, keeping the start and the end; the response includes truncated: true if so.

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": {
      "id": "<id>",
      "command": "<command>"
    },
    "name": "vps_exec"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesThe VPS ID
commandYesThe shell command to execute
timeoutNoDEPRECATED: use `timeoutSeconds`. Same semantics (seconds).
timeoutSecondsNoPer-command timeout in seconds. Default 30, max 300. For longer work, use the nohup+log-polling pattern from the tool description.

Schema Changelog

Changes observed during successful MCP inspections.

No schema history has been recorded yet.

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, and the description adds substantial context beyond them: the exact return keys, the 256 KB per-stream truncation limit that keeps head and tail, and the `truncated: true` flag. It also supplies a full background-launch and log-polling recipe, which is precisely the behavioral guidance an agent needs to avoid a blocked timeout on destructive long-running work.

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?

Front-loaded with purpose and return shape, then timeout semantics, then the escape hatch for long jobs. The embedded code block is long but each line demonstrates a distinct step of the pattern, so it earns its space; the multiple `vps_exec` examples could be trimmed slightly.

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?

For a destructive 4-parameter tool with no output schema, the description covers return fields, truncation behavior, timeout bounds, and the long-running-work strategy, while annotations carry the safety profile. An agent has everything needed to invoke it correctly and safely.

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%, so the baseline would be 3, but the description adds meaning the schema cannot: how to work around the 300s ceiling on `timeoutSeconds` via nohup plus log polling. It does not cover the deprecated `timeout` alias, but the schema handles that well enough.

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 opens with a specific verb and resource: "Execute a one-shot SSH command on a VPS", and it names the exact response shape `{ stdout, stderr, exitCode }`. The VPS scoping implicitly separates it from the `webspace_exec` sibling, but it never explicitly contrasts the two, so it falls just short of a full 5.

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

Usage Guidelines4/5

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

It gives concrete when-to-use and when-NOT-to-use guidance: blocking calls are fine under 300s, but long jobs like `apt full-upgrade` or large rsync must be backgrounded. It also flags the deprecated `timeout` parameter in favor of `timeoutSeconds`. It doesn't route the agent to sibling alternatives such as `vps_read_file` for simple reads, leaving one gap.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.