Skip to main content
Glama
cemalturkcan

MariaDB MCP Server

by cemalturkcan

list_databases

Lists all databases for a specified MariaDB or MySQL connection, enabling you to view available schemas and explore the database structure.

Instructions

Lists databases for the selected connection.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
connectionYes

Implementation Reference

  • The handler for the 'list_databases' tool. It extracts the 'connection' argument from the request, validates it is present, then executes 'SHOW DATABASES' via db.runReadOnly and returns the results.
    case "list_databases": {
      const connection = args?.connection;
      if (!connection) return fail("'connection' field is required.");
      const rows = await db.runReadOnly(connection, "SHOW DATABASES");
      return ok(rows);
    }
  • The schema/tool definition for 'list_databases'. Defines the tool name, description, and input schema requiring a 'connection' parameter that references readable connections.
    name: "list_databases",
    description: "Lists databases for the selected connection.",
    inputSchema: {
      type: "object",
      properties: {
        connection: { type: "string", enum: readableConnections },
      },
      required: ["connection"],
    },
  • src/index.js:31-37 (registration)
    Registration of all tool definitions including 'list_databases' via the ListToolsRequestSchema handler, which calls buildToolDefinitions to produce the full tool list.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: buildToolDefinitions(
        readableConnections,
        writableConnections,
        allConnections,
      ),
    }));
  • The runReadOnly helper method used by the 'list_databases' handler. It asserts the connection is readable, obtains a connection from the pool, executes the SQL query (SHOW DATABASES), and releases the connection.
    async runReadOnly(connectionName, sql, options = {}) {
      this.assertReadable(connectionName);
      const database = options.database || null;
      const conn = await this.getPool(connectionName, database).getConnection();
      try {
        return await conn.query(sql);
      } finally {
        conn.release();
      }
    }
Behavior2/5

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

With no annotations, the description only states 'lists databases' without behavioral details such as read-only nature, authentication requirements, or output format. It adds no value beyond the obvious.

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, no wasted words. Properly front-loaded and appropriately sized for the tool's simplicity.

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?

Given no output schema and no annotations, the description is incomplete. It does not explain return format, scope (all databases?), or any side effects. For a list tool, more context is needed.

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

Parameters2/5

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

Schema description coverage is 0%. The description mentions 'selected connection' but does not clarify the connection parameter's meaning or relationship to list_connections. Minimal value added over the schema's enum.

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 databases for a selected connection. It uses a specific verb (Lists) and resource (databases), and distinguishes from sibling tools like list_tables and list_connections.

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 explicit guidance on when to use this tool versus alternatives. It does not mention when-not-to-use or provide context for selecting between siblings.

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