Skip to main content
Glama
eva-wanxin-git

Windows Automation MCP Server

run_cmd

Execute CMD commands to automate Windows system tasks through the Windows Automation MCP Server.

Instructions

执行 CMD 命令

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYesCMD 命令
timeoutNo超时时间(毫秒,可选)

Implementation Reference

  • The handler function that executes the CMD command using Node.js child_process.execAsync (promisified) with cmd.exe shell. It captures stdout/stderr, handles timeouts and buffer limits, and returns a structured response with success status, output, error, and the executed command.
    async runCmd(command, timeout = 30000) {
      try {
        const { stdout, stderr } = await execAsync(command, {
          shell: 'cmd.exe',
          timeout,
          maxBuffer: 1024 * 1024 * 10,
        });
        return { 
          success: true, 
          output: stdout.trim(), 
          error: stderr.trim(),
          command 
        };
      } catch (error) {
        return { success: false, error: error.message, command };
      }
    }
  • The tool schema definition returned by getToolDefinitions(), specifying the name, description, and inputSchema for parameter validation (required 'command' string, optional 'timeout' number).
    {
      name: 'run_cmd',
      description: '执行 CMD 命令',
      inputSchema: {
        type: 'object',
        properties: {
          command: { type: 'string', description: 'CMD 命令' },
          timeout: { type: 'number', description: '超时时间(毫秒,可选)' },
        },
        required: ['command'],
      },
    },
  • Registration and dispatching logic in the executeTool switch statement, which routes calls to the 'run_cmd' tool to the runCmd handler method.
    case 'run_cmd':
      return await this.runCmd(args.command, args.timeout);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action (execute CMD command) but lacks critical details such as execution environment (e.g., shell context, permissions needed), potential side effects (e.g., system changes, security risks), error handling, or output format. This is inadequate for a tool that executes commands, which can have significant behavioral implications.

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?

The description is extremely concise with a single phrase '执行 CMD 命令', which is front-loaded and wastes no words. It efficiently conveys the core purpose without unnecessary elaboration, making it easy to scan and understand quickly.

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?

Given the complexity of a command execution tool with no annotations and no output schema, the description is incomplete. It fails to address key contextual aspects like what the tool returns (e.g., output, exit codes), execution constraints, or safety considerations, leaving significant gaps for an AI agent to understand how to use it effectively.

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%, with clear descriptions for both parameters ('command' and 'timeout'). The description adds no additional meaning beyond what the schema provides, such as examples of valid commands or timeout behavior. Given the high schema coverage, the baseline score of 3 is appropriate, as the schema adequately documents the parameters without extra help from the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description '执行 CMD 命令' (Execute CMD command) clearly states the verb (execute) and resource (CMD command), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'run_powershell' or other execution tools, leaving the scope vague regarding what type of commands or environment it operates in.

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?

The description provides no guidance on when to use this tool versus alternatives. There are no explicit instructions on when to choose 'run_cmd' over 'run_powershell' or other execution-related tools in the sibling list, nor any context about prerequisites or exclusions for usage.

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/eva-wanxin-git/windows-automation-mcp'

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