Skip to main content
Glama

process_kill

Terminate a specific process by its PID using the kill-process-mcp server, enabling direct and efficient process management across Windows, macOS, and Linux systems.

Instructions

Kill the process identified by the given PID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ctxNo
pidYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'process_kill' tool. It uses psutil to kill the process with the given PID, includes safety checks (refuses to kill self), logging via ctx, and error handling for no such process or access denied.
    @mcp.tool()
    async def process_kill(pid: int, ctx: Context | None = None) -> str:
        """Kill the process identified by the given PID"""
    
        if ctx:
            await ctx.info(f"process_kill called pid={pid}")
    
        if pid == os.getpid():
            return "Refusing to kill MCP server process"
    
        try:
            proc = psutil.Process(pid)
            proc.kill()
            proc.wait(timeout=5)
            return f"Process {pid} terminated"
        except (psutil.NoSuchProcess, psutil.AccessDenied) as err:
            return f"Failed to kill {pid}: {err}"
Behavior2/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 states the action ('kill') which implies a destructive operation, but doesn't elaborate on consequences (e.g., process termination effects, permissions required, system impact, or error handling). This is inadequate for a potentially dangerous operation.

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, direct sentence with no wasted words. It's appropriately sized and front-loaded, making it easy to understand immediately.

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?

For a destructive tool with no annotations, 0% schema coverage, and an output schema (which helps but doesn't cover behavioral aspects), the description is insufficient. It lacks critical details about safety, permissions, and usage context that are essential for responsible tool invocation.

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?

Schema description coverage is 0%, so the description must compensate. It mentions 'PID' which corresponds to the 'pid' parameter, adding some meaning. However, it doesn't explain the 'ctx' parameter at all, leaving half the parameters undocumented. The minimal compensation warrants a baseline score.

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 ('kill') and the target ('process identified by the given PID'), which is specific and unambiguous. However, it doesn't explicitly differentiate from the sibling tool 'process_list', which would be needed for a perfect score.

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, nor any prerequisites or context for its use. It simply states what it does without indicating appropriate scenarios or warnings.

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

Related 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/misiektoja/kill-process-mcp'

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