get_field_infos
Retrieve field information for a specified stable in TDengine databases to understand data structure and schema details for query planning.
Instructions
Get the field information of the specified stable.
Args:
db_name (Optional[str]): The name of the database. Defaults to None. When the value is None, it means the configured database is used.
stable_name (str): The name of the stable.
Returns:
TaosSqlResponse: The field information of the specified stable.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| db_name | No | The name of the database. Default is None which means the configured database. | |
| stable_name | Yes | The name of the stable |
Implementation Reference
- The get_field_infos tool handler, which describes a stable in TDengine.
@mcp.tool(name="get_field_infos") def get_field_infos( ctx: Context, db_name: Optional[str] = Field( None, description="The name of the database. Default is None which means the configured database.", ), stable_name: str = Field(description="The name of the stable"), ) -> TaosSqlResponse: """Get the field information of the specified stable. Args: db_name (Optional[str]): The name of the database. Defaults to None. When the value is None, it means the configured database is used. stable_name (str): The name of the stable. Returns: TaosSqlResponse: The field information of the specified stable. """ taos = ctx.request_context.lifespan_context.client if db_name is None or db_name == "": db_name = taos.database result = taos.execute_sql(f"DESCRIBE {db_name}.{stable_name};") return result