Skip to main content
Glama
kami2k1

MCP MySQL Server

by kami2k1
list_tables_tool.py963 B
from typing import Dict, Any from .base_tool import BaseTool from src.database.query_executor import query_executor import logging logger = logging.getLogger(__name__) class ListTablesTool(BaseTool): def __init__(self): super().__init__( name="list_tables", description="List all tables in the database with metadata" ) def execute(self, **kwargs) -> Dict[str, Any]: try: # Get all tables tables = query_executor.get_tables() # Organize results result = { 'total_tables': len(tables), 'tables': tables } logger.info(f"Listed {len(tables)} tables") return self.format_response(True, result) except Exception as e: logger.error(f"List tables tool failed: {str(e)}") return self.format_response(False, error=str(e))

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/kami2k1/MCP-MYSQL'

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