Skip to main content
Glama
kpconnell
by kpconnell

connection_status

Display connection status for databases. Show user, engine, and expiration time for each active connection.

Instructions

Show whether you're connected and, for each available database connection, which user and engine it uses and when it expires.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The 'connection_status' tool handler function. Calls deps.creds.status() to get the current ConnectionStatus array, then formats a human-readable string showing each connection's name, engine, username, and expiry time (or 'expired' status). Returns the joined lines as toolText.
    // ─── connection_status ───────────────────────────────────────────────
    
    function connectionStatus(deps: Deps): ToolDef {
      return {
        name: 'connection_status',
        description:
          "Show whether you're connected and, for each available database connection, " +
          'which user and engine it uses and when it expires.',
        inputSchema: {
          type: 'object',
          additionalProperties: { not: {} },
        },
        async handler() {
          const status = deps.creds.status();
          if (!status.connected) {
            return toolText('Not connected. Run any database tool to authenticate.');
          }
          if (status.connections.length === 0) {
            return toolText('Connected, but the OAuth backend returned no database connections.');
          }
          const parts: string[] = [];
          for (const c of status.connections) {
            let line = `${c.name} (${c.engine}) — user ${c.username}`;
            if (c.expires_at) {
              const remaining = new Date(c.expires_at).getTime() - Date.now();
              if (remaining <= 0) {
                line += '; expired, next query will reauthenticate';
              } else {
                const h = Math.floor(remaining / 3600_000);
                const m = Math.floor((remaining % 3600_000) / 60_000);
                line += `; expires in ${h}h ${m}m`;
              }
            }
            parts.push(line);
          }
          return toolText(parts.join('\n'));
        },
      };
    }
  • The input schema for connection_status: an object with no properties (additionalProperties: { not: {} }) meaning it takes no arguments.
    function connectionStatus(deps: Deps): ToolDef {
      return {
        name: 'connection_status',
        description:
          "Show whether you're connected and, for each available database connection, " +
          'which user and engine it uses and when it expires.',
        inputSchema: {
          type: 'object',
          additionalProperties: { not: {} },
        },
  • src/mcp/tools.ts:23-31 (registration)
    The connectionStatus function is called in buildTools() at line 25, registering the 'connection_status' tool in the list of all five MCP tools.
    export function buildTools(deps: Deps): ToolDef[] {
      return [
        connectionStatus(deps),
        disconnect(deps),
        listConnections(deps),
        listSchema(deps),
        queryDatabase(deps),
      ];
    }
  • The ConnectionStatus interface used by the handler, defining fields: name, engine, username, databases, and optional expires_at.
    export interface ConnectionStatus {
      name: string;
      engine: string;
      username: string;
      databases: string[];
      expires_at?: string;
    }
  • The CredsCache.status() method that returns the Status object (connected boolean + array of ConnectionStatus). It maps the internal token's connections to the public ConnectionStatus type.
    status(): Status {
      if (this.token === null) return { connected: false, connections: [] };
      const conns: ConnectionStatus[] = this.token.connections.map((c) => ({
        name: c.name,
        engine: c.engine,
        username: c.username,
        databases: c.databases,
        expires_at:
          c.expiresAt.getTime() === 0 ? undefined : c.expiresAt.toISOString(),
      }));
      return { connected: true, connections: conns };
    }
Behavior3/5

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

Discloses that it shows connection details but does not mention side effects, authentication, or behavior when not connected; acceptable for a read-only status check.

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?

Single sentence with clear structure, no unnecessary words.

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

Completeness4/5

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

Describes what is shown (connection status, user, engine, expiration) but lacks details on return format; sufficient for a simple informational tool.

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

Parameters4/5

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

No parameters exist; baseline of 4 applies as schema coverage is 100% and description adds context beyond the empty schema.

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

Purpose5/5

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

The description clearly states the tool shows connection status and includes user, engine, and expiration for each database connection, differentiating it from siblings like list_connections or disconnect.

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?

No guidance on when to use this tool versus alternatives; does not specify use cases or when not to use.

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/kpconnell/db-oauth-mcp-node'

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