Skip to main content
Glama
ryft-io

IcebergMCP

by ryft-io

get_table_properties

Retrieve table properties and metadata from Apache Iceberg data lakehouses to analyze schema details and configuration settings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namespaceYes
table_nameYes

Implementation Reference

  • The handler function decorated with @mcp.tool() that implements the get_table_properties tool. Loads the table from the catalog, extracts partition specs, sort orders, snapshot summary (size and records), and table properties.
    @mcp.tool()
    def get_table_properties(
            namespace: str,
            table_name: str
    ) -> dict:
        catalog: Catalog = get_catalog()
        table_obj = catalog.load_table((namespace, table_name))
        partition_specs = [p.dict() for p in table_obj.metadata.partition_specs]
        sort_orders = [s.dict() for s in table_obj.metadata.sort_orders]
        current_snapshot = table_obj.current_snapshot()
        if not current_snapshot or not current_snapshot.summary:
            return {}
        return {
            "total_size_in_bytes": current_snapshot.summary["total-files-size"],
            "total_records": current_snapshot.summary["total-records"],
            "partition_specs": partition_specs,
            "sort_orders": sort_orders,
            **table_obj.properties
        }
  • Helper function to initialize and return the GlueCatalog using AWS credentials from the configured profile and region.
    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

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