Skip to main content
Glama
cemalturkcan

MariaDB MCP Server

by cemalturkcan

list_connections

Retrieve a list of all configured database connections in the MariaDB MCP Server, enabling you to view available connections for running queries or managing schemas.

Instructions

Lists configured MariaDB connections.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for list_connections tool: iterates over all configured connections, retrieves each connection config via db.getConnectionConfig(), and returns an array of connection details (name, description, host, port, database, read/write permissions, timeout, and row limits).
    case "list_connections": {
      const list = allConnections.map((connectionName) => {
        const c = db.getConnectionConfig(connectionName);
        return {
          name: connectionName,
          description: c.description,
          host: c.host,
          port: c.port,
          database: c.database,
          read: c.read,
          write: c.write,
          ...(c.statement_timeout_ms > 0 && {
            statement_timeout_ms: c.statement_timeout_ms,
          }),
          ...(c.default_row_limit > 0 && {
            default_row_limit: c.default_row_limit,
          }),
          ...(c.max_row_limit > 0 && { max_row_limit: c.max_row_limit }),
        };
      });
      return ok(list);
    }
  • Tool definition schema for list_connections: declares the tool name, description ('Lists configured MariaDB connections.'), and an empty inputSchema (no required parameters).
    {
      name: "list_connections",
      description: "Lists configured MariaDB connections.",
      inputSchema: { type: "object", properties: {} },
    },
  • src/index.js:31-37 (registration)
    Tool registration via ListToolsRequestSchema handler which calls buildToolDefinitions() to return all tool definitions including list_connections.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: buildToolDefinitions(
        readableConnections,
        writableConnections,
        allConnections,
      ),
    }));
  • Helper method getConnectionConfig() used by the list_connections handler to retrieve configuration details for each named connection.
    getConnectionConfig(name) {
      const cfg = this.config.connections[name];
      if (!cfg) {
        const available = this.getConnectionNames().join(", ");
        throw new Error(
          `Connection not found: '${name}'. Available connections: ${available}`,
        );
      }
      return cfg;
    }
  • Helper method getConnectionNames() used by the list_connections handler to get all configured connection names.
    getConnectionNames() {
      return Object.keys(this.config.connections);
    }
Behavior2/5

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

With no annotations, the description carries the full burden but only repeats the tool name. It does not disclose any behavioral traits (e.g., read-only, returned format).

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 a single, concise sentence with no unnecessary words, earning its place.

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

Completeness3/5

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

For a simple list operation with no parameters or output schema, the description is adequate but lacks context about connections or how to interpret results.

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?

There are no parameters, so the schema coverage is 100%. The description adds no value beyond the empty schema, meeting baseline.

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 action (list) and resource (configured MariaDB connections), making it distinct from sibling tools like describe_table or list_tables.

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 is provided on when to use this tool versus alternatives, nor are there any prerequisites or context for usage.

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/cemalturkcan/mariadb-mcp-server'

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