Skip to main content
Glama
sussa3007

MySql MCP Server

describe_table

Retrieve the structure of a specific MySQL table to analyze its columns, data types, and schema details for efficient database management and query optimization.

Instructions

Get the structure of a specific table.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableYesName of the table to describe

Implementation Reference

  • The handler function for the 'describe_table' tool. It validates the table name parameter, executes a DESCRIBE SQL query using the shared executeQuery helper, and returns the table structure as JSON or an error message.
    case "describe_table": {
      try {
        const tableName = request.params.arguments?.table as string;
    
        if (!tableName) {
          throw new Error("Table name is required");
        }
    
        const rows = await executeQuery("DESCRIBE ??", [tableName]);
    
        return {
          content: [{ type: "text", text: JSON.stringify(rows, null, 2) }],
          isError: false
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text:
                error instanceof Error
                  ? error.message
                  : "Unknown error occurred"
            }
          ],
          isError: true
        };
      }
    }
  • src/index.ts:217-230 (registration)
    Registration of the 'describe_table' tool in the ListTools response, including its name, description, and input schema definition.
    {
      name: "describe_table",
      description: "Get the structure of a specific table.",
      inputSchema: {
        type: "object",
        properties: {
          table: {
            type: "string",
            description: "Name of the table to describe"
          }
        },
        required: ["table"]
      }
    },
  • Input schema for the 'describe_table' tool, defining the required 'table' string parameter.
    inputSchema: {
      type: "object",
      properties: {
        table: {
          type: "string",
          description: "Name of the table to describe"
        }
      },
      required: ["table"]
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
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. It does not disclose any behavioral traits such as safety, permissions, or potential effects. A read operation like 'get' could be assumed safe, but it's not stated.

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?

Single sentence, no wasted words. Front-loaded with clear action and resource.

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?

For a simple tool with one parameter and no output schema, the description is complete enough. It could optionally mention that it returns column names and types, but the structure of a table implies that.

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% (the only parameter 'table' has a description in the schema). The tool description adds no additional meaning beyond what the schema already provides. Baseline 3 is appropriate.

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 'Get the structure of a specific table' uses a specific verb ('get') and clearly identifies the resource ('structure of a specific table'). It distinguishes this tool from siblings like 'list_tables' (which lists table names) and 'query' (which runs SQL).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use or not use this tool. The description implies using it when you need table schema, but does not mention alternatives or when to avoid it. It's minimally adequate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools

Related Tools