Skip to main content
Glama
aliyun

Hologres MCP Server

Official
by aliyun

show_hg_table_ddl

Retrieve the Data Definition Language (DDL) script for tables, views, or foreign tables in Hologres databases to understand their structure and recreate them.

Instructions

Show DDL script for a table, view, or foreign table in Hologres database.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
schemaYesSchema name in Hologres database
tableYesTable name in Hologres database

Implementation Reference

  • Handler implementation for the 'show_hg_table_ddl' tool within the call_tool function. It validates input arguments, constructs the SQL query using hg_dump_script to fetch the table DDL, and passes it to the general execution handler.
    elif name == "show_hg_table_ddl":
        schema = arguments.get("schema")
        table = arguments.get("table")
        if not all([schema, table]):
            raise ValueError("Schema and table are required")
        query = f"SELECT hg_dump_script('\"{schema}\".\"{table}\"')"
  • Registration of the 'show_hg_table_ddl' tool in the list_tools() function, including name, description, and input schema definition.
    # 新增 show_hg_table_ddl 工具
    Tool(
        name="show_hg_table_ddl",
        description="Show DDL script for a table, view, or foreign table in Hologres database.",
        inputSchema={
            "type": "object",
            "properties": {
                "schema": {
                    "type": "string",
                    "description": "Schema name in Hologres database"
                },
                "table": {
                    "type": "string",
                    "description": "Table name in Hologres database"
                }
            },
            "required": ["schema", "table"]
        }
    )
  • Input schema definition for the 'show_hg_table_ddl' tool, specifying required 'schema' and 'table' string parameters.
    inputSchema={
        "type": "object",
        "properties": {
            "schema": {
                "type": "string",
                "description": "Schema name in Hologres database"
            },
            "table": {
                "type": "string",
                "description": "Table name in Hologres database"
            }
        },
        "required": ["schema", "table"]
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool shows DDL scripts but doesn't describe what the output looks like (e.g., SQL text format), whether it's read-only, if it requires specific permissions, or any side effects. This leaves significant gaps in understanding the tool's behavior beyond its basic purpose.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

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

The description is a single, efficient sentence that directly states the tool's purpose without any unnecessary words or fluff. It is front-loaded and appropriately sized for a simple tool, earning a high score for conciseness and structure.

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 tool's moderate complexity (2 parameters, no output schema, no annotations), the description is incomplete. It lacks details on output format, behavioral traits, and usage context, which are essential for an agent to effectively invoke this tool. Without annotations or output schema, the description should provide more comprehensive guidance.

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?

The input schema has 100% description coverage, clearly documenting both required parameters ('schema' and 'table') with their meanings. The description adds no additional parameter details beyond what the schema provides, so it meets the baseline score of 3 for adequate but not enhanced parameter semantics.

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 action ('Show DDL script') and target resource ('table, view, or foreign table in Hologres database'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from siblings like 'execute_hg_ddl_sql' or 'get_hg_query_plan', which might also involve DDL or metadata operations, so it falls short of a perfect score.

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 doesn't mention prerequisites, context for usage, or compare it to sibling tools such as 'list_hg_tables_in_a_schema' for discovery or 'execute_hg_ddl_sql' for execution, leaving the agent without explicit usage direction.

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/aliyun/alibabacloud-hologres-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server