Skip to main content
Glama
bretoreta

MariaDB MCP Server

by bretoreta

describe_table

Retrieve and display the schema of a specified table in MariaDB/MySQL databases, enabling users to understand its structure and attributes quickly. Supports optional database selection for precise queries.

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. It validates the table parameter, optionally uses a database, executes a DESCRIBE SQL query, and returns the table schema as formatted JSON.
    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 its 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 describe_table tool defining required 'table' string and optional 'database' string.
    inputSchema: { type: "object", properties: { database: { type: "string" }, table: { type: "string" } }, required: ["table"], },

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

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