Skip to main content
Glama
xiangma9712

MySQL MCP Server

list_tables

Retrieve a list of database tables to view available data structures and understand database organization for query planning.

Instructions

Retrieves a list of tables in the database.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for the 'list_tables' tool: executes a SQL query to fetch table names from information_schema.TABLES for the current database and returns the result as JSON.
    case "list_tables": {
      const [rows] = await connection.query(
        "SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = ?",
        [process.env.MYSQL_DATABASE]
      );
      return {
        content: [{ type: "text", text: JSON.stringify(rows, null, 2) }],
        isError: false,
      };
    }
  • src/index.ts:61-67 (registration)
    Registration of the 'list_tables' tool in the ListToolsRequestHandler response, defining its name, description, and empty input schema (no parameters required).
    {
      name: "list_tables",
      description: "Retrieves a list of tables in the database.",
      inputSchema: {
        type: "object",
      },
    },
  • Schema definition for 'list_tables' tool: input is an empty object (no required parameters).
    {
      name: "list_tables",
      description: "Retrieves a list of tables in the database.",
      inputSchema: {
        type: "object",
      },
    },
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states it 'retrieves' data (implying read-only), but doesn't mention any constraints like permissions needed, rate limits, pagination, or what format the list returns. This leaves significant behavioral gaps for a tool with zero annotation coverage.

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, clear sentence with no wasted words. It's front-loaded with the core purpose and efficiently communicates the essential function without redundancy or fluff.

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?

For a simple list-retrieval tool with no parameters and no output schema, the description is minimally adequate. However, without annotations or output details, it lacks completeness regarding behavioral aspects like return format or constraints. It meets basic needs but has clear gaps in context.

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 0 parameters, and schema description coverage is 100% (though trivial since there's no schema). The description doesn't need to explain parameters, so it appropriately avoids unnecessary detail. A baseline of 4 is justified as it doesn't mislead about parameters that don't exist.

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 ('Retrieves') and resource ('list of tables in the database'), making the tool's purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'describe_table' or 'query', which prevents a perfect score.

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 like 'describe_table' (for table details) or 'query' (for data retrieval). The description only states what it does, not when it's appropriate, leaving the agent to infer usage 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/xiangma9712/mysql-mcp-server'

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