Skip to main content
Glama

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
NameRequiredDescriptionDefault
idYesProcess identifier to stop

Implementation Reference

  • 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'],
    },
  • Type definitions for stop_process input and output.
    export interface StopProcessInput {
      id: string;
    }
    
    export interface StopProcessOutput {
      id: string;
      status: "stopped";

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