Skip to main content
Glama
aliyun

Hologres MCP Server

Official
by aliyun

list_hg_tables_in_a_schema

Retrieve a list of all tables, views, and partitioned tables within a specified schema in a Hologres database using the MCP server.

Instructions

List all tables in a specific schema in the current Hologres database, including their types (table, view, foreign table, partitioned table).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
schemaYesSchema name to list tables from in Hologres database

Implementation Reference

  • Handler logic for 'list_hg_tables_in_a_schema' tool: validates schema input, constructs SQL query to list tables with types (view, foreign, partitioned), excludes system schemas and child partitions, then executes via handle_call_tool.
    elif name == "list_hg_tables_in_a_schema": schema = arguments.get("schema") if not schema: raise ValueError("Schema name is required") query = f""" SELECT tab.table_name, CASE WHEN tab.table_type = 'VIEW' THEN ' (view)' WHEN tab.table_type = 'FOREIGN' THEN ' (foreign table)' WHEN p.partrelid IS NOT NULL THEN ' (partitioned table)' ELSE '' END AS table_type_info FROM information_schema.tables AS tab LEFT JOIN pg_class AS cls ON tab.table_name = cls.relname LEFT JOIN pg_namespace AS ns ON tab.table_schema = ns.nspname LEFT JOIN pg_inherits AS inh ON cls.oid = inh.inhrelid LEFT JOIN pg_partitioned_table AS p ON cls.oid = p.partrelid WHERE tab.table_schema NOT IN ('pg_catalog', 'information_schema', 'hologres', 'hologres_statistic', 'hologres_streaming_mv') AND tab.table_schema = '{schema}' AND (inh.inhrelid IS NULL OR NOT EXISTS ( SELECT 1 FROM pg_inherits WHERE inh.inhrelid = pg_inherits.inhrelid )) ORDER BY tab.table_name; """
  • Tool registration in list_tools(): defines name, description, and input schema requiring 'schema' parameter.
    # 新增 list_hg_tables_in_a_schema 工具 Tool( name="list_hg_tables_in_a_schema", description="List all tables in a specific schema in the current Hologres database, including their types (table, view, foreign table, partitioned table).", inputSchema={ "type": "object", "properties": { "schema": { "type": "string", "description": "Schema name to list tables from in Hologres database" } }, "required": ["schema"] } ), # 新增 show_hg_table_ddl 工具
  • Input schema definition for the tool: object with required 'schema' string property.
    inputSchema={ "type": "object", "properties": { "schema": { "type": "string", "description": "Schema name to list tables from in Hologres database" } }, "required": ["schema"] } ),

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