list_tables
Retrieve a list of all tables in a MySQL database using the MCP MySQL Server, enabling efficient database schema management and querying.
Instructions
List all tables in the database
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:587-597 (handler)The handler function for the 'list_tables' tool. It executes the MySQL 'SHOW TABLES' query using the shared executeQuery method and returns the result as a JSON-formatted text content block.private async handleListTables() { const rows = await this.executeQuery('SHOW TABLES'); return { content: [ { type: 'text', text: JSON.stringify(rows, null, 2), }, ], }; }
- src/index.ts:417-425 (registration)Tool registration in the ListToolsRequestSchema response, defining the name, description, and empty input schema (no parameters required).{ name: 'list_tables', description: 'List all tables in the database', inputSchema: { type: 'object', properties: {}, required: [], }, },
- src/index.ts:420-424 (schema)Input schema definition for the list_tables tool, specifying an empty object (no input parameters required).inputSchema: { type: 'object', properties: {}, required: [], },
- src/index.ts:525-526 (registration)Dispatch/registration in the CallToolRequestSchema handler switch statement, routing calls to the handleListTables method.case 'list_tables': return await this.handleListTables();