Skip to main content
Glama
alxspiker

Windows Command Line MCP Server

list_running_processes

Identify and monitor active processes on Windows systems. Filter results by process name to quickly locate specific applications or services.

Instructions

List all running processes on the system. Can be filtered by providing an optional filter string that will match against process names.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filterNoOptional filter string to match against process names

Implementation Reference

  • index.ts:56-100 (handler)
    The asynchronous handler function for the 'list_running_processes' tool. It constructs platform-specific commands (PowerShell Get-Process on Windows with optional filter, ps aux | grep on Unix) , executes via executeCommand helper, and returns the stdout as text content or error.
      async ({ filter }) => {
        try {
          let cmd;
          
          if (isWindows) {
            cmd = "powershell.exe -Command \"Get-Process";
            
            if (filter) {
              // Add filter if provided
              cmd += ` | Where-Object { $_.ProcessName -like '*${filter}*' }`;
            }
            
            cmd += " | Select-Object Id, ProcessName, CPU, WorkingSet, Description | Format-Table -AutoSize | Out-String\"";
          } else {
            // Fallback for Unix systems
            cmd = "ps aux";
            
            if (filter) {
              cmd += ` | grep -i ${filter}`;
            }
          }
          
          const stdout = executeCommand(cmd);
          
          return {
            content: [
              {
                type: "text",
                text: stdout.toString(),
              },
            ],
          };
        } catch (error) {
          return {
            isError: true,
            content: [
              {
                type: "text",
                text: `Error listing processes: ${error}`,
              },
            ],
          };
        }
      }
    );
  • Zod input schema defining the optional 'filter' parameter as a string for matching process names.
    {
      filter: z.string().optional().describe("Optional filter string to match against process names"),
    },
  • index.ts:49-52 (registration)
    Registration of the 'list_running_processes' tool using server.tool(), including name and description.
    // Register the list_running_processes tool
    server.tool(
      "list_running_processes",
      "List all running processes on the system. Can be filtered by providing an optional filter string that will match against process names.",
  • Platform-aware helper function 'executeCommand' that runs commands via execSync, with modifications for non-Windows environments to strip Windows-specific prefixes.
    function executeCommand(command: string, options: any = {}) {
      if (isWindows) {
        return execSync(command, options);
      } else {
        // Log warning for non-Windows environments
        console.error(`Warning: Running in a non-Windows environment (${platform()}). Windows commands may not work.`);
        
        // For testing purposes on non-Windows platforms
        try {
          // For Linux/MacOS, we'll strip cmd.exe and powershell.exe references
          let modifiedCmd = command;
          
          // Replace cmd.exe /c with empty string
          modifiedCmd = modifiedCmd.replace(/cmd\.exe\s+\/c\s+/i, '');
          
          // Replace powershell.exe -Command with empty string or a compatible command
          modifiedCmd = modifiedCmd.replace(/powershell\.exe\s+-Command\s+("|')/i, '');
          
          // Remove trailing quotes if we removed powershell -Command
          if (modifiedCmd !== command) {
            modifiedCmd = modifiedCmd.replace(/("|')$/, '');
          }
          
          console.error(`Attempting to execute modified command: ${modifiedCmd}`);
          return execSync(modifiedCmd, options);
        } catch (error) {
          console.error(`Error executing modified command: ${error}`);
          return Buffer.from(`This tool requires a Windows environment. Current platform: ${platform()}`);
        }
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it mentions filtering capability, it doesn't describe what information is returned about each process, whether the list is real-time or cached, permission requirements, or potential system impact. For a system query tool with zero annotation coverage, this leaves significant behavioral gaps.

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?

Two clear, efficient sentences with zero waste. The first states the core purpose, the second adds the optional filtering capability. Perfectly front-loaded and appropriately sized for this simple tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read-only query tool with one well-documented parameter, the description is minimally adequate. However, with no annotations and no output schema, it should ideally provide more context about what process information is returned and any system considerations.

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 schema already fully documents the single optional filter parameter. The description adds no additional parameter semantics beyond what's in the schema, maintaining the baseline score for high schema coverage.

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?

The description clearly states the specific action ('List all running processes') and resource ('on the system'), with explicit mention of filtering capability. It distinguishes from siblings like execute_command or get_system_info by focusing specifically on process enumeration.

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 for viewing running processes, but provides no explicit guidance on when to use this tool versus alternatives like get_service_info or list_allowed_commands. No exclusions or prerequisites are mentioned.

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/alxspiker/Windows-Command-Line-MCP-Server'

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