Skip to main content
Glama
danielklecha

mcp-server-for-powershell

run_powershell

Execute PowerShell commands safely using structured JSON definitions to run single commands, .NET methods, pipelines, or command sequences.

Instructions

Executes PowerShell commands based on a structured JSON definition.

This tool allows you to run PowerShell commands safely strings.
It expects a JSON string that defines the command(s), parameters, pipelines, and sequences.

Args:
    json: A JSON string defining the command structure.
          Structure examples:
          1. Single Command:
             [{"command": "Get-Item", "parameters": ["."]}]

          2. .NET Static Method:
             [{"command": "[System.Math]::Sqrt", "parameters": [16]}]
             # Generates: [System.Math]::Sqrt(16)

          3. Command with Named Parameters:
             [{"command": "Get-Item", "parameters": {"-Path": "."}}]

          4. Pipeline:
             [{"command": "Get-Process", "then": {"command": "Select-Object", "parameters": ["Name"]}}]

          5. Sequence (Multiple commands):
             [{"command": "mkdir", "parameters": ["test"]}, {"command": "cd", "parameters": ["test"]}]

Returns:
    The standard output of the executed PowerShell command(s), or an error message if execution fails.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jsonYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that the tool 'allows you to run PowerShell commands safely strings' (though 'safely' is vague and potentially misleading without details). It mentions that it returns standard output or an error message on failure, which adds some behavioral context. However, it lacks details on permissions, rate limits, or specific safety mechanisms, leaving gaps for a mutation tool.

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?

The description is appropriately sized and front-loaded with the core purpose. The examples are detailed but necessary for understanding the JSON structure. It could be slightly more concise by integrating examples more tightly, but overall, each sentence adds value, and the structure is clear with sections for Args and Returns.

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?

Given the complexity of executing PowerShell commands via JSON, the description is relatively complete. It explains the parameter semantics thoroughly, mentions the return behavior, and an output schema exists (though not shown), reducing the need to detail return values. However, it lacks information on security implications or error handling specifics, which are important for such a tool.

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

Parameters5/5

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

The input schema has 0% description coverage, so the description must fully compensate. It provides extensive semantic details for the single parameter 'json', including examples of JSON structures for different command types (single command, .NET static method, named parameters, pipeline, sequence). This adds significant meaning beyond the basic schema, effectively documenting how to use the parameter.

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 clearly states the tool's purpose as 'Executes PowerShell commands based on a structured JSON definition.' It specifies the verb ('executes') and resource ('PowerShell commands'), though it doesn't need to distinguish from siblings since none exist. The description is specific about the structured JSON approach, making the purpose clear.

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?

The description implies usage by detailing the JSON structure for various command types (e.g., single command, pipeline, sequence), which suggests when to use this tool for structured PowerShell execution. However, it lacks explicit guidance on when not to use it or alternatives, and there are no siblings to compare against, so the guidance is only implied through examples.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/danielklecha/mcp-server-for-powershell'

If you have feedback or need assistance with the MCP directory API, please join our Discord server