Skip to main content
Glama
Teradata

Teradata MCP Server

Official
by Teradata

qlty_missingValues

Identify columns with missing values in Teradata tables to assess data quality and ensure completeness for analysis.

Instructions

Get the column names that having missing values in a table.

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

Returns: ResponseType: formatted response with query results + metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
database_nameYes
table_nameYes

Implementation Reference

  • Handler function that executes a Teradata SQL query using TD_ColumnSummary to retrieve columns with missing values (NullCount and NullPercentage), formats results using helper utilities, and returns a standardized response.
    def handle_qlty_missingValues(conn: TeradataConnection, database_name: str | None, table_name: str, *args, **kwargs):
        """
        Get the column names that having missing values in a table.
    
        Arguments:
          database_name - name of the database
          table_name - table name to analyze
    
        Returns:
          ResponseType: formatted response with query results + metadata
        """
        logger.debug(f"Tool: handle_qlty_missingValues: Args: table_name: {database_name}.{table_name}")
    
        if database_name is not None:
                table_name = f"{database_name}.{table_name}"
        with conn.cursor() as cur:
            rows = cur.execute(f"select ColumnName, NullCount, NullPercentage from TD_ColumnSummary ( on {table_name} as InputTable using TargetColumns ('[:]')) as dt ORDER BY NullCount desc")
            data = rows_to_json(cur.description, rows.fetchall())
            metadata = {
                "tool_name": "qlty_missingValues",
                "database_name": database_name,
                "table_name": table_name,
                "rows": len(data)
            }
            logger.debug(f"Tool: handle_qlty_missingValues: Metadata: {metadata}")
            return create_response(data, metadata)
  • Dynamic registration loop that discovers handle_qlty_missingValues via module loader, derives tool name 'qlty_missingValues' by stripping 'handle_' prefix, wraps the handler for MCP compatibility (injects conn, adapts signature), and registers it as an MCP tool.
    # Register code tools via module loader
    module_loader = td.initialize_module_loader(config)
    if module_loader:
        all_functions = module_loader.get_all_functions()
        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
            # Skip template tools (used for developer reference only)
            if tool_name.startswith("tmpl_"):
                logger.debug(f"Skipping template tool: {tool_name}")
                continue
            # Skip BAR tools if BAR functionality is disabled
            if tool_name.startswith("bar_") and not enableBAR:
                logger.info(f"Skipping BAR tool: {tool_name} (BAR functionality disabled)")
                continue
            # Skip chat completion tools if chat completion functionality is disabled
            if tool_name.startswith("chat_") and not enableChat:
                logger.info(f"Skipping chat completion tool: {tool_name} (chat completion functionality disabled)")
                continue
            wrapped = make_tool_wrapper(func)
            mcp.tool(name=tool_name, description=wrapped.__doc__)(wrapped)
            logger.info(f"Created tool: {tool_name}")
            logger.debug(f"Tool Docstring: {wrapped.__doc__}")
    else:
  • Imports utility functions create_response (formats data+metadata into MCP response) and rows_to_json (converts cursor results to JSON). These are used in the handler to process and return results.
    from teradata_mcp_server.tools.utils import create_response, rows_to_json
    
    logger = logging.getLogger("teradata_mcp_server")
    
    #------------------ Tool  ------------------#
    # Missing Values tool
    
    def handle_qlty_missingValues(conn: TeradataConnection, database_name: str | None, table_name: str, *args, **kwargs):
        """
        Get the column names that having missing values in a table.
    
        Arguments:
          database_name - name of the database
          table_name - table name to analyze
    
        Returns:
          ResponseType: formatted response with query results + metadata
        """
        logger.debug(f"Tool: handle_qlty_missingValues: Args: table_name: {database_name}.{table_name}")
    
        if database_name is not None:
                table_name = f"{database_name}.{table_name}"
        with conn.cursor() as cur:
            rows = cur.execute(f"select ColumnName, NullCount, NullPercentage from TD_ColumnSummary ( on {table_name} as InputTable using TargetColumns ('[:]')) as dt ORDER BY NullCount desc")
            data = rows_to_json(cur.description, rows.fetchall())
            metadata = {
                "tool_name": "qlty_missingValues",
                "database_name": database_name,
                "table_name": table_name,
                "rows": len(data)
            }
            logger.debug(f"Tool: handle_qlty_missingValues: Metadata: {metadata}")
            return create_response(data, metadata)
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. It states the tool returns 'formatted response with query results + metadata,' which hints at output structure but lacks details on behavior: e.g., whether it's read-only (implied but not stated), performance considerations, error handling, or if it modifies data. For a tool with zero annotation coverage, this leaves significant gaps in understanding how it operates.

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 front-loaded with the core purpose in the first sentence, followed by structured sections for arguments and returns. It avoids redundancy and wastes no words, though the 'Arguments' and 'Returns' sections could be integrated more seamlessly. Overall, it's efficient and well-organized for its length.

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 moderate complexity (2 parameters, no output schema, no annotations), the description is minimally adequate. It covers the purpose and parameters but lacks behavioral details, usage context, and output specifics. For a quality analysis tool with siblings offering similar functions, more guidance on differentiation and use cases would improve completeness.

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?

Schema description coverage is 0%, so the schema provides no parameter descriptions. The description lists the two parameters ('database_name' and 'table_name') and briefly explains them, adding basic semantics beyond the schema's titles. However, it doesn't clarify nuances (e.g., what happens if 'database_name' is null, or how table names are resolved), leaving some ambiguity. With low schema coverage, the description compensates partially but not fully.

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 column names that having missing values in a table.' It specifies the verb ('Get') and resource ('column names'), and distinguishes itself from siblings like 'qlty_rowsWithMissingValues' (which likely counts rows rather than columns). However, it doesn't explicitly differentiate from other quality tools like 'qlty_columnSummary' or 'qlty_univariateStatistics' that might also provide missing value insights.

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 prerequisites (e.g., needing database/table access), compare it to siblings like 'qlty_rowsWithMissingValues' or 'qlty_columnSummary', or specify scenarios where column-level missing value analysis is preferred over row-level or other statistical summaries.

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