Skip to main content
Glama
apache
by apache

list_tables

Retrieve all tables from an IoTDB database using SQL queries managed by the IoTDB MCP Server for efficient schema exploration and data organization.

Instructions

List all tables in the IoTDB database.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'list_tables' tool. It uses the TableSessionPool to execute 'SHOW TABLES' SQL query, formats the results into a CSV-like text output with a custom header, and returns it wrapped in TextContent. This is specific to the 'table' SQL dialect branch.
    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

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

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