Skip to main content
Glama

kill_process

Terminate running processes by PID to manage system resources and stop unresponsive applications. Use this tool to forcefully end specific processes when needed.

Instructions

Terminate a running process by PID. Use with caution as this will forcefully terminate the specified process. This command can be referenced as "DC: ..." or "use Desktop Commander to ..." in your instructions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pidYes

Implementation Reference

  • Handler function for the 'kill_process' tool command. Parses arguments using the schema and delegates to the core killProcess function.
    /** * Handle kill_process command */ export async function handleKillProcess(args: unknown): Promise<ServerResult> { const parsed = KillProcessArgsSchema.parse(args); return killProcess(parsed); }
  • Core implementation of process killing. Validates arguments, calls Node.js process.kill(pid), and returns success/error ServerResult.
    export async function killProcess(args: unknown): Promise<ServerResult> { const parsed = KillProcessArgsSchema.safeParse(args); if (!parsed.success) { return { content: [{ type: "text", text: `Error: Invalid arguments for kill_process: ${parsed.error}` }], isError: true, }; } try { process.kill(parsed.data.pid); return { content: [{ type: "text", text: `Successfully terminated process ${parsed.data.pid}` }], }; } catch (error) { return { content: [{ type: "text", text: `Error: Failed to kill process: ${error instanceof Error ? error.message : String(error)}` }], isError: true, }; } }
  • Zod schema for validating input arguments to kill_process tool, requiring a numeric PID.
    export const KillProcessArgsSchema = z.object({ pid: z.number(), });

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/wonderwhy-er/ClaudeComputerCommander'

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