get_iceberg_tables
Retrieve a list of iceberg tables within a specified namespace from the Iceberg catalog, enabling efficient metadata management and navigation for Apache Iceberg data lakehouses.
Instructions
Provides a list of iceberg tables from the Iceberg catalog for a given namespace
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | Yes |
Implementation Reference
- iceberg_mcp/iceberg_server.py:33-38 (handler)The handler function decorated with @mcp.tool() that implements the get_iceberg_tables tool. It retrieves the list of tables in the given namespace from the GlueCatalog and returns their names as a newline-separated string.@mcp.tool() def get_iceberg_tables(namespace: str) -> str: """Provides a list of iceberg tables from the Iceberg catalog for a given namespace""" catalog = get_catalog() tables = catalog.list_tables(namespace) return "\n".join(t[1] for t in tables)
- Helper function to create and return the GlueCatalog instance used by the get_iceberg_tables handler.def get_catalog() -> GlueCatalog: try: session = boto3.Session(profile_name=iceberg_config.profile_name) credentials = session.get_credentials().get_frozen_credentials() catalog = GlueCatalog( "glue", **{ "client.access-key-id": credentials.access_key, "client.secret-access-key": credentials.secret_key, "client.session-token": credentials.token, "client.region": iceberg_config.region, }, ) except Exception as e: logger.error(f"Error creating AWS connection: {str(e)}") raise return catalog
- iceberg_mcp/iceberg_server.py:33-33 (registration)The @mcp.tool() decorator registers the get_iceberg_tables function as an MCP tool.@mcp.tool()