Skip to main content
Glama
yawlhead91

MariaDB MCP Server

by yawlhead91

list_databases

Retrieve a list of all accessible databases in the MariaDB server to facilitate database exploration and schema inspection with secure read-only operations.

Instructions

List all accessible databases in the MariaDB server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the list_databases tool, decorated with @mcp.tool() which registers it with the FastMCP server. Executes 'SHOW DATABASES' SQL query, processes results into a formatted list of database names, handles errors, and returns the result as a string.
    @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)}"

Other Tools

Related 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