Skip to main content
Glama
blitzstermayank

Teradata MCP Server

base_columnDescription

Retrieve detailed column information for Teradata database tables, including data types and constraints, with SQL query metadata returned.

Instructions

Shows detailed column information about a database table via SQLAlchemy, bind parameters if provided (prepared SQL), and return the fully rendered SQL (with literals) in metadata.

Arguments: database_name - Database name obj_name - table or view name

Returns: ResponseType: formatted response with query results + metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
database_nameYes
obj_nameYes

Implementation Reference

  • The handler function that implements the core logic of the 'base_columnDescription' tool. It executes a SQL query against DBC.ColumnsVX to retrieve detailed column information (name and decoded type) for tables/views matching the provided database_name and obj_name patterns (using LIKE with wildcards if empty). Returns formatted JSON data with metadata.
    def handle_base_columnDescription(conn: TeradataConnection, database_name: str | None, obj_name: str, *args, **kwargs):
        """
        Shows detailed column information about a database table via SQLAlchemy, bind parameters if provided (prepared SQL), and return the fully rendered SQL (with literals) in metadata.
    
        Arguments:
          database_name - Database name
          obj_name - table or view name
    
        Returns:
          ResponseType: formatted response with query results + metadata
        """
        logger.debug(f"Tool: handle_base_columnDescription: Args: database_name: {database_name}, obj_name: {obj_name}")
    
        if len(database_name) == 0:
            database_name = "%"
        if len(obj_name) == 0:
            obj_name = "%"
        with conn.cursor() as cur:
            query = """
                sel TableName, ColumnName, CASE ColumnType
                    WHEN '++' THEN 'TD_ANYTYPE'
                    WHEN 'A1' THEN 'UDT'
                    WHEN 'AT' THEN 'TIME'
                    WHEN 'BF' THEN 'BYTE'
                    WHEN 'BO' THEN 'BLOB'
                    WHEN 'BV' THEN 'VARBYTE'
                    WHEN 'CF' THEN 'CHAR'
                    WHEN 'CO' THEN 'CLOB'
                    WHEN 'CV' THEN 'VARCHAR'
                    WHEN 'D' THEN  'DECIMAL'
                    WHEN 'DA' THEN 'DATE'
                    WHEN 'DH' THEN 'INTERVAL DAY TO HOUR'
                    WHEN 'DM' THEN 'INTERVAL DAY TO MINUTE'
                    WHEN 'DS' THEN 'INTERVAL DAY TO SECOND'
                    WHEN 'DY' THEN 'INTERVAL DAY'
                    WHEN 'F' THEN  'FLOAT'
                    WHEN 'HM' THEN 'INTERVAL HOUR TO MINUTE'
                    WHEN 'HR' THEN 'INTERVAL HOUR'
                    WHEN 'HS' THEN 'INTERVAL HOUR TO SECOND'
                    WHEN 'I1' THEN 'BYTEINT'
                    WHEN 'I2' THEN 'SMALLINT'
                    WHEN 'I8' THEN 'BIGINT'
                    WHEN 'I' THEN  'INTEGER'
                    WHEN 'MI' THEN 'INTERVAL MINUTE'
                    WHEN 'MO' THEN 'INTERVAL MONTH'
                    WHEN 'MS' THEN 'INTERVAL MINUTE TO SECOND'
                    WHEN 'N' THEN 'NUMBER'
                    WHEN 'PD' THEN 'PERIOD(DATE)'
                    WHEN 'PM' THEN 'PERIOD(TIMESTAMP WITH TIME ZONE)'
                    WHEN 'PS' THEN 'PERIOD(TIMESTAMP)'
                    WHEN 'PT' THEN 'PERIOD(TIME)'
                    WHEN 'PZ' THEN 'PERIOD(TIME WITH TIME ZONE)'
                    WHEN 'SC' THEN 'INTERVAL SECOND'
                    WHEN 'SZ' THEN 'TIMESTAMP WITH TIME ZONE'
                    WHEN 'TS' THEN 'TIMESTAMP'
                    WHEN 'TZ' THEN 'TIME WITH TIME ZONE'
                    WHEN 'UT' THEN 'UDT'
                    WHEN 'YM' THEN 'INTERVAL YEAR TO MONTH'
                    WHEN 'YR' THEN 'INTERVAL YEAR'
                    WHEN 'AN' THEN 'UDT'
                    WHEN 'XM' THEN 'XML'
                    WHEN 'JN' THEN 'JSON'
                    WHEN 'DT' THEN 'DATASET'
                    WHEN '??' THEN 'STGEOMETRY''ANY_TYPE'
                    END as CType
                from DBC.ColumnsVX where upper(tableName) like upper(?) and upper(DatabaseName) like upper(?)
            """
            rows = cur.execute(query, [obj_name, database_name])
            data = rows_to_json(cur.description, rows.fetchall())
            metadata = {
                "tool_name": "base_columnDescription",
                "database": database_name,
                "object": obj_name,
                "column_count": len(data)
            }
            logger.debug(f"Tool: handle_base_columnDescription: metadata: {metadata}")
            return create_response(data, metadata)
  • Dynamic registration code that scans loaded modules for functions starting with 'handle_', derives the tool name by stripping the 'handle_' prefix (e.g., 'handle_base_columnDescription' -> 'base_columnDescription'), wraps the handler with connection injection and QueryBand support, and registers it as an MCP tool using FastMCP's mcp.tool decorator.
    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}")
Behavior3/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 discloses key behavioral traits: it uses SQLAlchemy, supports bind parameters for prepared SQL, and returns fully rendered SQL with literals in metadata. However, it doesn't mention permissions needed, rate limits, error handling, or what 'detailed column information' specifically includes (e.g., data types, constraints).

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 and front-loaded: the first sentence states the core purpose, followed by additional details about arguments and returns. There's minimal waste, though the 'Arguments' and 'Returns' sections could be integrated more smoothly into the narrative flow.

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 2 parameters with 0% schema coverage and no output schema, the description provides basic context but lacks depth. It explains what the tool does and its parameters but doesn't detail the response format beyond 'formatted response with query results + metadata', which is vague. For a tool with no annotations, more behavioral and output specifics 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 obj_name) with brief explanations, adding meaning beyond the bare schema. However, it doesn't clarify what 'obj_name' encompasses (e.g., table vs. view specifics) or provide examples, leaving some ambiguity.

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: 'Shows detailed column information about a database table via SQLAlchemy'. It specifies the verb ('shows'), resource ('detailed column information'), and technology ('SQLAlchemy'). However, it doesn't explicitly differentiate from sibling tools like qlty_columnSummary or base_tableDDL, which may also provide column-related information.

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 (e.g., qlty_columnSummary, base_tableDDL, base_tableList) that might overlap in functionality, there's no indication of when this specific tool is appropriate or what distinguishes it from other column or table analysis tools.

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