Skip to main content
Glama

list_processes

View all active terminal processes managed by the MCP Terminal server to monitor system activity and manage running applications.

Instructions

List all running processes managed by this MCP server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The implementation of the `listProcesses` method in `ProcessManager` which retrieves and formats the list of running processes.
    async listProcesses(): Promise<{ processes: { id: string; status: "running"; command: string; logFile: string }[] }> {
      const processes: { id: string; status: "running"; command: string; logFile: string }[] = [];
    
      for (const [id, processInfo] of this.processes) {
        // Get command from spawn arguments (stored in process.spawnargs)
        const command = processInfo.process.spawnargs?.join(' ') || '';
    
        processes.push({
          id,
          status: 'running',
          command,
          logFile: processInfo.logFile,
        });
      }
    
      return { processes };
    }
  • src/index.ts:77-84 (registration)
    Registration of the `list_processes` tool in the MCP server definition.
    {
      name: 'list_processes',
      description: 'List all running processes managed by this MCP server',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • Request handler logic in `src/index.ts` that maps the MCP tool call `list_processes` to the `processManager.listProcesses()` method.
    case 'list_processes': {
      const result = await processManager.listProcesses();
      return { content: [{ type: 'text', text: JSON.stringify(result) }] };
    }
  • Type definition for the output of the `list_processes` tool.
    export interface ListProcessesOutput {
      processes: {
        id: string;
        status: "running";
        command: string;
        logFile: string;
      }[];
    }

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/h004888/mcp_terminal_process'

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