Skip to main content
Glama

kill_session

Kill a MySQL session by connection ID to stop runaway queries. Preview with dry_run and get an audit trail; irreversible.

Instructions

[WRITE][risk=high] Terminate a session (KILL CONNECTION). No safe inverse.

Captures the session's user/host/query for the audit trail; a kill cannot be undone, so no undo is offered. Pass dry_run=True to preview.

Refuses this tool's own session id — including under dry_run, which must report a refusal rather than preview a call that will be refused.

Args: session_id: Session/connection id (from list_sessions). dry_run: If True, preview without killing. 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 fully discloses the destructive nature: write operation, high risk, no safe inverse, no undo, audit trail capture, and refusal behavior even under dry_run. This is exceptionally transparent for a mutation tool.

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 compact and front-loaded with the critical warning. Each sentence adds necessary information: effect, irreversibility, audit trail, dry-run behavior, refusal condition, and parameter meanings. No filler or redundancy.

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 tool with no output schema and no annotations, the description covers all required aspects: what it does, side effects, safety guardrails, parameter semantics, and an important edge case. It leaves no significant behavioral question unanswered.

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 coverage is 0%, but the description explains every parameter: session_id comes from list_sessions, dry_run previews without killing, and target is a config-based override with a default. This fully compensates for the lack of schema descriptions.

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 opens with 'Terminate a session (KILL CONNECTION)', which is a specific verb and resource, clearly distinguishing this from sibling tools like kill_query. The scope is unambiguous: it kills a database session, not a query.

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?

It provides clear usage context: sessions come from list_sessions, dry_run=True can preview, and the tool refuses its own session id. It stops short of explicitly naming alternative tools or stating when not to use it, but the caveats and workflow guidance are strong.

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