describe_table
Retrieve detailed metadata for an Airtable table, including structure and fields, using a secure OAuth 2.0 authenticated interface.
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)The handler function for the 'describe_table' tool, registered with @self.mcp.tool decorator. It fetches the base schema using an authenticated Airtable client, locates the specified table, and returns detailed information including fields and views.@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 model defining the input arguments (base_id and table_id) for the describe_table tool, matching the handler's Annotated parameters.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")
- src/airtable_mcp/mcp/server.py:185-185 (registration)The @self.mcp.tool decorator registers the describe_table function as an MCP tool named 'describe_table'.@self.mcp.tool(description="Get detailed information about a specific table")