list_processes
List all running processes launched by the agent to monitor active tasks and manage system resources.
Instructions
List all running processes started by the agent
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/services/ProcessService.ts:206-215 (handler)The handler function that executes the 'list_processes' tool logic. It calls ProcessUtils.formatProcessList on the activeProcesses map and returns the formatted text.
async listProcesses(): Promise<ToolResult> { const processText = ProcessUtils.formatProcessList(this.activeProcesses); return { content: [{ type: 'text', text: processText, }], }; } - src/toolDefinitions.ts:402-409 (schema)Schema definition for the 'list_processes' tool. It has no required input properties.
{ name: 'list_processes', description: 'List all running processes started by the agent', inputSchema: { type: 'object', properties: {}, }, }, - src/index.ts:245-246 (registration)The registration/dispatch point where the 'list_processes' case routes to processService.listProcesses().
case 'list_processes': return await this.processService.listProcesses(); - src/utils.ts:147-160 (helper)Helper utility that formats the process map into a human-readable JSON string for display.
static formatProcessList(processMap: Map<string, ProcessInfo>): string { const processes: ProcessDisplay[] = Array.from(processMap.entries()).map(([name, info]) => ({ name, command: info.command, port: info.port, pid: info.process.pid, workspace: info.workspace, startTime: info.startTime, })); return processes.length > 0 ? `Active processes:\n${JSON.stringify(processes, null, 2)}` : 'No active processes'; } - src/utils.ts:125-141 (helper)The ProcessUtils class definition and the createProcessInfo helper used when adding processes.
export class ProcessUtils { /** * Create process info object */ static createProcessInfo( process: ChildProcess, command: string, port: number | undefined, workspace: string ): ProcessInfo { return { process, command, port, workspace, startTime: new Date().toISOString(), };