Skip to main content
Glama
felores

Airtable MCP Server

by felores

create_table

Add a new table to an Airtable base with custom fields and structure for organizing data.

Instructions

Create a new table in a base

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
base_idYesID of the base
table_nameYesName of the new table
descriptionNoDescription of the table
fieldsNoInitial fields for the table

Implementation Reference

  • The main handler for the 'create_table' tool. It extracts arguments, validates fields using validateField, makes a POST request to Airtable's metadata API to create the table, and returns the response as text.
    case "create_table": {
      const { base_id, table_name, description, fields } = request.params.arguments as {
        base_id: string;
        table_name: string;
        description?: string;
        fields?: FieldOption[];
      };
      
      // Validate and prepare fields
      const validatedFields = fields?.map(field => this.validateField(field));
      
      const response = await this.axiosInstance.post(`/meta/bases/${base_id}/tables`, {
        name: table_name,
        description,
        fields: validatedFields,
      });
      
      return {
        content: [{
          type: "text",
          text: JSON.stringify(response.data, null, 2),
        }],
      };
    }
  • Input schema definition for the 'create_table' tool, including parameters for base_id, table_name, description, and fields array with their types.
    {
      name: "create_table",
      description: "Create a new table in a base",
      inputSchema: {
        type: "object",
        properties: {
          base_id: {
            type: "string",
            description: "ID of the base",
          },
          table_name: {
            type: "string",
            description: "Name of the new table",
          },
          description: {
            type: "string",
            description: "Description of the table",
          },
          fields: {
            type: "array",
            description: "Initial fields for the table",
            items: {
              type: "object",
              properties: {
                name: {
                  type: "string",
                  description: "Name of the field",
                },
                type: {
                  type: "string",
                  description: "Type of the field (e.g., singleLineText, multilineText, number, etc.)",
                },
                description: {
                  type: "string",
                  description: "Description of the field",
                },
                options: {
                  type: "object",
                  description: "Field-specific options",
                },
              },
              required: ["name", "type"],
            },
          },
        },
        required: ["base_id", "table_name"],
      },
    },
  • Helper function used by the create_table handler to validate and normalize field definitions by removing unnecessary options or adding defaults.
    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;
    }
  • TypeScript interface defining the structure of a FieldOption, used in the input schema for fields in create_table.
    export interface FieldOption {
      name: string;
      type: FieldType;
      description?: string;
      options?: Record<string, any>;
    }
  • Helper functions to determine if a field type requires options and to provide default options, used by validateField in the create_table handler.
    export const fieldRequiresOptions = (type: FieldType): boolean => {
      switch (type) {
        case 'number':
        case 'singleSelect':
        case 'multiSelect':
        case 'date':
        case 'currency':
          return true;
        default:
          return false;
      }
    };
    
    export const getDefaultOptions = (type: FieldType): Record<string, any> | undefined => {
      switch (type) {
        case 'number':
          return { precision: 0 };
        case 'date':
          return { dateFormat: { name: 'local' } };
        case 'currency':
          return { precision: 2, symbol: '$' };
        default:
          return undefined;
      }
    };
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 the action ('Create') without disclosing behavioral traits. It doesn't mention permissions required, whether the operation is idempotent, what happens on conflicts (e.g., duplicate table names), or the response format. For a mutation tool with zero annotation coverage, this is a significant gap.

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 with zero waste. It's front-loaded with the core action and resource, making it easy to scan and understand quickly.

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 creating a table with multiple parameters and no annotations or output schema, the description is inadequate. It doesn't cover behavioral aspects, usage context, or return values, leaving significant gaps for an AI agent to understand how to invoke this tool correctly.

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?

The schema description coverage is 100%, so the schema already documents all 4 parameters thoroughly. The description adds no additional meaning beyond what's in the schema (e.g., it doesn't explain relationships between parameters like how 'fields' relate to 'table_name'). Baseline 3 is appropriate when the schema does the heavy lifting.

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 verb ('Create') and resource ('new table in a base'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'create_field' or 'create_record', which also create resources in bases, so it doesn't fully distinguish its specific scope.

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 prerequisites (e.g., needing an existing base), exclusions, or comparisons to siblings like 'create_field' (for adding fields to existing tables) or 'update_table' (for modifying tables).

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/felores/airtable-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server