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"],
      },
    },

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/bretoreta/mariadb-mcp-server'

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