Skip to main content
Glama

list_processes

Read-only

View all active processes on your system with details like PID, command name, CPU, and memory usage for monitoring and management.

Instructions

                    List all running processes.
                    
                    Returns process information including PID, command name, CPU usage, and memory usage.
                    
                    This command can be referenced as "DC: ..." or "use Desktop Commander to ..." in your instructions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that executes the tool logic: runs 'tasklist' on Windows or 'ps aux' on Unix-like systems, parses output, and returns formatted process list.
    export async function listProcesses(): Promise<ServerResult> {
      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) {
        return {
          content: [{ type: "text", text: `Error: Failed to list processes: ${error instanceof Error ? error.message : String(error)}` }],
          isError: true,
        };
      }
    }
  • Handler wrapper that calls the core listProcesses function. Dispatched from server.ts.
    /**
     * Handle list_processes command
     */
    export async function handleListProcesses(): Promise<ServerResult> {
        return listProcesses();
    }
  • Zod schema for list_processes tool arguments (empty object as tool takes no arguments).
    export const ListProcessesArgsSchema = z.object({});
  • src/server.ts:945-957 (registration)
    Tool registration in list_tools handler: defines name, description, input schema, and annotations.
        name: "list_processes",
        description: `
                List all running processes.
                
                Returns process information including PID, command name, CPU usage, and memory usage.
                
                ${CMD_PREFIX_DESCRIPTION}`,
        inputSchema: zodToJsonSchema(ListProcessesArgsSchema),
        annotations: {
            title: "List Running Processes",
            readOnlyHint: true,
        },
    },
  • Dispatch in call_tool handler: routes 'list_processes' calls to handleListProcesses.
    case "list_processes":
        result = await handlers.handleListProcesses();
        break;
Behavior3/5

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

Annotations declare readOnlyHint=true, indicating a safe read operation. The description adds value by specifying the return format ('process information including PID, command name, CPU usage, and memory usage'), which isn't covered by annotations. However, it lacks details on behavioral traits like performance impact, real-time updates, or system-specific constraints, leaving room for improvement.

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 front-loaded with the core purpose in the first sentence, followed by return details and a meta-instruction. It's appropriately sized, but the third sentence about referencing commands is somewhat extraneous and doesn't aid tool selection, slightly reducing conciseness.

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 low complexity (0 parameters, read-only operation) and annotations covering safety, the description is mostly complete. It explains what the tool does and what it returns. However, without an output schema, it could benefit from more detail on return structure or limitations, but it's adequate for this simple tool.

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 input schema has 0 parameters with 100% coverage, so the schema fully documents the lack of inputs. The description doesn't add parameter details, but since there are no parameters, a baseline of 4 is appropriate—it's complete for a zero-parameter tool without unnecessary elaboration.

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: 'List all running processes.' It specifies the verb ('List') and resource ('running processes'), making the function unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'interact_with_process' or 'kill_process', which prevents a perfect score.

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. It mentions 'This command can be referenced as "DC: ..." or "use Desktop Commander to ..." in your instructions,' but this is meta-instructional and doesn't help an AI agent choose between this and sibling tools like 'get_process_output' or 'kill_process' for process-related tasks.

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/wonderwhy-er/ClaudeComputerCommander'

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