query_taos_db_data
Execute read-only SQL queries on TDengine databases to retrieve data, explore database structures, and investigate information directly from AI-powered tools.
Instructions
Important: Run a read-only SQL query on Taos database(涛思数据库).
Args:
sql_stmt (str): The sql statement you want to retrieve data from taos db.
Returns:
List: All data from the specified table.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql_stmt | Yes | The sql statement you want to retrieve data from taos db |
Implementation Reference
- The implementation of the `query_taos_db_data` tool handler in the `tdengine_mcp_server`.
@mcp.tool(name="query_taos_db_data") def query_taos_db_data( ctx: Context, sql_stmt: str = Field( description="The sql statement you want to retrieve data from taos db" ), ) -> TaosSqlResponse: """**Important**: Run a read-only SQL query on `Taos database(涛思数据库)`. Args: sql_stmt (str): The sql statement you want to retrieve data from taos db. Returns: List: All data from the specified table. """ taos = ctx.request_context.lifespan_context.client return taos.execute_sql(sql_stmt) # type: ignore