Skip to main content
Glama
yawlhead91

MariaDB MCP Server

by yawlhead91

list_databases

Retrieve all accessible database names from a MariaDB server to explore available data sources and manage connections.

Instructions

List all accessible databases in the MariaDB server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'list_databases' tool. It executes a 'SHOW DATABASES' SQL query using the shared MariaDB connection pool, extracts database names from the results, logs the operation, and returns a formatted list of available databases or an error message.
    @mcp.tool()
    async def list_databases() -> str:
        """List all accessible databases in the MariaDB server."""
        logger.info("Tool called: list_databases")
        try:
            query = "SHOW DATABASES"
            results = await db_connection.execute_query(query)
            
            databases = [row['Database'] for row in results]
            logger.info(f"Found {len(databases)} databases")
            return f"Available databases ({len(databases)}):\n" + "\n".join(f"- {db}" for db in databases)
        
        except Exception as e:
            logger.error(f"Error listing databases: {e}")
            return f"Error listing databases: {str(e)}"
  • Registers the 'list_databases' tool with the FastMCP server using the @mcp.tool() decorator.
    @mcp.tool()
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool lists databases but doesn't describe what 'accessible' means (e.g., permission-based filtering), whether the list is paginated or sorted, or what happens if no databases are accessible. This leaves significant gaps in understanding the tool's behavior.

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, efficient sentence that front-loads the core purpose without any wasted words. It directly answers 'what does this tool do?' in a clear and structured manner, making it easy for an agent to parse quickly.

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?

Given the tool's simplicity (0 parameters, no annotations, but with an output schema), the description is minimally adequate. It states the action and resource but lacks details on behavioral aspects like permissions or output format. The presence of an output schema reduces the need to explain return values, but more context on accessibility would improve completeness.

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 description coverage is 100%, so there are no parameters to document. The description appropriately doesn't discuss parameters, which is correct for this case. A baseline of 4 is applied since no parameter information is needed or expected.

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 action ('List') and resource ('all accessible databases in the MariaDB server'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'list_tables' or 'get_table_schema', which would require mentioning it operates at the database level rather than table or schema level.

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 like 'list_tables' or 'execute_sql'. It doesn't mention prerequisites (e.g., needing database access) or exclusions, leaving the agent to infer usage context from the tool name alone.

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

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