Skip to main content
Glama
MrGNSS

Desktop Commander MCP

by MrGNSS

list_processes

View all active processes on your computer with detailed information including PID, command name, CPU usage, and memory usage for system monitoring and management.

Instructions

List all running processes. Returns process information including PID, command name, CPU usage, and memory usage.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that lists processes using platform-specific commands (tasklist on Windows, ps aux on Unix), parses PID, command, CPU, and memory, and returns formatted text output.
    export async function listProcesses(): Promise<{content: Array<{type: string, text: string}>}> {
      const command = os.platform() === 'win32' ? 'tasklist' : 'ps aux';
      try {
        const { stdout } = await execAsync(command);
        const processes = stdout.split('\n')
          .slice(1)
          .filter(Boolean)
          .map(line => {
            const parts = line.split(/\s+/);
            return {
              pid: parseInt(parts[1]),
              command: parts[parts.length - 1],
              cpu: parts[2],
              memory: parts[3],
            } as ProcessInfo;
          });
    
        return {
          content: [{
            type: "text",
            text: processes.map(p =>
              `PID: ${p.pid}, Command: ${p.command}, CPU: ${p.cpu}, Memory: ${p.memory}`
            ).join('\n')
          }],
        };
      } catch (error) {
        throw new Error('Failed to list processes');
      }
    }
  • src/server.ts:84-94 (registration)
    Registration of the list_processes tool in the ListTools response, including name, description, and empty input schema indicating no parameters are required.
    {
      name: "list_processes",
      description:
        "List all running processes. Returns process information including PID, " +
        "command name, CPU usage, and memory usage.",
      inputSchema: {
        type: "object",
        properties: {},
        required: [],
      },
    },
  • src/server.ts:230-231 (registration)
    Dispatch logic in the CallToolRequest handler that invokes the listProcesses function when the tool is called.
    case "list_processes":
      return listProcesses();

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
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 returns process information (PID, command name, CPU usage, memory usage), which is useful behavioral context. However, it doesn't mention potential limitations like refresh rate, system impact, or permission requirements.

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 two sentences with zero waste: the first states the action and scope, the second specifies the return format. It's appropriately sized and front-loaded with essential information.

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 tool's simplicity (0 parameters, no output schema, no annotations), the description is reasonably complete. It explains what the tool does and what information it returns. For a read-only listing tool, this covers the essentials, though adding context about system-specific behavior could improve it.

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?

The tool has 0 parameters with 100% schema description coverage, so the schema already fully documents the inputs. The description appropriately doesn't add parameter details, maintaining focus on the tool's purpose and output.

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 verb ('List') and resource ('all running processes'), specifying what the tool does. It distinguishes from siblings like kill_process or force_terminate by focusing on listing rather than modifying processes.

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 doesn't explicitly state when to use this tool versus alternatives like list_sessions or list_directory. No guidance on prerequisites or exclusions is provided.

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