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";
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states the action ('stop') but doesn't clarify what 'stop' entails—whether it's a graceful shutdown, force termination, or reversible. It also omits critical details like permissions required, side effects (e.g., data loss), error handling, or confirmation prompts. This is inadequate for a mutation tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with zero wasted words. It's front-loaded with the core action and resource, making it easy to parse. Every word earns its place, achieving maximum efficiency.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a mutation operation to stop processes), lack of annotations, and no output schema, the description is incomplete. It doesn't address behavioral aspects like safety, reversibility, or response format, leaving significant gaps for an AI agent to understand how to invoke it correctly in context with its siblings.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the single parameter 'id' documented as 'Process identifier to stop'. The description adds no additional meaning beyond this, such as format examples (e.g., numeric ID, name) or where to obtain the ID (e.g., from 'list_processes'). Baseline 3 is appropriate since the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('stop') and target resource ('a running process'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its sibling 'start_process' beyond the obvious verb difference, nor does it specify what type of process (e.g., system process, background job) it operates on.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., the process must be running), when not to use it (e.g., for system-critical processes), or how it relates to siblings like 'list_processes' (to identify processes to stop) or 'start_process' (to restart after stopping).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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