Skip to main content
Glama
apache

IoTDB MCP Server

Official
by apache

describe_table

Retrieve schema information for a specific table in IoTDB, including column definitions and data types to understand database structure.

Instructions

Get the schema information for a specific table Args: table_name: name of the table to describe

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
table_nameYes

Implementation Reference

  • Handler function for the 'describe_table' tool. Decorated with @mcp.tool() for registration. Executes 'DESC {table_name} details' query on IoTDB table session and returns formatted schema via prepare_res.
    @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
  • Helper function prepare_res specific to table dialect, used by describe_table to format the query result into a list of TextContent objects.
    def prepare_res(
        _res: SessionDataSet, _table_session: TableSession
    ) -> list[TextContent]:
        columns = _res.get_column_names()
        result = []
        while _res.has_next():
            row = _res.next().get_fields()
            result.append(",".join(map(str, row)))
        _table_session.close()
        return [
            TextContent(
                type="text",
                text="\n".join([",".join(columns)] + result),
            )
        ]
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves schema information but doesn't describe what that includes (e.g., column names, types, constraints), whether it's a read-only operation, potential errors (e.g., if the table doesn't exist), or any rate limits. This leaves significant gaps in understanding the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with two sentences, but the structure could be improved. The first sentence states the purpose clearly, but the second sentence is formatted as an 'Args:' section, which might be redundant with the input schema. It's front-loaded but includes unnecessary formatting that doesn't add value beyond the schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a schema retrieval tool with no annotations, no output schema, and low parameter documentation, the description is incomplete. It doesn't explain what the output includes (e.g., JSON structure, error handling), making it hard for an agent to use effectively without additional context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description must compensate for the lack of parameter documentation. It adds minimal meaning by specifying that 'table_name' is the 'name of the table to describe', but this is basic and doesn't provide details like format, constraints, or examples. For a single parameter with no schema documentation, this is inadequate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Get') and resource ('schema information for a specific table'), making it easy to understand what it does. However, it doesn't explicitly differentiate from sibling tools like 'list_tables' (which might list table names without schema details) or 'read_query' (which might execute queries rather than describe structure), missing full sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'list_tables' or 'export_table_query', nor does it specify prerequisites or contexts for use, leaving the agent to infer usage based on the purpose alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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