Skip to main content
Glama
Teradata

Teradata MCP Server

Official
by Teradata

qlty_negativeValues

Identify columns containing negative values in Teradata tables to detect data quality issues and ensure numerical accuracy in database analysis.

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

  • The handler function `handle_qlty_negativeValues` implements the core logic for the `qlty_negativeValues` tool. It executes a Teradata query using TD_ColumnSummary to identify columns with negative values in the specified table, processes the results, adds metadata, and returns a formatted response.
    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)
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 hints at output behavior, but lacks details on permissions, rate limits, error handling, or whether it's read-only/destructive. For a data analysis tool with zero annotation coverage, this is insufficient.

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 purpose, followed by arguments and returns sections. It's concise with three sentences, but the 'Arguments' and 'Returns' sections could be integrated more smoothly. Overall, it avoids unnecessary verbosity and earns its place.

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 the complexity (data analysis tool), no annotations, no output schema, and low schema coverage, the description is incomplete. It lacks details on output format, error cases, performance implications, and how it interacts with siblings. For a tool that queries databases, more context is needed for effective use.

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 their roles, adding basic semantics beyond the schema. However, it doesn't explain data types, constraints (e.g., null handling for database_name), or examples, leaving gaps in understanding.

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 negative values in a table.' It specifies the verb ('Get') and resource ('column names'), and distinguishes it from siblings like 'qlty_missingValues' or 'qlty_columnSummary' by focusing on negative values. However, it doesn't explicitly differentiate from all siblings, such as 'qlty_univariateStatistics', which might also reveal negative values.

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 a database connection), exclusions (e.g., not for non-numeric columns), or compare it to siblings like 'qlty_columnSummary' for broader analysis. Usage is implied only by the purpose statement.

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