Skip to main content
Glama
Teradata

Teradata MCP Server

Official
by Teradata

qlty_distinctCategories

Extract unique values from a specified column in a Teradata database table to identify distinct categories for data analysis and quality assessment.

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
database_nameYes
table_nameYes
column_nameYes

Implementation Reference

  • Handler function that executes TD_CategoricalSummary to retrieve distinct categories for the specified column in a table, processes results, and returns formatted 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)
  • ModuleLoader.MODULE_MAP defines the mapping for 'qlty' module, enabling dynamic loading of qlty tools including handle_qlty_distinctCategories.
    MODULE_MAP = {
        'bar': 'teradata_mcp_server.tools.bar',
        'base': 'teradata_mcp_server.tools.base',
        'chat': 'teradata_mcp_server.tools.chat',
        'dba': 'teradata_mcp_server.tools.dba',
        'fs': 'teradata_mcp_server.tools.fs',
        'qlty': 'teradata_mcp_server.tools.qlty',
        'rag': 'teradata_mcp_server.tools.rag',
        'sql_opt': 'teradata_mcp_server.tools.sql_opt',
        'sec': 'teradata_mcp_server.tools.sec',
        'tmpl': 'teradata_mcp_server.tools.tmpl',
        'plot': 'teradata_mcp_server.tools.plot',
        'tdvs': 'teradata_mcp_server.tools.tdvs'
    }
  • Exposes the qlty tools (including handle_qlty_distinctCategories) by importing from qlty_tools.py for use in module loading.
    from .qlty_resources import *
    from .qlty_tools import *
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While it mentions the tool 'gets' data (implying read-only) and describes the return format vaguely, it doesn't specify important behavioral aspects like whether it performs expensive DISTINCT operations on large tables, whether results are cached, what happens with NULL values, or any rate limits. The description adds minimal behavioral context beyond the basic operation.

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

Conciseness4/5

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

The description is reasonably concise with a clear purpose statement followed by argument and return sections. However, the spelling error ('destinct') detracts from professionalism, and the structure could be improved by integrating the parameter explanations more naturally rather than as a separate list. The information is front-loaded with the core purpose first.

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?

For a tool with 3 parameters, 0% schema coverage, no annotations, and no output schema, the description is inadequate. It doesn't explain what 'distinct categories' means in practice, how results are formatted, whether ordering is guaranteed, how large result sets are handled, or what metadata is included. The vague 'formatted response with query results + metadata' provides insufficient guidance for proper tool invocation.

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?

With 0% schema description coverage and 3 parameters, the description must compensate but provides only basic parameter names without meaningful semantics. It lists 'database_name', 'table_name', and 'column_name' but doesn't explain format requirements, valid values, or relationships between parameters. No examples or constraints are provided, leaving significant gaps in understanding how to properly use these parameters.

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

Purpose3/5

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

The description states the tool 'Get the destinct categories from column in a table', which clearly indicates its purpose of retrieving unique values from a database column. However, it contains a spelling error ('destinct' instead of 'distinct'), and while it distinguishes from some siblings like plotting tools, it doesn't explicitly differentiate from similar data quality tools like qlty_columnSummary or qlty_univariateStatistics that might also analyze column data.

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 when this tool is preferred over other qlty_* tools like qlty_columnSummary, or when to use base_readQuery for more flexible SQL queries. There's no context about prerequisites, limitations, or typical use cases.

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

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