Skip to main content
Glama
blitzstermayank

Teradata MCP Server

qlty_univariateStatistics

Analyze column data distributions by calculating univariate statistics for Teradata tables to identify patterns, outliers, and data quality insights.

Instructions

Get the univariate statistics for 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

  • The handler function that implements the core logic for the qlty_univariateStatistics tool. It executes a Teradata query using TD_UnivariateStatistics to compute all univariate statistics for the specified column in the table.
    def handle_qlty_univariateStatistics(
        conn: TeradataConnection,
        database_name: str | None,
        table_name: str,
        column_name: str,
        *args,
        **kwargs
    ):
        """
        Get the univariate statistics for 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_univariateStatistics: 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_UnivariateStatistics ( on {table_name} as InputTable using TargetColumns ('{column_name}') Stats('ALL')) as dt ORDER BY 1,2")
            data = rows_to_json(cur.description, rows.fetchall())
            metadata = {
                "tool_name": "qlty_univariateStatistics",
                "database_name": database_name,
                "table_name": table_name,
                "column_name": column_name,
                "stats_calculated": ["ALL"],
                "rows": len(data)
            }
            logger.debug(f"Tool: handle_qlty_univariateStatistics: Metadata: {metadata}")
            return create_response(data, metadata)
  • The dynamic registration code that discovers and registers all handle_* functions (including handle_qlty_univariateStatistics as 'qlty_univariateStatistics') from loaded tool modules as MCP tools, inferring schema from function signatures and using docstrings for descriptions.
    for name, func in all_functions.items():
        if not (inspect.isfunction(func) and name.startswith("handle_")):
            continue
        tool_name = name[len("handle_"):]
        if not any(re.match(p, tool_name) for p in config.get('tool', [])):
            continue
        wrapped = make_tool_wrapper(func)
        mcp.tool(name=tool_name, description=wrapped.__doc__)(wrapped)
        logger.info(f"Created tool: {tool_name}")
  • ModuleLoader maps the 'qlty' prefix to the qlty tools module, enabling lazy loading of the qlty_univariateStatistics handler when qlty tools are required by the profile.
    MODULE_MAP = {
        'base': 'teradata_mcp_server.tools.base',
        'dba': 'teradata_mcp_server.tools.dba',
        'fs': 'teradata_mcp_server.tools.fs',
        'qlty': 'teradata_mcp_server.tools.qlty',
  • The qlty package __init__ imports all functions from qlty_tools.py, making handle_qlty_univariateStatistics available for dynamic discovery and registration.
    from .qlty_resources import *
    from .qlty_tools import *
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool returns 'formatted response with query results + metadata', which gives some insight into output behavior. However, it lacks details on permissions, rate limits, error handling, or whether it's a read-only operation (implied by 'Get' but not explicit). For a tool with no annotations, this is a significant gap in transparency.

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 appropriately sized and well-structured, with a clear purpose statement followed by bullet points for arguments and returns. Every sentence earns its place, and it's front-loaded with the main functionality. It could be slightly more concise by integrating the bullet points into a single paragraph, but it's efficient overall.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (statistical analysis with 3 parameters), no annotations, and no output schema, the description is moderately complete. It covers the purpose and parameters but lacks behavioral details and usage guidelines. The mention of return type ('formatted response with query results + metadata') helps, but without an output schema, it's insufficient for full contextual understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description lists the three parameters (database_name, table_name, column_name) and their roles, adding meaning beyond the input schema, which has 0% description coverage. This compensates partially for the schema gap by clarifying what each parameter represents. However, it doesn't provide details on allowed values, formats, or constraints, leaving some semantic gaps.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Get the univariate statistics for a table.' It specifies the verb ('Get') and resource ('univariate statistics for a table'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'qlty_columnSummary' or 'qlty_standardDeviation', which might offer overlapping or related functionality.

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. With sibling tools like 'qlty_columnSummary' and 'qlty_standardDeviation' available, there's no indication of how this tool differs or when it's preferred. The lack of context or exclusions leaves the agent without usage direction.

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/blitzstermayank/MCP'

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