Skip to content

list_tables returns null values and describe_table fails with "table does not exist" for valid tables #23

@maMykola

Description

@maMykola

When using the MySQL MCP server, the list_tables and describe_table tools return incorrect results, even though the underlying database connection works correctly.

Environment

  • Package: @executeautomation/database-server (latest via npx -y)
  • Database: MySQL 8.0 (AWS RDS)
  • Claude Code: 2.0.54

Steps to Reproduce

  1. Configure the MCP server with valid MySQL credentials
  2. Verify connection works with read_query:
SELECT 1 AS test;  -- Returns: [{"test": 1}] ✓
  1. Call list_tables tool
  2. Call describe_table with a valid table name (e.g., user)

Expected Behavior

  • list_tables should return an array of table names
  • describe_table should return column definitions for existing tables

Actual Behavior

list_tables:
Returns an array of null values matching the table count (748 tables → 748 nulls):
[null, null, null, null, ...]

describe_table:
Returns error for tables that definitely exist:
{"error": "Error describing table: Table 'user' does not exist"}

Workaround

Direct SQL queries against information_schema work correctly:
-- list_tables workaround

SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE();

-- describe_table workaround

SELECT COLUMN_NAME, DATA_TYPE, IS_NULLABLE, COLUMN_KEY
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'user';

Suspected Cause

  • list_tables: Result row parsing issue - possibly accessing wrong property from SHOW TABLES result format
  • describe_table: Missing database qualification or incorrect empty result check

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions