Skip to main content
Glama
Teradata

Teradata MCP Server

Official
by Teradata

qlty_rowsWithMissingValues

Identify and retrieve rows containing missing values in a specified table and column of a Teradata database for data quality analysis.

Instructions

Get the rows with missing values 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
col_nameYes
database_nameYes
table_nameYes

Implementation Reference

  • The handler function that implements the core logic of the qlty_rowsWithMissingValues tool. It connects to Teradata, executes the TD_getRowsWithMissingValues analytic function on the specified table and column, converts results to JSON, adds metadata, and returns a formatted response.
    def handle_qlty_rowsWithMissingValues( conn: TeradataConnection, database_name: str | None, table_name: str, column_name: str, *args, **kwargs ): """ Get the rows with missing values 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_rowsWithMissingValues: 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_getRowsWithMissingValues ( ON {table_name} AS InputTable USING TargetColumns ('[{column_name}]')) AS dt;") data = rows_to_json(cur.description, rows.fetchall()) metadata = { "tool_name": "qlty_rowsWithMissingValues", "database_name": database_name, "table_name": table_name, "column_name": column_name, "rows_with_missing_values": len(data) } logger.debug(f"Tool: handle_qlty_rowsWithMissingValues: Metadata: {metadata}") return create_response(data, metadata)
  • Dynamic registration loop that discovers all handle_* functions from loaded modules (including qlty_rowsWithMissingValues), wraps them for MCP compatibility, and registers them as tools if they match the profile's tool patterns.
    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 wrapped = make_tool_wrapper(func) mcp.tool(name=tool_name, description=wrapped.__doc__)(wrapped) logger.info(f"Created tool: {tool_name}")
  • The wrapper function that generates the input schema for MCP tools by inspecting the handler's function signature, removing internal parameters (e.g., 'conn'), and creating a new signature for the MCP tool interface.
    def make_tool_wrapper(func): """Create an MCP-facing wrapper for a handle_* function. - Removes internal parameters (conn, tool_name, fs_config) from the MCP signature while still injecting them into the underlying handler. - Preserves the handler's parameter names and types so MCP clients can render friendly forms. """ sig = inspect.signature(func) inject_kwargs = {} removable = {"conn", "tool_name"} if "fs_config" in sig.parameters: inject_kwargs["fs_config"] = fs_config removable.add("fs_config") params = [ p for name, p in sig.parameters.items() if name not in removable and p.kind in (inspect.Parameter.POSITIONAL_OR_KEYWORD, inspect.Parameter.KEYWORD_ONLY) ] new_sig = sig.replace(parameters=params) # Create executor function that will be run in thread def executor(**kwargs): return execute_db_tool(func, **kwargs) return create_mcp_tool( executor_func=executor, signature=new_sig, inject_kwargs=inject_kwargs, validate_required=False, tool_name=getattr(func, "__name__", "wrapped_tool"), tool_description=func.__doc__, )

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