Skip to main content
Glama
apache
by apache

list_tables

Retrieve all table names from an IoTDB database to understand available data structures and access schema information.

Instructions

List all tables in the IoTDB database.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for list_tables tool. Executes 'SHOW TABLES' query using TableSessionPool and formats results as TextContent.
    @mcp.tool() async def list_tables() -> list[TextContent]: """List all tables in the IoTDB database.""" table_session = None try: table_session = session_pool.get_session() res = table_session.execute_query_statement("SHOW TABLES") result = ["Tables_in_" + db_config["database"]] # Header while res.has_next(): result.append(str(res.next().get_fields()[0])) table_session.close() return [TextContent(type="text", text="\n".join(result))] except Exception as e: if table_session: table_session.close() logger.error(f"Failed to list tables: {str(e)}") raise

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/apache/iotdb-mcp-server'

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