stop_process
Terminate a running terminal process by its identifier to manage system resources and ensure stability.
Instructions
Stop a running process
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Process identifier to stop |
Implementation Reference
- src/processManager.ts:65-89 (handler)The implementation of the stop_process tool handler, which kills the specified process.
async stopProcess(input: { id: string }): Promise<{ id: string; status: 'stopped' }> { const processInfo = this.processes.get(input.id); if (!processInfo) { throw new Error(`Process '${input.id}' not found`); } return new Promise((resolve) => { const proc = processInfo.process; proc.once('exit', () => { this.processes.delete(input.id); resolve({ id: input.id, status: 'stopped' }); }); proc.kill('SIGTERM'); // Force kill after timeout setTimeout(() => { if (this.processes.has(input.id)) { proc.kill('SIGKILL'); } }, config.killTimeout); }); } - src/index.ts:42-50 (registration)Tool registration for stop_process.
name: 'stop_process', description: 'Stop a running process', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Process identifier to stop' }, }, required: ['id'], }, - src/types.ts:12-18 (schema)Type definitions for stop_process input and output.
export interface StopProcessInput { id: string; } export interface StopProcessOutput { id: string; status: "stopped";