Skip to main content
Glama

kill_query

Destructive

Cancel a session's running SQL statement on MySQL/MariaDB while keeping the connection alive; preview with dry_run to abort long or blocking queries.

Instructions

[WRITE][risk=high] Cancel a session's running statement (KILL QUERY). No inverse.

The session stays connected; only its current statement is aborted. Captures the session's user/host/query for audit. Pass dry_run=True to preview.

Refuses this tool's own session id — the statement it would cancel is this very call. Enforced under dry_run too.

Args: session_id: Session/connection id (from list_sessions). dry_run: If True, preview without cancelling. target: Target name from config; omit for the default.

Input Schema

NameRequiredDescriptionDefault
targetNo
dry_runNo
session_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.0

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the annotations (which only flag write/destructive/non-idempotent): discloses there is no inverse, that the session survives, that user/host/query are captured for audit, that dry_run previews, and critically that it refuses its own session id even under dry_run. The self-refusal guard is a non-obvious safety behavior an agent must know before invoking.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the [WRITE][risk=high] tag and the core action, then behavior, then Args. Every sentence earns its place, though the Args block partly restates facts already implied above (dry_run). Slight redundancy keeps it from a 5.

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?

For a destructive, non-idempotent, no-undo mutation with no output schema, the description covers reversibility, side effects, safety guard, and preview mechanism. An agent has everything needed to call it correctly and safely.

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

Parameters5/5

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

Schema description coverage is 0%, so the description carries the full burden and does: session_id (sourced from list_sessions), dry_run (preview without cancelling), and target (config name, omit for default). All three parameters are given meaning beyond their bare names and defaults.

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?

States a specific verb and resource ('Cancel a session's running statement (KILL QUERY)') and immediately scopes it: only the current statement is aborted, the session stays connected. This differentiates it from the sibling kill_session without the agent needing to open either schema.

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?

Implies the right context via 'the session stays connected; only its current statement is aborted,' which routes an agent away from kill_session when it only wants to abort a query. It also specifies session_id comes 'from list_sessions,' linking to a sibling for discovery. It stops short of explicitly naming kill_session as the alternative and when to prefer it, so not a full 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.