Skip to main content
Glama

kill_server

Destructive

Safely terminate a local dev server by PID or port. Dry run by default; pass confirm:true to send SIGTERM and escalate as needed. Protects system processes and non-dev servers.

Instructions

Terminates a local dev server by pid or port. DESTRUCTIVE. Safe by default: with no confirm, this is a DRY RUN — it reports what it would kill and changes nothing. Pass confirm: true to actually terminate: sends SIGTERM, waits up to 5s, then escalates to SIGKILL (or SIGKILL immediately if force: true). Refuses PIDs below 1000 and processes that don't look like dev servers. Provide exactly one of pid or port. Returns what was (or would be) killed and the signal used.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pidNoProcess ID to kill. Mutually exclusive with `port`.
portNoTCP port whose listening process should be killed. Mutually exclusive with `pid`.
forceNoSkip SIGTERM and send SIGKILL immediately. Default false.
confirmNoMust be true to actually terminate the process. When false/omitted the call is a dry run.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
pidNo
portNo
killedNo
signalNo`SIGTERM`, `SIGKILL`, or null on a dry run.
dry_runNo
messageNo
processNo
Behavior5/5

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

Rich behavioral details beyond annotations: dry-run behavior, escalation from SIGTERM to SIGKILL with timeout, force flag effect, safety guardrails (refuses low PIDs and non-dev-server processes). Annotations provide destructiveHint, but description adds deep context without contradiction.

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?

Two dense, front-loaded sentences with zero redundancy. Every clause adds essential information (alternatives, safety, escalation, constraints).

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?

Given the presence of output schema (not shown) and annotations, the description covers behavior, constraints, safety mechanisms, and parameter relationships completely. No gaps for an AI agent to misunderstand.

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

Parameters4/5

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

Schema already describes all 4 parameters fully (100% coverage). The description adds value by contextualizing the mutex between pid/port, explaining the safe default behavior, and clarifying the effect of confirm vs force beyond the schema descriptions.

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 uses active verbs ('terminates', 'reports', 'sends') and clearly specifies the resource ('local dev server') and scope ('by pid or port'). It distinguishes from siblings like list_dev_servers and find_zombies by focusing solely on termination.

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?

Explicitly states 'Provide exactly one of pid or port' and explains the dry-run default and confirm requirement. While it doesn't contrast with siblings (not needed as they serve different purposes), it gives clear context for when to use this tool.

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/HasanJahidul/localhost-mcp'

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