Skip to main content
Glama
Teradata

Teradata MCP Server

Official
by Teradata

base_tableDDL

Retrieve the complete DDL definition of a Teradata table to understand its structure and constraints. Provides fully rendered SQL with literals for analysis or documentation.

Instructions

Displays the DDL definition of a table via SQLAlchemy, bind parameters if provided (prepared SQL), and return the fully rendered SQL (with literals) in metadata.

Arguments: database_name - Database name table_name - table name

Returns: ResponseType: formatted response with query results + metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
database_nameYes
table_nameYes

Implementation Reference

  • The core handler function for the 'base_tableDDL' tool. It takes a Teradata connection, optional database name, and table name, constructs the full table identifier, executes 'SHOW TABLE' SQL command, fetches results, builds metadata including tool_name 'base_tableDDL', and returns a formatted response.
    def handle_base_tableDDL(conn: TeradataConnection, database_name: str | None, table_name: str, *args, **kwargs):
        """
        Displays the DDL definition of a table via SQLAlchemy, bind parameters if provided (prepared SQL), and return the fully rendered SQL (with literals) in metadata.
    
        Arguments:
          database_name - Database name
          table_name - table name
    
        Returns:
          ResponseType: formatted response with query results + metadata
        """
        logger.debug(f"Tool: handle_base_tableDDL: Args: database_name: {database_name}, table_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"show table {table_name}")
            data = rows_to_json(cur.description, rows.fetchall())
            metadata = {
                "tool_name": "base_tableDDL",
                "database": database_name,
                "table": table_name,
                "rows": len(data)
            }
            logger.debug(f"Tool: handle_base_tableDDL: 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 full burden. It mentions the tool displays DDL, uses SQLAlchemy, handles bind parameters, and returns rendered SQL in metadata. However, it lacks critical behavioral details: whether this is a read-only operation, if it requires specific permissions, potential side effects (e.g., query execution costs), error handling, or format of the response. For a tool with no 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.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is reasonably concise with three sentences, but not optimally structured. The first sentence is front-loaded with the core purpose, but the second sentence about bind parameters and metadata is somewhat technical and could be integrated more smoothly. The 'Arguments' and 'Returns' sections are clear but redundant with the schema (though schema lacks descriptions). Overall, it avoids excessive verbosity but has minor structural issues.

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 no annotations, 0% schema description coverage, and no output schema, the description is incomplete. It covers the basic purpose and mentions metadata in returns, but lacks details on behavioral traits, parameter validation, error cases, and output format. For a tool that interacts with databases and returns query results, this leaves significant gaps for an AI agent to use it correctly.

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 the two parameters (database_name, table_name) but only provides minimal context: 'Database name' and 'table name'. It doesn't explain what constitutes valid values, if null is allowed for database_name (as per schema), or how these parameters interact. This adds little meaning beyond the schema's basic structure.

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: 'Displays the DDL definition of a table via SQLAlchemy'. It specifies the verb ('Displays'), resource ('DDL definition of a table'), and mechanism ('via SQLAlchemy'). However, it doesn't explicitly differentiate from sibling tools like base_tableList or base_tablePreview, which likely serve different purposes.

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 and returning rendered SQL in metadata, but doesn't specify scenarios, prerequisites, or exclusions. With many sibling tools available (e.g., base_tableList, base_tablePreview), this lack of context leaves the agent guessing about appropriate usage.

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