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"]
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.3/5.0
Behavior2/5

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

No annotations provided, so description carries full burden. It only states the action without detailing side effects, error states (e.g., if already disconnected), or transaction handling.

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?

Single sentence, no wasted words. However, could include additional context without being verbose.

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 tool simplicity, description covers the basic action but omits prerequisites (e.g., must be connected) and return behavior. Adequate but not comprehensive.

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

Parameters2/5

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

Schema coverage is 100% with a single required dummy parameter described in schema. Description adds no meaning beyond the schema, failing to explain why the parameter exists.

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 'Close the current MySQL database connection' uses a specific verb ('Close') and resource ('current MySQL database connection'), clearly distinguishing it from sibling tools like 'connect'.

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

Usage Guidelines3/5

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

No explicit guidance on when to use this tool versus alternatives. While the purpose is obvious (after queries are done), the description lacks when-not or prerequisites.

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

Deploy Server

Other Tools

Related Tools