Skip to main content
Glama

list_processes

Retrieve detailed information on all running processes, including PID, command name, CPU, and memory usage, for effective system monitoring and management using Desktop Commander MCP.

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

  • Core handler function that executes platform-specific command to list processes, parses output into ProcessInfo objects, formats as text lines, and returns MCP-standard content array.
    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)
    Registers the 'list_processes' tool in the MCP server's ListTools response, including name, detailed description, and empty input schema indicating no parameters 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: [], }, },
  • Dispatch logic in CallToolRequest handler that routes 'list_processes' tool calls directly to the listProcesses implementation.
    case "list_processes": return listProcesses();
  • Input schema definition for list_processes tool: empty object schema (no input parameters). Note: output follows standard MCP content format implicitly via handler.
    inputSchema: { type: "object", properties: {}, required: [], },

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/MrGNSS/ClaudeDesktopCommander'

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