cancel_query
Stop a stuck or runaway database statement by server backend PID; the session survives and uncommitted work is rolled back.
Instructions
Cancel the statement running in server backend pid (find pids via show_activity).
Use for a stuck or runaway statement. To cap your own query's run time instead, pass timeout_ms to execute_read_query or execute_write_query.
Returns meta, pid and cancelled. Cancels the statement only — the session
survives, and the cancelled statement's uncommitted work is rolled back. The
request is sent at once; the statement stops at its next interrupt check, usually
within moments. cancelled=false means the pid doesn't exist or you lack permission
(same database user required).
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": {
"database": "<database>",
"pid": "<pid>"
},
"name": "cancel_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pid | Yes | Server backend process id, as show_activity reports it. | |
| database | Yes | Name of a configured database, exactly as list_databases returns it (case-sensitive). Not a DSN, host or server-side database name. An unknown name is an error that lists the configured names. |