Skip to main content
Glama

list_tables

Display all tables within a MySQL database to understand database structure and available data. Specify database name or use default connection.

Instructions

List all tables in a specified database

Input Schema

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

Implementation Reference

  • Executes the list_tables tool by running 'SHOW FULL TABLES' SQL query on the specified or default database and returns the list of tables as JSON.
    case "list_tables": { console.error('[Tool] Executing list_tables'); const database = request.params.arguments?.database as string | undefined; const { rows } = await executeQuery( pool, 'SHOW FULL TABLES', [], database ); return { content: [{ type: "text", text: JSON.stringify(rows, null, 2) }] }; }
  • src/index.ts:75-88 (registration)
    Registers the list_tables tool with its description and input schema (optional database parameter) in the ListTools response.
    { name: "list_tables", description: "List all tables in a specified database", inputSchema: { type: "object", properties: { database: { type: "string", description: "Database name (optional, uses default if not specified)" } }, required: [] } },
  • Input schema definition for list_tables tool, specifying an optional 'database' string parameter.
    inputSchema: { type: "object", properties: { database: { type: "string", description: "Database name (optional, uses default if not specified)" } }, required: [] }

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/Himanshu-Agg12/mcp-mysql-lens'

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