Skip to main content
Glama
itsalfredakku

Postgres MCP Server

connections

Manage PostgreSQL connection pools by checking status, viewing statistics, testing connections, or resetting the pool for database administration.

Instructions

Connection pool management: status, statistics, configuration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesAction: status (pool status), stats (detailed statistics), test (test connection), reset (reset pool)

Implementation Reference

  • JSON Schema definition for the 'connections' tool input parameters, defining actions like status, stats, test, reset.
    {
      name: 'connections',
      description: 'Connection pool management: status, statistics, configuration',
      inputSchema: {
        type: 'object',
        properties: {
          action: {
            type: 'string',
            enum: ['status', 'stats', 'test', 'reset'],
            description: 'Action: status (pool status), stats (detailed statistics), test (test connection), reset (reset pool)'
          }
        },
        required: ['action']
      }
  • Main handler function for the 'connections' tool. Dispatches to different actions (status, stats, test) using DatabaseConnectionManager methods and returns JSON-formatted results.
    private async handleConnections(args: any) {
      const { action } = args;
    
      switch (action) {
        case 'status':
          return {
            content: [{
              type: 'text',
              text: JSON.stringify(this.dbManager.getPoolStats(), null, 2)
            }]
          };
    
        case 'stats':
          return {
            content: [{
              type: 'text',
              text: JSON.stringify(this.dbManager.getOperationalStats(), null, 2)
            }]
          };
    
        case 'test':
          const isHealthy = await this.dbManager.testConnection();
          return {
            content: [{
              type: 'text',
              text: JSON.stringify({ connected: isHealthy, timestamp: new Date().toISOString() }, null, 2)
            }]
          };
    
        default:
          throw new Error(`Unknown connections action: ${action}`);
      }
    }
  • src/index.ts:634-636 (registration)
    Registration of tool list handler, which includes the 'connections' tool schema from toolDefinitions array.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: toolDefinitions,
    }));
  • src/index.ts:667-669 (registration)
    Dispatch/registration in the central CallToolRequestSchema handler switch statement, routing 'connections' calls to handleConnections.
    case 'connections':
      return await this.handleConnections(args);
  • Helper method getPoolStats() in DatabaseConnectionManager providing pool statistics used by connections tool status action. (Note: approximate lines from search; actual may vary slightly.)
      idleConnections: this.pool.idleCount,
      waitingCount: this.pool.waitingCount,
      config: {
        min: this.config.get().pool.min,
        max: this.config.get().pool.max,
        idleTimeoutMillis: this.config.get().pool.idleTimeoutMillis,
      }
    };
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'management' implies mutation capabilities, the description doesn't specify which actions require special permissions, whether operations are destructive, what side effects might occur (especially for 'reset'), or what the response format looks like. For a tool with potentially destructive operations like 'reset', this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise - a single phrase with three key areas separated by commas. Every word earns its place, and the structure is front-loaded with the core purpose immediately apparent. No wasted words or unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with potentially destructive operations (like 'reset') and no annotations or output schema, the description is incomplete. It doesn't explain what 'configuration' means in relation to the available actions, doesn't warn about the implications of 'reset', and provides no information about return values or error conditions. Given the complexity of connection pool management, more context is needed.

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

Parameters3/5

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

Schema description coverage is 100%, with the single parameter 'action' having a clear enum description. The description mentions 'status, statistics, configuration' which aligns with the enum values, but doesn't add meaningful semantic context beyond what the schema already provides. The baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose as 'Connection pool management: status, statistics, configuration' - it specifies the resource (connection pool) and the operations (management, status, statistics, configuration). However, it doesn't distinguish this tool from its siblings like 'admin', 'monitoring', or 'security', which might also involve system management functions.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'admin', 'monitoring', and 'security' that might overlap with system management functions, there's no indication of when this specific connection pool management tool is appropriate versus those other tools.

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

Install Server

Other 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/itsalfredakku/postgres-mcp'

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