Skip to main content
Glama
ajkeast

My Coding Buddy MCP Server

by ajkeast

list_views

List all views in the current database, returning each view name on a separate line.

Instructions

List all views in the current database.

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Handler function for list_views: executes 'SHOW FULL TABLES WHERE Table_type = 'VIEW'' and returns view names as a newline-separated string.
    def list_views(self) -> str:
        """List all views in the current database.
        
        Returns:
            str: A formatted string containing all view names, one per line
        """
        with self.get_connection() as conn:
            cursor = conn.cursor()
            cursor.execute("SHOW FULL TABLES WHERE Table_type = 'VIEW'")
            views = [view[0] for view in cursor.fetchall()]
            return "\n".join(views)
  • server.py:13-13 (registration)
    Registration of list_views as an MCP tool on the server using the @mcp.tool() decorator pattern.
    mcp.tool()(sql_tools.list_views)
  • Helper context manager that provides the database connection used by list_views and other SQL tools.
    @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()
Behavior4/5

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

The description explicitly states the return format as a formatted string with view names one per line. It implies no side effects, which is appropriate for a read-only tool. No annotations are present, so the description bears the full burden and does well.

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 extremely concise with two lines, no wasteful content. The purpose is front-loaded in the first sentence.

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

Completeness4/5

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

Given no parameters and a simple operation, the description covers the essential behavior (listing views) and return format. However, it could clarify what 'current database' means and if there are any access considerations.

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 no parameters, so schema coverage is 100%. The description adds value by explaining the return format, which is beyond the empty schema. Baseline for 0 params is 4.

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 views in the current database' with a specific verb and resource, and it distinguishes from sibling tools like list_tables (which lists tables) and list_databases.

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 (e.g., list_tables, list_columns). It does not mention when not to use it or any prerequisites.

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