Skip to main content
Glama

list_tables

Retrieve a list of all tables within a MySQL database using the MCP MySQL Server. Simplify database exploration and management by accessing table information directly.

Instructions

List all tables in the database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Executes the list_tables tool: ensures connection, runs 'SHOW TABLES' query, returns results as formatted JSON text.
    private async handleListTables() { await this.ensureConnection(); try { const [rows] = await this.connection!.query('SHOW TABLES'); return { content: [ { type: 'text', text: JSON.stringify(rows, null, 2), }, ], }; } catch (error) { throw new McpError( ErrorCode.InternalError, `Failed to list tables: ${getErrorMessage(error)}` ); } }
  • src/index.ts:167-175 (registration)
    Registers the list_tables tool in the ListTools response with name, description, and input schema (no inputs required).
    { name: 'list_tables', description: 'List all tables in the database', inputSchema: { type: 'object', properties: {}, required: [], }, },
  • Input schema definition for list_tables: empty properties, no required fields.
    inputSchema: { type: 'object', properties: {}, required: [], },
  • src/index.ts:201-202 (registration)
    Dispatch case in CallToolRequestSchema handler that invokes the list_tables handler.
    case 'list_tables': return await this.handleListTables();

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/Atomzzm/mcp-mysql-server'

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