Skip to main content
Glama
Teradata

Teradata MCP Server

Official
by Teradata

qlty_distinctCategories

Extract unique categories from a specified column in a Teradata database table to assess data quality or analyze column values. Requires database, table, and column names as inputs.

Instructions

Get the destinct categories from column in a table.

Arguments: database_name - name of the database table_name - table name to analyze column_name - column name to analyze

Returns: ResponseType: formatted response with query results + metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
col_nameYes
database_nameYes
table_nameYes

Implementation Reference

  • Handler function implementing the qlty_distinctCategories tool. It connects to Teradata, executes TD_CategoricalSummary on the specified table and column to get distinct categories, formats the results, and returns a response with metadata.
    def handle_qlty_distinctCategories( conn: TeradataConnection, database_name: str | None, table_name: str, column_name: str, *args, **kwargs ): """ Get the destinct categories from column in a table. Arguments: database_name - name of the database table_name - table name to analyze column_name - column name to analyze Returns: ResponseType: formatted response with query results + metadata """ logger.debug(f"Tool: handle_qlty_distinctCategories: Args: table_name: {database_name}.{table_name}, column_name: {column_name}") if database_name is not None: table_name = f"{database_name}.{table_name}" with conn.cursor() as cur: rows = cur.execute(f"select * from TD_CategoricalSummary ( on {table_name} as InputTable using TargetColumns ('{column_name}')) as dt") data = rows_to_json(cur.description, rows.fetchall()) metadata = { "tool_name": "qlty_distinctCategories", "database_name": database_name, "table_name": table_name, "column_name": column_name, "distinct_categories": len(data) } logger.debug(f"Tool: handle_qlty_distinctCategories: Metadata: {metadata}") return create_response(data, metadata)

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/Teradata/teradata-mcp-server'

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