Skip to main content
Glama
StrawHatAI

Claude Desktop Commander MCP

by StrawHatAI

kill_process

Terminate running processes by PID to manage system resources and resolve unresponsive applications. Use with caution for forceful termination.

Instructions

Terminate a running process by PID. Use with caution as this will forcefully terminate the specified process.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pidYes

Implementation Reference

  • The core handler function that validates input using KillProcessArgsSchema, kills the process using Node.js process.kill(pid), and returns a success message or throws an error.
    export async function killProcess(args: unknown) {
    
      const parsed = KillProcessArgsSchema.safeParse(args);
      if (!parsed.success) {
        throw new Error(`Invalid arguments for kill_process: ${parsed.error}`);
      }
    
      try {
        process.kill(parsed.data.pid);
        return {
          content: [{ type: "text", text: `Successfully terminated process ${parsed.data.pid}` }],
        };
      } catch (error) {
        throw new Error(`Failed to kill process: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
  • Zod schema defining the input arguments for the kill_process tool: requires a 'pid' number.
    export const KillProcessArgsSchema = z.object({
      pid: z.number(),
    });
  • src/server.ts:96-101 (registration)
    Tool registration in the ListTools response, defining name, description, and input schema.
      name: "kill_process",
      description:
        "Terminate a running process by PID. Use with caution as this will " +
        "forcefully terminate the specified process.",
      inputSchema: zodToJsonSchema(KillProcessArgsSchema),
    },
  • src/server.ts:232-235 (registration)
    Dispatch logic in the CallTool handler switch statement, which parses args and calls the killProcess handler.
    case "kill_process": {
      const parsed = KillProcessArgsSchema.parse(args);
      return killProcess(parsed);
    }
  • src/server.ts:28-28 (registration)
    Import statement bringing in the killProcess handler function.
    import { listProcesses, killProcess } from './tools/process.js';
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively conveys that this is a destructive action ('forcefully terminate') and requires caution, which is crucial for a mutation tool. However, it misses details like permission requirements, system impact, or error handling, leaving some behavioral aspects unclear.

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 appropriately sized with two sentences that are front-loaded: the first states the purpose, and the second adds crucial caution. Every sentence earns its place by providing essential information without waste, making it efficient and well-structured.

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

Completeness3/5

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

Given the tool's complexity (destructive mutation), lack of annotations, no output schema, and low schema coverage, the description is somewhat complete but has gaps. It covers the core action and caution, but misses details like return values, error cases, or prerequisites, making it adequate but not fully comprehensive for safe use.

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 schema description coverage is 0%, with 1 parameter (pid) undocumented in the schema. The description adds meaning by specifying that the pid is used to identify the process to terminate, which clarifies the parameter's role. However, it doesn't provide format details (e.g., integer type, valid ranges), so it partially compensates but not fully.

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

Purpose5/5

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

The description clearly states the specific action ('terminate'), target resource ('a running process'), and method ('by PID'), making the purpose explicit. It distinguishes this tool from siblings like 'force_terminate' by specifying the PID-based approach, though the distinction could be more explicit.

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

Usage Guidelines4/5

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

The description provides clear context with 'Use with caution as this will forcefully terminate the specified process,' indicating when to be careful. However, it lacks explicit guidance on when to use this versus alternatives like 'force_terminate' or other process-related tools, which would improve the score.

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/StrawHatAI/claude-dev-tools'

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