Skip to main content
Glama
bretoreta

MariaDB MCP Server

by bretoreta

describe_table

Retrieve the schema for a MariaDB table to understand its structure, columns, and data types for database analysis or query planning.

Instructions

Show the schema for a specific table

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
databaseNoDatabase name (optional, uses default if not specified)
tableYesTable name

Implementation Reference

  • Handler for the 'describe_table' tool: validates input, executes DESCRIBE query on the table (optionally using specified database), and returns the result rows as formatted JSON text.
    case "describe_table": {
      const tbl = args.table as string;
      if (!tbl)
        throw new McpError(ErrorCode.InvalidParams, "`table` is required");
      const db = args.database as string | undefined;
      const { rows } = await executeQuery(`DESCRIBE \`${tbl}\``, [], db);
      return {
        content: [{ type: "text", text: JSON.stringify(rows, null, 2) }],
      };
    }
  • src/index.ts:95-103 (registration)
    Registration of the 'describe_table' tool in the ListTools response, including name, description, and input schema definition.
    {
      name: "describe_table",
      description: "Show schema of a table",
      inputSchema: {
        type: "object",
        properties: { database: { type: "string" }, table: { type: "string" } },
        required: ["table"],
      },
    },
  • Input schema for the 'describe_table' tool defining required 'table' parameter and optional 'database'.
      inputSchema: {
        type: "object",
        properties: { database: { type: "string" }, table: { type: "string" } },
        required: ["table"],
      },
    },

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.4/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 only states 'show the schema' without disclosing behavioral traits like read-only nature, required permissions, idempotency, or error handling. This is insufficient 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no waste. However, it could include a brief note on sibling differentiation or usage context, but overall it is appropriately concise.

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 introspection tool with two parameters and no output schema, the description is adequate but lacks details on return format, error cases, or prerequisites (e.g., table must exist). It does not reference siblings, leaving the agent to infer context.

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%, so the baseline is 3. The description adds no additional meaning beyond the schema (e.g., clarifying what 'table' or 'database' refer to). It does not enhance parameter semantics.

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?

"Show the schema for a specific table" uses a specific verb and resource, and clearly distinguishes from siblings like list_tables and execute_query.

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?

The description implies usage for schema retrieval, but provides no explicit guidance on when to use this tool vs alternatives like list_tables (which only lists names) or execute_query (for custom queries). No when-not-to-use or alternative mentions.

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