describe_table
Retrieve detailed metadata about an Airtable table, including its structure and fields, to understand its data organization and schema.
Instructions
Get detailed information about a specific table
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base_id | Yes | The Airtable base ID | |
| table_id | Yes | The table ID or name |
Implementation Reference
- src/airtable_mcp/mcp/server.py:185-222 (handler)Handler function that implements the describe_table tool logic: authenticates client, fetches base schema, locates the table, and returns its details including fields and views. Also serves as registration via @self.mcp.tool decorator.@self.mcp.tool(description="Get detailed information about a specific table") async def describe_table( base_id: Annotated[str, Field(description="The Airtable base ID")], table_id: Annotated[str, Field(description="The table ID or name")], ) -> dict[str, Any]: """Get detailed information about a specific table including all fields.""" client = await self._get_authenticated_client() schema = await client.get_base_schema(base_id) # Find the specific table table = next( (t for t in schema.tables if t.id == table_id or t.name == table_id), None, ) if not table: raise AirtableAPIError( f"Table '{table_id}' not found in base '{base_id}'" ) return { "id": table.id, "name": table.name, "description": table.description, "primaryFieldId": table.primary_field_id, "fields": [ { "id": field.id, "name": field.name, "type": field.type, "description": field.description, "options": field.options, } for field in table.fields ], "views": table.views, }
- Pydantic schema defining input arguments for describe_table tool (base_id and table_id), though used primarily in tests.class DescribeTableArgs(BaseArgs): """Arguments for describe_table tool.""" base_id: str = Field(description="The Airtable base ID") table_id: str = Field(description="The table ID or name")