Skip to main content
Glama
sussa3007

MySql MCP Server

disconnect

Terminate the active MySQL database connection to manage resources effectively or reset the session. Use this tool to ensure clean disconnections from the MySQL MCP Server.

Instructions

Close the current MySQL database connection.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
random_stringYesDummy parameter for no-parameter tools

Implementation Reference

  • The handler function for the 'disconnect' tool. Checks if connected, ends the connection, sets it to null, and returns success or not connected message.
    case "disconnect": {
      if (!connection) {
        return {
          content: [{ type: "text", text: "Not connected to any database" }],
          isError: false
        };
      }
    
      await connection.end();
      connection = null;
    
      return {
        content: [
          {
            type: "text",
            text: "Successfully disconnected from database"
          }
        ],
        isError: false
      };
    }
  • src/index.ts:173-186 (registration)
    Registration of the 'disconnect' tool in the ListTools response, including name, description, and input schema.
    {
      name: "disconnect",
      description: "Close the current MySQL database connection.",
      inputSchema: {
        type: "object",
        properties: {
          random_string: {
            type: "string",
            description: "Dummy parameter for no-parameter tools"
          }
        },
        required: ["random_string"]
      }
    },
  • Input schema for the 'disconnect' tool, which requires a dummy random_string parameter.
    inputSchema: {
      type: "object",
      properties: {
        random_string: {
          type: "string",
          description: "Dummy parameter for no-parameter tools"
        }
      },
      required: ["random_string"]
    }
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. It states the tool closes a connection but does not disclose behavioral traits such as whether this is reversible, if it requires specific permissions, what happens to pending queries, or error handling. This leaves significant gaps 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 a single, front-loaded sentence with zero waste. It efficiently conveys the core purpose without unnecessary details, making it highly concise and well-structured.

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 (closing a connection) and no output schema, the description is adequate but lacks depth. Without annotations, it should ideally mention implications like termination of active sessions or confirmation of closure, leaving room for improvement in completeness.

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 input schema has 1 parameter with 100% coverage, documenting it as a 'Dummy parameter for no-parameter tools'. The description adds no parameter semantics, but since the tool effectively has 0 functional parameters, a baseline of 4 is appropriate as no additional clarification is needed.

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 specific action ('Close') and resource ('current MySQL database connection'), distinguishing it from sibling tools like 'connect' or 'status'. It precisely defines what the tool does without ambiguity.

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 implies usage context by specifying 'current MySQL database connection', suggesting it should be used when a connection is active. However, it does not explicitly state when to use it versus alternatives like 'connect' or provide exclusion criteria.

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

Related 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/sussa3007/mysql-mcp'

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