Skip to main content
Glama
Teja-sudo

postgres-mcp-server

by Teja-sudo

kill_query

Cancel or terminate a PostgreSQL backend session by PID. Use soft cancel to interrupt a query or hard terminate to kill the entire backend.

Instructions

Cancel or terminate a backend session by PID. mode='cancel' (soft, pg_cancel_backend) interrupts the current statement; mode='terminate' (hard, pg_terminate_backend) kills the entire backend. Both require confirm:true. Refused if the target server's effective access mode is readonly. Returns a snapshot of the target session before signaling.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pidYesBackend PID to signal.
modeYesSoft cancel (statement only) or hard terminate (backend).
confirmYesRequired confirmation. Foot-gun guard.
serverNo
databaseNo
schemaNo
Behavior5/5

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

No annotations provided, so description fully covers behavior: cancel interrupts statement, terminate kills backend, requires confirm, refused in readonly mode, returns snapshot before signaling. This is comprehensive for a kill 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?

Three sentences, front-loaded with purpose, then mode details, then conditions and return. No wasted words.

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

Completeness4/5

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

Without annotations or output schema, description covers core functionality and return value. Missing details on error handling or invalid PID, but adequate for a kill tool with clear required params.

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?

Description adds meaning for pid, mode, and confirm beyond schema (e.g., soft/hard, foot-gun guard). However, it does not explain the optional server, database, and schema parameters, which are only in schema without descriptions. Given 50% schema coverage, description only partially compensates.

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?

Description clearly states the tool cancels or terminates a backend session by PID, distinguishing between soft cancel and hard terminate. It uses specific verb+resource and is distinct from siblings like 'find_blocking_queries' or 'lock_check'.

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?

Description explains when to use cancel vs terminate, and mentions the confirm requirement and readonly restriction. However, it does not explicitly state when not to use this tool or suggest alternatives.

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/Teja-sudo/postgres-mcp-server'

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