terminate_backend
Terminate a PostgreSQL backend by PID to stop a runaway, blocking, or unwanted session; preview with dry_run before making an irreversible change.
Instructions
[WRITE][risk=high] Terminate a backend (pg_terminate_backend). No safe inverse.
Captures the backend's pid + query for the audit trail; a terminate cannot be
undone, so no undo is offered. Pass dry_run=True to preview.
Refuses this tool's own backend pid — including under dry_run, which must
report a refusal rather than preview a call that will be refused.
Args:
pid: Backend process id (from list_activity).
dry_run: If True, preview without terminating.
target: Target name from config; omit for the default.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"pid": "<pid>"
},
"name": "terminate_backend"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pid | Yes | ||
| target | No | ||
| dry_run | No |