Skip to main content
Glama
PowerShell MCP

PowerShell MCP

by water-chika

powershell_run

Execute bounded PowerShell scripts on local or registered SSH targets, enforcing output limits and timeouts for controlled remote administration.

Instructions

Run bounded PowerShell on target='local' or target='ssh:'.

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": {
      "target": "<target>",
      "script": "<script>"
    },
    "name": "powershell_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
filterNoOptional case-insensitive .NET regular expression with a 100 ms match timeout.
scriptYesPowerShell script executed with the selected target account's authority.
targetYesExplicit target: 'local' or a registered 'ssh:<alias>'.
max_bytesNoMaximum UTF-8 command output bytes; excludes the short terminal status decoration.
max_linesNoMaximum output lines; 0 disables only the line limit and remains byte-bounded.
timeout_secondsNoExecution timeout in seconds.
include_raw_recordsNoInclude low-level protocol records for diagnostics; may expose sensitive output details.

Output Schema

NameRequiredDescriptionDefault
okNo
hostNo
outputYes
failureNo
messageNo
partialNo
recordsNo
exit_codeNo
emitted_bytesNo
emitted_linesNo
observed_bytesNo
observed_linesNo
output_completeNo
timeout_secondsNo
transport_exit_codeNo
byte_suppressed_bytesNo
byte_suppressed_linesNo
line_suppressed_bytesNo
line_suppressed_linesNo
filter_suppressed_bytesNo
filter_suppressed_linesNo
cancellation_unconfirmedNo
diagnostic_suppressed_bytesNo
diagnostic_suppressed_linesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full disclosure burden, yet it only hints at limits via the word 'bounded'. It does not say the script executes with the target account's authority, that commands can mutate the host, or what the output limits mean in practice.

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?

A single front-loaded sentence with zero filler, which is efficient. The trade-off is that 'bounded' is left unexplained, so brevity comes at some cost to clarity.

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?

For a tool that executes arbitrary PowerShell with seven parameters, a one-line description is thin: it omits security/side-effect context and alias-discovery guidance. The output schema relieves it of explaining return values, but the behavioral gaps remain significant.

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 the seven parameters are already well documented in the schema. The description restates the target pattern but adds no meaning beyond it, making the baseline 3 appropriate.

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 gives a specific verb (Run) and resource (PowerShell) plus the execution scope ('bounded') and valid target forms ('local' or 'ssh:<registered-alias>'). It is distinguishable from the status/list siblings, though it doesn't explicitly name them.

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

Usage Guidelines2/5

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

It states valid target values but gives no when-to-use guidance, no prerequisites, and no direction to siblings such as list_powershell_targets for discovering registered aliases. An agent must infer when this is the right tool versus powershell_status.

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