Skip to main content
Glama
timeplus-io

mcp-timeplus

by timeplus-io

connect_to_apache_iceberg

Create a Timeplus database to connect with Apache Iceberg for managing streaming data, using AWS S3 storage and account configuration.

Instructions

Create a Timeplus database in iceberg type to connect to Iceberg

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
iceberg_dbYes
aws_account_idYes
s3_bucketYes
aws_regionNous-west-2
is_s3_table_bucketNo

Implementation Reference

  • The core handler implementation for the 'connect_to_apache_iceberg' tool. It validates inputs, constructs the CREATE DATABASE SQL with Iceberg settings for AWS Glue and S3, executes it, and returns the list of streams in the database.
    @mcp.tool()
    def connect_to_apache_iceberg(iceberg_db: str,aws_account_id: int, s3_bucket: str, aws_region: str="us-west-2",is_s3_table_bucket: bool=False):
        """Create a Timeplus database in iceberg type to connect to Iceberg"""
        if iceberg_db is None or aws_account_id is None or s3_bucket is None:
            return {"error": "iceberg_db, aws_account_id, and s3_bucket are required"}
        logger.info("Creating Iceberg database")
        warehouse=aws_account_id
        storage_endpoint=f"https://{s3_bucket}.s3.{aws_region}.amazonaws.com"
        if is_s3_table_bucket:
            warehouse=f"{aws_account_id}:s3tablescatalog/{s3_bucket}"
            storage_endpoint=f"https://s3tables.{aws_region}.amazonaws.com/{s3_bucket}"
    
        sql=f"""CREATE DATABASE {iceberg_db}
                SETTINGS type='iceberg',catalog_uri='https://glue.{aws_region}.amazonaws.com/iceberg',catalog_type='rest',
                        warehouse='{warehouse}',storage_endpoint='{storage_endpoint}',use_environment_credentials=true,
                        rest_catalog_sigv4_enabled=true,rest_catalog_signing_region='{aws_region}',rest_catalog_signing_name='glue'
        """
        run_sql(sql)
        logger.info("Iceberg database created")
    
        sql=f"SHOW STREAMS FROM {iceberg_db}"
        return run_sql(sql)

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

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