Skip to main content
Glama
Abeautifulsnow

TDengine Query MCP Server

test_table_exists

Check if a specified stable exists in the current TDengine database configuration. Verify table presence before performing database operations.

Instructions

Important: Check if the stable exists in the current Taos database(涛思数据库) configuration.

    Args:
        stable_name (str): The name of the stable.

    Returns:
        Dict: The `stable_name` exists or not in the current Taos configuration. If the `stable_name` does not exist, an empty dictionary is returned.

        The key of the dictionary is the `stable_name` name, and the value is a boolean indicating whether the `stable_name` exists.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stable_nameYesThe name of the stable

Implementation Reference

  • Implementation of the "test_table_exists" tool, which checks for the existence of a stable in the TDengine database by executing a SHOW STABLES LIKE query.
    @mcp.tool(name="test_table_exists")
    def test_table_exists(
        ctx: Context,
        stable_name: str = Field(description="The name of the stable"),
    ) -> Dict[str, bool]:
        """**Important**: Check if the `stable` exists in the current `Taos database(涛思数据库)` configuration.
    
        Args:
            stable_name (str): The name of the stable.
    
        Returns:
            Dict: The `stable_name` exists or not in the current Taos configuration. If the `stable_name` does not exist, an empty dictionary is returned.
    
            The key of the dictionary is the `stable_name` name, and the value is a boolean indicating whether the `stable_name` exists.
        """
    
        taos = ctx.request_context.lifespan_context.client
        query = f"SHOW STABLES LIKE '{stable_name}'"
        result = taos.execute_sql(query)
        return {stable_name: bool(result)}

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/Abeautifulsnow/tdengine-mcp'

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