Skip to main content
Glama
hoyt-harness

ProcExecMCP

by hoyt-harness

kill_process

Terminate stuck or hung processes using PID. Supports graceful termination with timeout or forced kill for unresponsive processes.

Instructions

Terminate a process by PID with graceful or forced termination.

This tool allows terminating stuck or hung processes to clean up system resources. It supports both graceful termination (SIGTERM/WM_CLOSE) with a timeout, and forced termination (SIGKILL/TerminateProcess) for unresponsive processes.

Args: pid: Process ID to terminate (must be >= 1) force: If True, forcefully kill the process. If False, attempt graceful termination with timeout. Default: False timeout_seconds: Timeout in seconds to wait for graceful termination. Ignored if force=True. Range: 0.1-30.0s. Default: 5.0s ctx: MCP context for logging (optional)

Returns: KillProcessOutput with success status, PID, message, timing, and whether forced termination was used

Raises: SanitizedError: If process termination fails or is not enabled

Security: - Requires PROCEXEC_ENABLE_KILL=true environment variable to function - Handles permission errors gracefully (no crashes) - Cannot terminate system-critical processes (OS protection) - Error messages are sanitized (no sensitive info)

Examples: >>> # Graceful termination >>> result = await kill_process(pid=1234, force=False, timeout_seconds=5.0) >>> print(result.success, result.message) True 'Process terminated gracefully'

>>> # Forced termination
>>> result = await kill_process(pid=5678, force=True)
>>> print(result.success, result.forced)
True True

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pidYes
forceNo
timeout_secondsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
pidYesProcess ID that was targeted for termination
forcedYesWhether forced termination (SIGKILL) was used
messageYesHuman-readable status message describing the outcome
successYesWhether the process was successfully terminated
termination_time_msYesTime taken to terminate the process in milliseconds
Behavior5/5

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

With no annotations, the description fully discloses behavior: graceful and forced termination, timeout handling, security requirements (PROCEXEC_ENABLE_KILL), permission errors, system-critical protection, and sanitized errors.

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

Conciseness4/5

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

Well-structured with sections (Args, Returns, etc.) and examples. Slightly verbose but every sentence adds value; minor trimming could improve conciseness.

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

Completeness5/5

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

Covers all aspects: parameters, return values, error handling, security, and examples. Output schema exists but description already explains return fields; fully adequate.

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

Parameters5/5

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

Schema has 0% description coverage; the description adds full semantics for all parameters: pid (>=1), force (default false), timeout_seconds (range 0.1-30.0, default 5.0, ignored if force).

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 'Terminate a process by PID' with specific methods (graceful/forced), and is distinct from sibling tools like execute_command or list_processes.

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?

It provides context for when to use (stuck/hung processes) and differentiates graceful vs forced termination, but lacks explicit exclusion or comparison with sibling tools, which is acceptable given their distinct purposes.

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/hoyt-harness/ProcExecMCP'

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