Skip to main content
Glama
Darkstar326

MCP MySQL Server

by Darkstar326

mysql_disconnect

Terminate active MySQL database connections to manage resources and ensure security when database access is no longer required.

Instructions

Disconnect from the MySQL database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'mysql_disconnect' tool. It ends the MySQL connection pool if it exists, clears the config, and returns a success or no-connection message.
    private async handleDisconnect() {
      if (this.pool) {
        await this.pool.end();
        this.pool = null;
        this.config = null;
        return {
          content: [
            {
              type: "text",
              text: "Successfully disconnected from MySQL database",
            },
          ],
        };
      } else {
        return {
          content: [
            {
              type: "text",
              text: "No active MySQL connection to disconnect",
            },
          ],
        };
      }
    }
  • The tool schema definition including name, description, and empty input schema for 'mysql_disconnect' in the ListTools response.
    {
      name: "mysql_disconnect",
      description: "Disconnect from the MySQL database",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
  • src/index.ts:263-264 (registration)
    The switch case registration that maps the 'mysql_disconnect' tool name to its handler function in the CallToolRequest handler.
    case "mysql_disconnect":
      return await this.handleDisconnect();

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('Disconnect') but doesn't describe what happens upon invocation—e.g., whether it closes all connections, releases resources, or affects subsequent operations. For a tool with potential side effects and no annotations, this is a significant gap in transparency.

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 a single, clear sentence with zero waste—it directly states the tool's action without unnecessary words. It's appropriately sized for a simple tool and front-loaded with the essential information, making it highly efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is minimally adequate but lacks completeness. It doesn't explain the behavioral impact of disconnecting, such as whether it's irreversible or affects other tools, which is important for a mutation-like operation. With no annotations to fill gaps, the description should do more to guide usage in context.

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

Parameters4/5

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

The tool has 0 parameters with 100% schema description coverage, so the schema fully documents the lack of inputs. The description doesn't need to add parameter details, and it correctly implies no parameters are required. This meets the baseline for tools with no parameters, as there's nothing to compensate for.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Disconnect') and target resource ('from the MySQL database'), making the tool's purpose immediately understandable. It distinguishes from siblings like mysql_connect (connection) and mysql_query (querying), though it doesn't explicitly contrast with them. The description avoids tautology by not just restating the name.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives or prerequisites for its use. It doesn't mention that it should be used after mysql_connect or when ending a session, nor does it clarify if it's optional or required for cleanup. Without such context, the agent lacks explicit usage instructions.

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