Skip to main content
Glama
enemyrr

MCP-MySQL Server

describe_table

Retrieve the structure of a specified MySQL table, including column details and data types, using the MCP-MySQL Server for schema management and database operations.

Instructions

Get table structure

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableYesTable name

Implementation Reference

  • The handler function that implements the describe_table tool by querying the INFORMATION_SCHEMA.COLUMNS table to retrieve and format the table structure.
    private async handleDescribeTable(args: any) {
      if (!args.table) {
        throw new McpError(ErrorCode.InvalidParams, 'Table name is required');
      }
    
      const rows = await this.executeQuery(
        `SELECT 
          COLUMN_NAME as Field,
          COLUMN_TYPE as Type,
          IS_NULLABLE as \`Null\`,
          COLUMN_KEY as \`Key\`,
          COLUMN_DEFAULT as \`Default\`,
          EXTRA as Extra,
          COLUMN_COMMENT as Comment
        FROM INFORMATION_SCHEMA.COLUMNS 
        WHERE TABLE_SCHEMA = ? AND TABLE_NAME = ?
        ORDER BY ORDINAL_POSITION`,
        [this.config!.database, args.table]
      );
    
      const formattedRows = (rows as any[]).map(row => ({
        ...row,
        Null: row.Null === 'YES' ? 'YES' : 'NO'
      }));
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(formattedRows, null, 2),
          },
        ],
      };
    }
  • Input schema defining the required 'table' parameter for the describe_table tool.
    inputSchema: {
      type: 'object',
      properties: {
        table: {
          type: 'string',
          description: 'Table name',
        },
      },
      required: ['table'],
    },
  • src/index.ts:476-489 (registration)
    Registration of the describe_table tool in the ListTools response, including name, description, and input schema.
    {
      name: 'describe_table',
      description: 'Get table structure',
      inputSchema: {
        type: 'object',
        properties: {
          table: {
            type: 'string',
            description: 'Table name',
          },
        },
        required: ['table'],
      },
    },
  • src/index.ts:579-580 (registration)
    Dispatcher case in CallToolRequest handler that routes 'describe_table' calls to the handleDescribeTable method.
    case 'describe_table':
      return await this.handleDescribeTable(request.params.arguments);
Behavior2/5

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

No annotations are provided, so the description carries full burden. 'Get table structure' implies a read-only operation but doesn't specify if it requires database permissions, returns error conditions, or details the output format. This leaves significant behavioral gaps for a tool that interacts with database structures.

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 just three words, front-loading the core purpose without any wasted text. This efficiency makes it easy to parse, though it may sacrifice detail for brevity.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'table structure' entails (e.g., columns, types, constraints) or handle potential complexities like non-existent tables, making it inadequate for a tool that likely returns detailed metadata.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the parameter 'table' clearly documented as 'Table name' in the schema. The description adds no additional meaning beyond this, such as format examples or constraints, so it meets the baseline for high schema coverage without enhancing parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get table structure' clearly states the action (get) and resource (table structure), making the purpose understandable. However, it doesn't distinguish this from potential sibling tools like 'list_tables' or 'query' that might also provide table-related information, keeping it at a basic level of clarity.

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. With siblings like 'list_tables' and 'query' available, there's no indication of whether this is for metadata retrieval, schema inspection, or other contexts, leaving usage ambiguous.

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

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/enemyrr/mcp-mysql-server'

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