Skip to main content
Glama
ryft-io

IcebergMCP

by ryft-io

get_iceberg_tables

Retrieve a list of Apache Iceberg tables from a specified namespace to access and manage data lakehouse metadata through the IcebergMCP server.

Instructions

Provides a list of iceberg tables from the Iceberg catalog for a given namespace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namespaceYes

Implementation Reference

  • The handler function for the 'get_iceberg_tables' tool, decorated with @mcp.tool() for registration. It retrieves the list of tables in the specified namespace from the Iceberg Glue catalog 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 used by the tool to initialize and return the AWS Glue Catalog instance for accessing Iceberg tables.
    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
  • The @mcp.tool() decorator registers the get_iceberg_tables function as an MCP tool.
    @mcp.tool()

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/ryft-io/iceberg-mcp'

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