Skip to main content
Glama
sandraschi

Windows Operations MCP

command_execution

Execute PowerShell or CMD commands on Windows, capture output, and monitor progress with timeout and truncation controls.

Instructions

Execute Windows commands with reliable output capture and agentic sampling.

RATIONALE: Consolidates PowerShell and CMD execution into a single async portmanteau. Uses asyncio.to_thread() to ensure the MCP event loop is never blocked. Integrates with FastMCP 3.2 Context for real-time telemetry and sampling.

PATTERNS:

  • Non-blocking: Subprocess runs in a thread pool.

  • Security: Argument validation for length (shlex not fully applicable for Windows non-shell).

  • Feedback: ctx.info and ctx.report_progress for industrial observability.

Args: action: Execution environment ("powershell" or "cmd"). command: The command string to execute. working_directory: Optional CWD for the command. timeout_seconds: Hard timeout (1-300s, default: 30). max_output_size: Truncation limit for high-volume logs. ctx: FastMCP Context for telemetry and sampling (injected).

Examples: - command_execution(action="powershell", command="Get-Service | Where-Object Status -eq 'Running'") - command_execution(action="cmd", command="dir /s /b *.log")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYes
commandYes
working_directoryNo
timeout_secondsNo
max_output_sizeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

Discloses non-blocking execution via asyncio.to_thread, argument validation, and feedback mechanisms like ctx.info and ctx.report_progress. Annotations are absent so description carries full burden, which it adequately addresses.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with headers like RATIONALE, PATTERNS, Args, Examples. However, it is somewhat verbose; the description could be tightened without losing clarity.

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 presence of an output schema (not shown but true) and the moderate complexity of 5 parameters, the description is mostly complete. Covers rationale, patterns, args, and examples. Could mention output format briefly.

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?

Describes each parameter in the Args section, including clarifications like 'execution environment' for action and 'truncation limit' for max_output_size. Schema coverage is 0% so description must compensate, and it does with sufficient detail.

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?

Clearly states it executes Windows commands with reliable output capture. Shows consolidated approach for PowerShell and CMD, distinguishing it from sibling tools like process_management which likely do not offer command execution.

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?

Provides examples of both PowerShell and CMD usage. Lacks explicit when-not-to-use guidance or comparison with alternatives for command execution, but patterns section implies non-shell execution and security considerations.

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/sandraschi/windows-operations-mcp'

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