get_namespaces
Retrieve a list of namespaces from the Iceberg catalog to organize and manage data within your lakehouse. Simplifies metadata access for structured data querying and analysis.
Instructions
Provides a list of namespaces from the Iceberg catalog.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- iceberg_mcp/iceberg_server.py:25-30 (handler)Handler function decorated with @mcp.tool() that retrieves and returns a newline-separated list of namespaces from the Iceberg Glue catalog.@mcp.tool() def get_namespaces() -> str: """Provides a list of namespaces from the Iceberg catalog.""" catalog = get_catalog() namespaces = catalog.list_namespaces() return "\n".join(ns[0] for ns in namespaces)
- Helper function that initializes and returns the GlueCatalog using AWS credentials from the configured profile.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_config.py:3-5 (helper)Configuration variables for AWS profile and region used by get_catalog().profile_name = os.environ.get("ICEBERG_MCP_PROFILE") region = os.environ.get("ICEBERG_AWS_REGION") or 'us-east-1'