Skip to main content
Glama

MCP Universal DB Client

disconnect_all

Close all active database connections to free up resources and manage connection pools across PostgreSQL, MySQL, and SQLite databases.

Instructions

Disconnect all active database connections

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "type": "object" }

Implementation Reference

  • Inline handler function for the 'disconnect_all' tool. It calls deleteAllConnections on the global DatabaseConnections instance and returns a success message.
    async () => { await databaseConnections.deleteAllConnections(); return { content: [ { type: "text", text: "All connections have been disconnected.", }, ], }; }
  • src/index.ts:87-104 (registration)
    Registration of the 'disconnect_all' tool using mcpServer.registerTool, specifying title, description (no input schema), and the inline handler.
    mcpServer.registerTool( "disconnect_all", { title: "Disconnect All", description: "Disconnect all active database connections", }, async () => { await databaseConnections.deleteAllConnections(); return { content: [ { type: "text", text: "All connections have been disconnected.", }, ], }; } );
  • The deleteAllConnections method in DatabaseConnections class, which closes all database connections by destroying their Kysely instances and clearing the connections map.
    public async deleteAllConnections() { for (const [name, conn] of this.connections.entries()) { await conn.instance.destroy(); this.connections.delete(name); } }

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/IzumiSy/mcp-universal-db-client'

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