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.
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>",
"mode": "<mode>",
"confirm": "<confirm>"
},
"name": "kill_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pid | Yes | Backend PID to signal. | |
| mode | Yes | Soft cancel (statement only) or hard terminate (backend). | |
| confirm | Yes | Required confirmation. Foot-gun guard. | |
| server | No | ||
| database | No | ||
| schema | No |