Skip to main content
Glama

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();

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