Skip to main content
Glama
Teradata

Teradata MCP Server

Official
by Teradata

base_columnDescription

Retrieve detailed column information from Teradata database tables, including data types and constraints, to understand table structure for querying and analysis.

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 'base_columnDescription' tool. It queries the DBC.ColumnsVX view to retrieve detailed column type information for tables or views matching the provided database_name (optional, defaults to '%') and obj_name (table/view name, defaults to '%'). Maps Teradata column type codes to human-readable names and returns the results 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)
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. It mentions using SQLAlchemy, bind parameters, and returning rendered SQL in metadata, but lacks details on permissions, rate limits, error handling, or what 'detailed column information' includes. This leaves significant behavioral gaps for a tool with database access.

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 three sentences and is front-loaded with the main purpose. However, the 'Arguments' and 'Returns' sections are somewhat redundant with the schema and could be more integrated, though they do not waste space.

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 (database tool with SQLAlchemy), no annotations, no output schema, and low schema coverage, the description is incomplete. It misses details on output format, error cases, and how it differs from siblings, making it inadequate for safe and effective use by an AI agent.

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 compensate. It lists 'database_name' and 'obj_name' with brief notes, but does not explain what these parameters mean (e.g., format, examples, constraints) or how they interact. This adds minimal value beyond the schema's property names.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool 'Shows detailed column information about a database table via SQLAlchemy', which provides a clear verb ('Shows') and resource ('column information about a database table'). However, it does not distinguish itself from sibling tools like 'base_tableList' or 'qlty_columnSummary', making the purpose somewhat vague in context.

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 mentions 'bind parameters if provided' and 'return the fully rendered SQL', but does not specify scenarios, prerequisites, or exclusions compared to siblings like 'base_tableDDL' or 'qlty_columnSummary'.

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