describe_table
Retrieve schema details of a specific table in IoTDB MCP Server to understand its structure and metadata for efficient data management and querying.
Instructions
Get the schema information for a specific table Args: table_name: name of the table to describe
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table_name | Yes |
Implementation Reference
- src/iotdb_mcp_server/server.py:364-379 (handler)The main handler function for the 'describe_table' tool. It is registered via the @mcp.tool() decorator. The function retrieves a TableSession from the pool, executes a 'DESC {table_name} details' query to get schema information, and returns the formatted result using the shared prepare_res helper.@mcp.tool() async def describe_table(table_name: str) -> list[TextContent]: """Get the schema information for a specific table Args: table_name: name of the table to describe """ table_session = None try: table_session = session_pool.get_session() res = table_session.execute_query_statement("DESC " + table_name + " details") return prepare_res(res, table_session) except Exception as e: if table_session: table_session.close() logger.error(f"Failed to describe table {table_name}: {str(e)}") raise