describe_table
Retrieve column metadata for any MariaDB table to understand its structure, data types, and constraints.
Instructions
Returns column information for a table.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connection | Yes | ||
| table | Yes | ||
| database | No |
Implementation Reference
- src/tools.js:35-46 (schema)Schema definition for the 'describe_table' tool, including input properties (connection, table, database) and required fields (connection, table).
{ name: "describe_table", description: "Returns column information for a table.", inputSchema: { type: "object", properties: { connection: { type: "string", enum: readableConnections }, table: { type: "string" }, database: { type: "string" }, }, required: ["connection", "table"], }, - src/index.js:84-91 (handler)Handler for the 'describe_table' tool. Extracts connection, table, and database; validates required fields; builds a DESCRIBE SQL query and executes it via db.runReadOnly.
case "describe_table": { const { connection, table, database } = args || {}; if (!connection) return fail("'connection' field is required."); if (!table) return fail("'table' field is required."); const path = database ? `\`${database}\`.\`${table}\`` : `\`${table}\``; const rows = await db.runReadOnly(connection, `DESCRIBE ${path}`); return ok(rows); } - src/index.js:31-37 (registration)Registration of the 'describe_table' tool via ListToolsRequestSchema handler. buildToolDefinitions (from tools.js) returns the tool list which includes describe_table.
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: buildToolDefinitions( readableConnections, writableConnections, allConnections, ), }));