Skip to main content
Glama
ryft-io

IcebergMCP

by ryft-io

get_table_partitions

Retrieve partition information for Iceberg tables to analyze data organization and optimize queries.

Instructions

Provides the partitions for a given Iceberg table

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namespaceYes
table_nameYes

Implementation Reference

  • Handler function for get_table_partitions tool. Loads the Iceberg table using the catalog and processes its partitions into a list of dictionaries containing partition details, record count, and size.
    @mcp.tool()
    def get_table_partitions(
            namespace: str,
            table_name: str
    ) -> list[dict[str, int]]:
        """Provides the partitions for a given Iceberg table""" 
        catalog: Catalog = get_catalog()
        table_obj = catalog.load_table((namespace, table_name))
        partitions = table_obj.inspect.partitions().to_pylist()
    
        result = []
        for p in partitions:
            result.append(
                {
                    "partition": p['partition'],
                    "record_count": p['record_count'],
                    "size_in_bytes": p['total_data_file_size_in_bytes'],
                }
            )
        return result
  • Helper function to create and return the GlueCatalog instance used by the get_table_partitions handler and other tools.
    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
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states 'provides the partitions' but doesn't specify what 'provides' entails—e.g., whether it returns a list, count, or detailed metadata of partitions, or if it has any side effects like caching. For a tool with zero annotation coverage, this is a significant gap in transparency about its operation and output.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any wasted words. It's appropriately sized for a simple tool and front-loaded with the key action and resource. Every part of the sentence earns its place by conveying essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of the tool (2 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain what partitions are, why they're useful, or what the return value looks like (e.g., a list of partition keys or metadata). For a tool that likely returns structured data about table partitions, more context is needed to make it fully usable by an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, meaning the input schema provides no descriptions for the two parameters (namespace and table_name). The description adds no meaning beyond the schema—it doesn't explain what a 'namespace' or 'table_name' represents in the context of Iceberg tables, such as database or catalog names. Since the description doesn't compensate for the low schema coverage, it falls short of the baseline 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'provides' and the resource 'partitions for a given Iceberg table', making the purpose specific and understandable. It distinguishes from siblings like 'get_table_schema' or 'get_table_properties' by focusing on partitions rather than other table metadata. However, it doesn't explicitly differentiate from all siblings (e.g., 'get_iceberg_tables' also deals with tables), so it's not a perfect 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_table_schema' or 'get_table_properties'. It mentions 'partitions' but doesn't explain why one would need partitions specifically, such as for query optimization or data management. There's no mention of prerequisites or exclusions, leaving usage context implied at best.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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