Skip to main content
Glama
yaoxiaolinglong

MCP-MongoDB-MySQL-Server

describe_table

Retrieve table structure details including columns, data types, and constraints for database analysis and schema understanding.

Instructions

Get table structure

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableYesTable name

Implementation Reference

  • The handler function that implements the core logic of the describe_table tool. It ensures a database connection, validates the table argument, executes a MySQL DESCRIBE query, and returns the table structure as JSON.
    private async handleDescribeTable(args: any) {
      await this.ensureConnection();
    
      if (!args.table) {
        throw new McpError(ErrorCode.InvalidParams, 'Table name is required');
      }
    
      try {
        const [rows] = await this.connection!.query('DESCRIBE ??', [args.table]);
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(rows, null, 2),
            },
          ],
        };
      } catch (error) {
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to describe table: ${getErrorMessage(error)}`
        );
      }
    }
  • Input schema defining the parameters for the describe_table tool, requiring a 'table' string.
    inputSchema: {
      type: 'object',
      properties: {
        table: {
          type: 'string',
          description: 'Table name',
        },
      },
      required: ['table'],
    },
  • src/index.ts:310-323 (registration)
    Tool registration in the ListTools response, including name, description, and schema.
    {
      name: 'describe_table',
      description: 'Get table structure',
      inputSchema: {
        type: 'object',
        properties: {
          table: {
            type: 'string',
            description: 'Table name',
          },
        },
        required: ['table'],
      },
    },
  • src/index.ts:545-546 (registration)
    Dispatch case in the CallToolRequestSchema handler that routes to the describe_table handler.
    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 the full burden of behavioral disclosure. 'Get table structure' implies a read-only operation, but it doesn't specify what 'structure' includes (e.g., columns, data types, constraints), whether it requires specific permissions, or how errors are handled (e.g., if the table doesn't exist). This leaves significant gaps for a tool with no 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 extremely concise at three words, with zero wasted language. It's front-loaded with the core action ('Get'), making it easy to scan and understand quickly. Every word earns its place by contributing to the tool's purpose.

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 complexity of database operations and the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'structure' entails (e.g., schema details), potential outputs, or error conditions, which are critical for an agent to use this tool effectively in context with siblings like 'query' or 'create_table'.

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 input schema has 100% description coverage, with the 'table' parameter clearly documented as 'Table name'. The description adds no additional meaning beyond this, as it doesn't elaborate on parameter syntax, format, or examples. With high schema coverage, the baseline score of 3 is appropriate, as the schema does the heavy lifting.

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 indicates the tool retrieves metadata about a database table, which is a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'list_tables' (which likely lists table names) or 'query' (which might return data from tables), leaving room for ambiguity about its exact scope compared to alternatives.

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. It doesn't mention prerequisites (e.g., needing a connected database), exclusions (e.g., not for querying data), or comparisons to siblings like 'list_tables' or 'query', leaving the agent to infer usage context from the tool name alone.

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

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