Skip to main content
Glama
kpconnell
by kpconnell

list_connections

Lists available database connections in the current session, showing name, engine type, and accessible databases. Triggers authentication if not yet connected.

Instructions

List the database connections available in the current session. Returns the name (pass to query_database / list_schema via the connection argument), engine type (mariadb or mssql), and the databases each connection grants access to. Calling this will trigger authentication if not yet connected.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The `listConnections` function returns a ToolDef with handler that gets the OAuth token from deps.creds.get(), maps each connection's name, engine, databases and expires_at to a JSON response.
    function listConnections(deps: Deps): ToolDef {
      return {
        name: 'list_connections',
        description:
          'List the database connections available in the current session. Returns the ' +
          'name (pass to `query_database` / `list_schema` via the `connection` argument), engine ' +
          'type (`mariadb` or `mssql`), and the databases each connection grants access to. ' +
          'Calling this will trigger authentication if not yet connected.',
        inputSchema: {
          type: 'object',
          additionalProperties: { not: {} },
        },
        async handler() {
          try {
            const token = await deps.creds.get();
            const out = token.connections.map((c) => ({
              name: c.name,
              engine: c.engine,
              databases: c.databases,
              expires_at:
                c.expiresAt.getTime() === 0
                  ? undefined
                  : c.expiresAt.toISOString().replace(/\.\d+Z$/u, 'Z'),
            }));
            return toolText(JSON.stringify(out, null, 2));
          } catch (err) {
            return toolError(`authorize failed: ${(err as Error).message}`);
          }
        },
      };
    }
  • Input schema for list_connections: empty object with no additional properties (no arguments required).
    inputSchema: {
      type: 'object',
      additionalProperties: { not: {} },
    },
  • src/mcp/tools.ts:23-31 (registration)
    The `buildTools()` function registers `listConnections(deps)` as one of five tools in the returned array.
    export function buildTools(deps: Deps): ToolDef[] {
      return [
        connectionStatus(deps),
        disconnect(deps),
        listConnections(deps),
        listSchema(deps),
        queryDatabase(deps),
      ];
    }
Behavior4/5

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

Without annotations, the description carries the full behavioral burden. It discloses that calling will trigger authentication if not connected, a useful side effect. No further behavioral details are needed for a listing tool.

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?

Two sentences, clear and front-loaded with purpose. Every sentence adds value; no fluff.

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

Completeness5/5

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

Given no output schema, the description adequately explains what is returned. It is complete for the tool's simplicity.

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?

The tool has zero parameters and schema coverage is 100%, so the description adds no parameter-specific meaning. Baseline 4 is appropriate.

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 lists database connections in the current session and specifies the return fields (name, engine type, databases). It is distinct from siblings like connection_status or query_database.

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

Usage Guidelines4/5

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

The description indicates the returned name can be passed to query_database and list_schema, providing usage context. It mentions authentication triggering, but does not explicitly contrast with alternatives like connection_status 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