Skip to main content
Glama
blitzstermayank

Teradata MCP Server

qlty_negativeValues

Identify columns containing negative values in Teradata database tables to detect data quality issues and validate numerical data integrity.

Instructions

Get the column names that having negative 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 implementing the qlty_negativeValues tool. Queries the database for columns containing negative values using TD_ColumnSummary and returns formatted results with metadata.
    def handle_qlty_negativeValues(conn: TeradataConnection, database_name: str | None, table_name: str, *args, **kwargs):
        """
        Get the column names that having negative 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_negativeValues: 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, NegativeCount from TD_ColumnSummary ( on {table_name} as InputTable using TargetColumns ('[:]')) as dt ORDER BY NegativeCount desc")
            data = rows_to_json(cur.description, rows.fetchall())
            metadata = {
                "tool_name": "qlty_negativeValues",
                "database_name": database_name,
                "table_name": table_name,
                "rows": len(data)
            }
            logger.debug(f"Tool: handle_qlty_negativeValues: Metadata: {metadata}")
            return create_response(data, metadata)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.7/5.0
Behavior2/5

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

With no annotations, the description must disclose behavioral traits. It states the return type (formatted response with results and metadata) but omits details like whether the tool is read-only, permission requirements, or behavior with non-numeric columns, leaving significant gaps.

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 very concise, with one sentence for purpose and brief argument/return descriptions. It is front-loaded with the action (Get the column names...). However, the grammar is slightly awkward, and the structure could include a more formal 'Returns' section.

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?

Given no output schema, the description should thoroughly explain return values. 'Formatted response with query results + metadata' is vague; it does not specify the structure (e.g., list of strings) or whether it includes column types. Behavioral details like handling of empty results are missing.

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?

Schema description coverage is 0%, so the description must add meaning beyond parameter names. It only restates the obvious ('database_name - name of the database'), providing no additional context like data types (beyond schema), allowed values, or relationships between parameters.

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: retrieving column names with negative values. It implies a specific focus on data quality, distinguishing it from sibling tools like qlty_missingValues or qlty_distinctCategories, though it does not explicitly differentiate them.

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?

No guidance is provided on when to use this tool versus alternatives. The description lacks context such as prerequisites (e.g., numeric columns only) or conditions that would make this tool preferable over others like qlty_univariateStatistics.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.