Skip to main content
Glama

MCP Universal DB Client

list_connections

View all active database connections across PostgreSQL, MySQL, and SQLite databases to monitor current database sessions and manage connection resources.

Instructions

List all active database connections

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

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

Implementation Reference

  • Handler function for the 'list_connections' tool. Retrieves all database connections using DatabaseConnections.getAllConnections() and returns them as JSON in a text content block.
    async () => { const connections = databaseConnections.getAllConnections(); return { content: [ { type: "text", text: JSON.stringify({ connections: connections, }), }, ], }; }
  • src/index.ts:42-62 (registration)
    Registration of the 'list_connections' tool on the MCP server, including title, description, and inline handler function.
    mcpServer.registerTool( "list_connections", { title: "List Connections", description: "List all active database connections", }, async () => { const connections = databaseConnections.getAllConnections(); return { content: [ { type: "text", text: JSON.stringify({ connections: connections, }), }, ], }; } );
  • Helper method in DatabaseConnections class that returns an array of all active connections, including connectionID, dialect, and connectedAt timestamp.
    public getAllConnections() { return Array.from(this.connections.entries()).map( ([connectionID, conn]) => ({ connectionID, dialect: conn.dialect, connectedAt: conn.connectedAt, }) ); }

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