Skip to main content
Glama

MCP-MySQL Server

by enemyrr

list_tables

Retrieve a list of all tables in your MySQL database using this tool. Simplify schema management and streamline database operations for enhanced efficiency.

Instructions

List all tables in the database

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "required": [], "type": "object" }

Implementation Reference

  • The handler function that executes the 'SHOW TABLES' query and returns the list of tables as JSON text content.
    private async handleListTables() { const rows = await this.executeQuery('SHOW TABLES'); return { content: [ { type: 'text', text: JSON.stringify(rows, null, 2), }, ], }; }
  • Input schema for the list_tables tool, which takes no parameters.
    inputSchema: { type: 'object', properties: {}, required: [], },
  • src/index.ts:468-475 (registration)
    Registration of the list_tables tool in the tools array, defining its name, description, and input schema.
    name: 'list_tables', description: 'List all tables in the database', inputSchema: { type: 'object', properties: {}, required: [], }, },
  • src/index.ts:577-578 (registration)
    Dispatch in the request handler switch statement that routes 'list_tables' calls to the handler function.
    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/enemyrr/mcp-mysql-server'

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