Skip to main content
Glama
ajkeast

My Coding Buddy MCP Server

by ajkeast

list_databases

List all databases in a MySQL server and output the names as a formatted list, one per line, for easy inspection.

Instructions

List all databases in the MySQL server.

Returns: str: A formatted string containing all database names, one per line

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The `list_databases()` method on the `SQLTools` class. It opens a MySQL connection, executes 'SHOW DATABASES', and returns the database names as a newline-separated string.
    def list_databases(self) -> str:
        """List all databases in the MySQL server.
        
        Returns:
            str: A formatted string containing all database names, one per line
        """
        with self.get_connection() as conn:
            cursor = conn.cursor()
            cursor.execute("SHOW DATABASES")
            databases = [db[0] for db in cursor.fetchall()]
            return "\n".join(databases)
  • server.py:11-11 (registration)
    The tool is registered as an MCP tool on the 'CodingBuddy' server via `mcp.tool()(sql_tools.list_databases)`.
    mcp.tool()(sql_tools.list_databases)
  • The `get_connection()` context manager used by `list_databases()` to obtain a MySQL database connection with credentials from environment variables.
    @contextmanager
    def get_connection(self):
        """Context manager for database connections.
        
        Yields:
            mysql.connector.connection: Database connection object
            
        Raises:
            Error: If connection to the database fails
        """
        connection = None
        try:
            connection = mysql.connector.connect(
                host=self.host,
                user=self.user,
                password=self.password,
                database=self.database
            )
            yield connection
        except Error as e:
            print(f"Error connecting to MySQL database: {e}")
            raise
        finally:
            if connection and connection.is_connected():
                connection.close()
Behavior2/5

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

No annotations are provided, so the description must disclose behavior. It only states the action and return type but does not mention that it is a read-only operation, any authentication needs, or performance considerations.

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 one concise sentence plus a return type hint, front-loading the purpose. Every part is essential with no wasted words.

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 the simplicity of the tool (no parameters, straightforward output), the description is complete. The output schema covers return values, so the description need not elaborate further.

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?

With zero parameters, the baseline is 4. The description adds no semantic value beyond the empty schema, but the schema already covers parameter semantics fully.

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 'List all databases in the MySQL server,' using a specific verb and resource. It distinguishes from sibling tools like list_tables and execute_query by targeting databases specifically.

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 on when to use this tool vs alternatives. Despite being a simple list, the description does not mention that other tools are for tables or queries, leaving the agent to infer context.

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/ajkeast/Coding-Buddy-MCP-Server'

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