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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:493-516 (handler)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", }, ], }; } }
- src/index.ts:232-239 (schema)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();