Skip to main content
Glama
blitzstermayank

Teradata MCP Server

qlty_standardDeviation

Calculate standard deviation for a column in Teradata to measure data dispersion and identify outliers. Input database, table, and column names to analyze variability.

Instructions

Get the standard deviation 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

  • The handler function that implements the core logic of the qlty_standardDeviation tool. It executes a Teradata query using TD_UnivariateStatistics to compute MEAN and STD for the specified column.
    def handle_qlty_standardDeviation(
        conn: TeradataConnection,
        database_name: str | None,
        table_name: str,
        column_name: str,
        *args,
        **kwargs
    ):
        """
        Get the standard deviation 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_standardDeviation: 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('MEAN','STD')) as dt ORDER BY 1,2")
            data = rows_to_json(cur.description, rows.fetchall())
            metadata = {
                "tool_name": "qlty_standardDeviation",
                "database_name": database_name,
                "table_name": table_name,
                "column_name": column_name,
                "stats_calculated": ["MEAN", "STD"],
                "rows": len(data)
            }
            logger.debug(f"Tool: handle_qlty_standardDeviation: Metadata: {metadata}")
            return create_response(data, metadata)
  • The code that dynamically registers all handler functions (including handle_qlty_standardDeviation as 'qlty_standardDeviation') as MCP tools using FastMCP's mcp.tool decorator, with schema inferred from function signatures.
    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
            wrapped = make_tool_wrapper(func)
            mcp.tool(name=tool_name, description=wrapped.__doc__)(wrapped)
            logger.info(f"Created tool: {tool_name}")
    else:
        logger.warning("No module loader available, skipping code-defined tool registration")
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool returns 'formatted response with query results + metadata' but doesn't specify what that metadata includes, whether the operation is read-only or has side effects, performance characteristics, or error conditions. For a statistical calculation tool with zero annotation coverage, this leaves significant behavioral 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 appropriately sized with clear sections (purpose, arguments, returns). The purpose statement is front-loaded. However, the 'Arguments' and 'Returns' sections could be integrated more naturally rather than as separate bullet points, and some phrasing could be more concise.

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 statistical calculation tool with 3 parameters, 0% schema description coverage, no annotations, and no output schema, the description is insufficient. It doesn't explain what type of data the column should contain (numeric vs categorical), how missing values are handled, precision of results, or provide examples. The return format description is vague ('formatted response with query results + metadata').

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 only titles without descriptions. The description lists the three parameters with brief explanations ('name of the database', 'table name to analyze', 'column name to analyze'), adding basic semantic meaning beyond the schema. However, it doesn't clarify what happens if database_name is null (as allowed by schema), provide format examples, or explain constraints.

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 with a specific verb ('Get') and resource ('standard deviation from column in a table'). It distinguishes itself from siblings like 'qlty_columnSummary' or 'qlty_univariateStatistics' by focusing specifically on standard deviation, but doesn't explicitly contrast with them. The purpose is clear but sibling differentiation could be more explicit.

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 many sibling tools for data quality analysis (e.g., qlty_columnSummary, qlty_univariateStatistics, qlty_missingValues), there's no indication of when standard deviation calculation is preferred over other statistical measures or combined analyses. No prerequisites or context for usage is mentioned.

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