Skip to main content
Glama

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

NameRequiredDescriptionDefault
random_stringYesDummy parameter for no-parameter tools

Input Schema (JSON Schema)

{ "properties": { "random_string": { "description": "Dummy parameter for no-parameter tools", "type": "string" } }, "required": [ "random_string" ], "type": "object" }

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

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