Skip to main content
Glama
felores

Airtable MCP Server

by felores

create_field

Add a new field to an Airtable table by specifying the field name, type, and optional description or options to customize your database structure.

Instructions

Create a new field in a table

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
base_idYesID of the base
table_idYesID of the table
fieldYes

Implementation Reference

  • Handler function for the 'create_field' tool. It validates the field input and sends a POST request to the Airtable metadata API to create a new field in the specified table.
    case "create_field": {
      const { base_id, table_id, field } = request.params.arguments as {
        base_id: string;
        table_id: string;
        field: FieldOption;
      };
      
      // Validate field before creation
      const validatedField = this.validateField(field);
      
      const response = await this.axiosInstance.post(
        `/meta/bases/${base_id}/tables/${table_id}/fields`,
        validatedField
      );
      
      return {
        content: [{
          type: "text",
          text: JSON.stringify(response.data, null, 2),
        }],
      };
    }
  • src/index.ts:174-213 (registration)
    Tool registration in the list of available tools, including name, description, and detailed input schema definition.
    {
      name: "create_field",
      description: "Create a new field in a table",
      inputSchema: {
        type: "object",
        properties: {
          base_id: {
            type: "string",
            description: "ID of the base",
          },
          table_id: {
            type: "string",
            description: "ID of the table",
          },
          field: {
            type: "object",
            properties: {
              name: {
                type: "string",
                description: "Name of the field",
              },
              type: {
                type: "string",
                description: "Type of the field",
              },
              description: {
                type: "string",
                description: "Description of the field",
              },
              options: {
                type: "object",
                description: "Field-specific options",
              },
            },
            required: ["name", "type"],
          },
        },
        required: ["base_id", "table_id", "field"],
      },
    },
  • Helper function to validate and normalize field options before creation, removing unnecessary options or adding defaults based on field type.
    private validateField(field: FieldOption): FieldOption {
      const { type } = field;
    
      // Remove options for fields that don't need them
      if (!fieldRequiresOptions(type as FieldType)) {
        const { options, ...rest } = field;
        return rest;
      }
    
      // Add default options for fields that require them
      if (!field.options) {
        return {
          ...field,
          options: getDefaultOptions(type as FieldType),
        };
      }
    
      return field;
    }
  • Type definition for FieldOption used in create_field input.
    export interface FieldOption {
      name: string;
      type: FieldType;
      description?: string;
      options?: Record<string, any>;
    }
  • Helper function determining if a field type requires options, used in validation.
    export const fieldRequiresOptions = (type: FieldType): boolean => {
      switch (type) {
        case 'number':
        case 'singleSelect':
        case 'multiSelect':
        case 'date':
        case 'currency':
          return true;
        default:
          return false;
      }
    };

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are provided, and the description does not disclose behavioral traits like whether the field is added to the table schema immediately, if it affects existing records, or any required permissions. Minimal information.

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

Conciseness4/5

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

The description is a single clear sentence, front-loaded with the key action and resource. However, it could be slightly more informative without losing conciseness.

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 nested field object and no output schema, the description is too minimal. It does not explain what happens after creation, return values, or error conditions.

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 67% coverage with descriptions for parameters. The tool description adds no additional meaning beyond what the schema provides, so baseline 3 is appropriate.

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

Purpose5/5

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

The description clearly states the action (Create) and resource (new field in a table), which distinguishes it from sibling tools like create_record or update_field.

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 alternatives such as update_field (for modifying an existing field) or creating records. The description lacks context for decision-making.

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