Skip to main content
Glama

kill_query

Cancel a running query in a MySQL session without disconnecting it. Preview with dry_run; includes audit logging and prevents killing its own session.

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

TableJSON Schema
NameRequiredDescriptionDefault
targetNo
dry_runNo
session_idYes
Behavior5/5

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

With no annotations, the description carries full burden and does exceptionally well. It discloses it's a high-risk write operation, has no inverse, keeps the session connected, captures audit info, refuses its own session id, and enforces dry_run. This far exceeds typical descriptions.

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?

The description is front-loaded with the purpose and risk tags, then provides necessary behavioral details and parameter documentation. Each sentence adds value, and the structure (overview, side effects, self-guard, Args) is clean and scannable.

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?

The description is very complete, covering side effects, parameters, and safety. It lacks explicit mention of permission/authorization requirements (e.g., KILL privilege) and does not describe the return value or error conditions. Since there is no output schema, this leaves a small gap.

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?

Despite schema description coverage of 0%, the description's Args section thoroughly explains each parameter: session_id comes from list_sessions, dry_run toggles preview, and target is from config with a default. This adds significant meaning beyond the schema's titles 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?

The description clearly states the tool's function with a specific verb and resource: 'Cancel a session's running statement (KILL QUERY).' It also distinguishes it from related tools by noting 'The session stays connected; only its current statement is aborted,' which separates it from kill_session. The 'No inverse' note clarifies the irreversible nature.

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?

The description provides clear context: it cancels a running statement without disconnecting the session, and offers a dry_run option for preview. It does not explicitly name alternatives or when-not-to-use scenarios, but the behavioral distinction is strong. Since it doesn't explicitly compare to kill_session, it stops short of a 5.

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/AIops-tools/MySQL-AIops'

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