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"]
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic function. It doesn't disclose whether this is a read-only operation, requires database connection, has rate limits, returns metadata format, or any behavioral traits beyond the minimal purpose.

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, efficient sentence that communicates the core purpose without any wasted words. It's appropriately sized for a simple tool with one parameter and is front-loaded with the essential information.

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?

For a tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what 'structure' means (columns, types, constraints?), whether a database connection is required, or what format the output takes, leaving significant gaps for agent understanding.

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?

The schema description coverage is 100% (the 'table' parameter is fully documented in the schema), so the baseline is 3. The description doesn't add any parameter meaning beyond what's already in the schema, but doesn't need to compensate for gaps either.

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 ('Get the structure') and target resource ('a specific table'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'list_tables' or 'query' beyond the basic function.

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 about when to use this tool versus alternatives like 'list_tables' (which lists tables) or 'query' (which might return table structure through SQL). The description only states what it does, not when it should be selected.

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

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