Skip to main content
Glama
ryft-io

IcebergMCP

by ryft-io

get_table_schema

Retrieve the schema for an Apache Iceberg table by specifying its namespace and table name. This tool helps users understand table structure and data types for querying and analysis in data lakehouses.

Instructions

Provides the schema for a given Iceberg table

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namespaceYes
table_nameYes

Implementation Reference

  • The handler function that loads the Iceberg table and extracts its schema fields into the defined SchemaField format.
    def get_table_schema(
        namespace: str,
        table_name: str
    ) -> list[SchemaField]:
        """Provides the schema for a given Iceberg table""" 
        catalog: Catalog = get_catalog()
        table_obj = catalog.load_table((namespace, table_name))
        schema = table_obj.schema()
    
        fields = []
        for field in schema.fields:
            fields.append(
                {
                    "id": field.field_id,
                    "name": field.name,
                    "type": str(field.field_type),
                    "required": field.required,
                    "doc": field.doc if field.doc else None,
                }
            )
    
        return fields
  • Registers the get_table_schema function as an MCP tool using the FastMCP decorator.
    @mcp.tool()
  • Defines the output schema structure for table schema fields.
    class SchemaField(TypedDict):
        id: int
        name: str
        type: str
        required: bool
        doc: str | None
  • Helper function to initialize the GlueCatalog using AWS credentials from config.
    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 full burden but only states what the tool does without behavioral details. It doesn't disclose if this is a read-only operation, potential error conditions, performance characteristics, or output format. For a tool with no annotation coverage, this is a significant gap in transparency.

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 unnecessary words. It's appropriately sized for a simple retrieval tool and front-loads the essential information. Every word earns its place.

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 no annotations, 0% schema coverage, no output schema, and 2 parameters, the description is incomplete. It doesn't explain what the schema output looks like, how to interpret results, or provide any context about Iceberg table schemas. For a tool that presumably returns structured data, this leaves significant gaps.

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?

Schema description coverage is 0%, meaning neither parameter has descriptions in the schema. The description adds no information about what 'namespace' or 'table_name' represent, their expected formats, or examples. With 2 undocumented parameters, the description fails to compensate for the schema's lack of documentation.

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 action ('Provides') and resource ('schema for a given Iceberg table'), making the purpose understandable. It distinguishes from siblings like get_table_partitions or get_table_properties by focusing specifically on schema retrieval. However, it doesn't explicitly differentiate from get_iceberg_tables which might also provide schema information, keeping it from a perfect score.

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. It doesn't mention siblings like get_table_properties or get_table_partitions, nor does it specify prerequisites or contexts for usage. This leaves the agent without explicit direction on tool selection.

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