Skip to main content
Glama
aliyun

Hologres MCP Server

Official
by aliyun

call_hg_procedure

Execute stored procedures in Hologres databases to perform complex database operations with specified parameters.

Instructions

Call a stored procedure in Hologres database.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
procedure_nameYesThe name of the stored procedure to call in Hologres database
argumentsNoThe arguments to pass to the stored procedure in Hologres database

Implementation Reference

  • Handler logic in the call_tool dispatcher: parses arguments, validates procedure_name, constructs the CALL procedure SQL query.
    elif name == "call_hg_procedure":
        procedure_name = arguments.get("procedure_name")
        arguments_list = arguments.get("arguments")
        if not procedure_name:
            raise ValueError("Procedure name are required")
        query = f"CALL {procedure_name}({', '.join(arguments_list)})"
  • Tool registration in list_tools(): defines name, description, and input schema for call_hg_procedure.
    Tool(
        name="call_hg_procedure",
        description="Call a stored procedure in Hologres database.",
        inputSchema={
            "type": "object",
            "properties": {
                "procedure_name": {
                    "type": "string",
                    "description": "The name of the stored procedure to call in Hologres database"
                },
                "arguments": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "description": "The arguments to pass to the stored procedure in Hologres database"
                }
            },
            "required": ["procedure_name"]
        }
    ),
  • Shared helper function that executes the SQL query constructed by tool handlers, manages DB connection with retry, handles serverless mode, and formats SELECT or other results.
    def handle_call_tool(tool_name, query, serverless = False):
        """Handle callTool method."""
        config = get_db_config()
        try:
            with connect_with_retry() as conn:
                with conn.cursor() as cursor:
    
                    # 特殊处理 serverless computing 查询
                    if serverless:
                        cursor.execute("set hg_computing_resource='serverless'")
                    
                    # Execute the query
                    cursor.execute(query)
                    
                    # 特殊处理 ANALYZE 命令
                    if tool_name == "gather_hg_table_statistics":
                        return f"Successfully {query}"
                    
                    # 处理其他有返回结果的查询
                    if cursor.description:  # SELECT query
                        columns = [desc[0] for desc in cursor.description]
                        rows = cursor.fetchall()
                        result = [",".join(map(str, row)) for row in rows]
                        return "\n".join([",".join(columns)] + result)
                    elif tool_name == "execute_dml_sql":  # Non-SELECT query
                        row_count = cursor.rowcount
                        return f"Query executed successfully. {row_count} rows affected."
                    else:
                        return "Query executed successfully"
        except Exception as e:
            return f"Error executing query: {str(e)}"
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 states the tool calls a stored procedure but doesn't disclose behavioral traits like whether it's read-only or destructive, what permissions are required, how errors are handled, or what the typical response format is. For a database operation tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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, clear sentence that efficiently conveys the core purpose without any wasted words. It's appropriately sized and front-loaded, making it easy to understand at a glance.

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 of calling stored procedures in a database, the lack of annotations, and no output schema, the description is incomplete. It doesn't address what the tool returns, how to handle results, error conditions, or security implications. For a tool that could perform various database operations, more context is needed to use it effectively.

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 100%, so the schema already fully documents both parameters (procedure_name and arguments). The description adds no additional meaning beyond what's in the schema, such as examples of procedure names, argument formatting, or special considerations. The baseline of 3 is appropriate when the schema does all the work.

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 ('Call') and target resource ('a stored procedure in Hologres database'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its siblings like 'execute_hg_ddl_sql' or 'execute_hg_dml_sql', which might also interact with stored procedures or similar database operations.

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. Given the sibling tools include various SQL execution and database operation tools, there's no indication of whether this is for specific stored procedure calls, how it differs from general SQL execution, or any prerequisites for its use.

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