Skip to main content
Glama
onimsha

Airtable OAuth MCP Server

by onimsha

create_record

Add a new entry to an Airtable base by specifying the base, table, and field values for the record.

Instructions

Create a single record

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
base_idYesThe Airtable base ID
table_idYesThe table ID or name
fieldsYesField values for the new record
typecastNoEnable automatic data conversion

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main MCP tool handler function for 'create_record'. It authenticates via OAuth, calls the AirtableClient.create_records method with a single record, and returns the created record details.
    @self.mcp.tool(description="Create a single record")
    async def create_record(
        base_id: Annotated[str, Field(description="The Airtable base ID")],
        table_id: Annotated[str, Field(description="The table ID or name")],
        fields: Annotated[
            dict[str, Any], Field(description="Field values for the new record")
        ],
        typecast: Annotated[
            bool, Field(description="Enable automatic data conversion")
        ] = False,
    ) -> dict[str, Any]:
        """Create a single record in a table."""
        client = await self._get_authenticated_client()
    
        records = await client.create_records(
            base_id,
            table_id,
            [{"fields": fields}],
            typecast,
        )
    
        record = records[0]
        return {
            "id": record.id,
            "fields": record.fields,
            "createdTime": record.created_time,
        }
  • Pydantic schema defining the input arguments for the create_record tool, matching the handler's Annotated fields.
    class CreateRecordArgs(BaseArgs):
        """Arguments for create_record tool."""
    
        base_id: str = Field(description="The Airtable base ID")
        table_id: str = Field(description="The table ID or name")
        fields: dict[str, Any] = Field(description="Field values for the new record")
        typecast: bool | None = Field(
            default=False, description="Enable automatic data conversion"
        )
  • The AirtableClient helper method that makes the actual POST request to Airtable's API to create records. Used by the create_record handler.
    async def create_records(
        self,
        base_id: str,
        table_id: str,
        records: list[dict[str, Any]],
        typecast: bool = False,
    ) -> list[AirtableRecord]:
        """Create new records in a table.
    
        Args:
            base_id: The Airtable base ID
            table_id: The table ID or name
            records: List of record data (each should have 'fields' key)
            typecast: Whether to enable automatic data conversion
    
        Returns:
            List of created records
        """
        logger.info(f"Creating {len(records)} records in {base_id}/{table_id}")
    
        request_data = CreateRecordsRequest(
            records=records,
            typecast=typecast,
        )
    
        response = await self._make_request(
            "POST",
            f"/v0/{base_id}/{table_id}",
            data=request_data.model_dump(by_alias=True, exclude_none=True),
            response_model=CreateRecordsResponse,
        )
    
        return response.records
  • The _register_tools method where all MCP tools, including create_record, are defined and registered using @self.mcp.tool decorators.
    def _register_tools(self) -> None:

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.5/5.0
Behavior2/5

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

With no annotations provided, the description must disclose behavioral traits. It only states the action, missing details like permission requirements, return behavior, or side effects.

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

Conciseness3/5

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

The description is a single short sentence, making it concise, but lacks structure and does not provide useful information beyond the name. It is efficient but insufficient.

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?

Despite having an output schema, the description is too minimal for a tool with 4 parameters and sibling tools. It leaves many questions unanswered, such as the return value and handling of optional parameters.

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

Parameters3/5

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

Input schema has 100% description coverage for all 4 parameters, so the description adds no extra value. Baseline score of 3 applies.

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

Purpose3/5

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

The description 'Create a single record' states the verb and resource, and hints at single-record creation, but it doesn't specify the context (e.g., Airtable) nor clearly differentiate from 'create_records'. It is a slight improvement over a tautology but remains generic.

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?

No guidance on when to use this tool versus siblings like 'create_records' or 'update_records'. The description lacks prerequisites, context, or alternatives.

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