Skip to main content
Glama

delete_table

Destructive

Delete a table from an Airtable base using its ID and name. Requires exact name match to prevent accidental deletion and refuses to delete the last remaining table.

Instructions

Delete a table from an Airtable base. Requires both tableId AND the expected table name as a safety guard — refuses to delete if the name does not match. Airtable rejects deleting the last remaining table in a base.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appIdYesThe Airtable base/application ID
tableIdYesThe table ID to delete (e.g. "tblXXX")
expectedNameYesThe expected name of the table. Must match exactly or deletion is refused.
debugNoWhen true, include raw Airtable response in output for diagnostics

Implementation Reference

  • The delete_table handler function in the tool router. Receives {appId, tableId, expectedName, debug}, calls client.deleteTable(), and returns a success response.
    async delete_table({ appId, tableId, expectedName, debug }) {
      const result = await client.deleteTable(appId, tableId, expectedName);
      return ok(
        { deleted: true, tableId, name: expectedName },
        result,
        debug,
      );
    },
  • The AirtableClient.deleteTable() method. Validates IDs, checks expectedName matches actual table name (safety guard), calls POST /v0.3/table/{tableId}/destroy, and returns deletion result.
    async deleteTable(appId, tableId, expectedName) {
      assertAirtableId(appId, 'appId');
      assertAirtableId(tableId, 'tableId');
      const { name } = await this._resolveTableById(appId, tableId);
    
      if (name !== expectedName) {
        throw new Error(
          `Safety check failed: table ${tableId} is named "${name}" but expectedName was "${expectedName}". ` +
          `Refusing to delete to prevent accidental data loss.`
        );
      }
    
      const url = `https://airtable.com/v0.3/table/${tableId}/destroy`;
      const res = await this.auth.postForm(url, this._mutationParams({}, appId), appId);
    
      if (!res.ok) {
        const errBody = await res.text().catch(() => '');
        throw new Error(`deleteTable failed (${res.status}): ${errBody}`);
      }
    
      this.cache.invalidate(appId);
      const data = await res.json().catch(() => ({}));
      return { deleted: true, tableId, name: expectedName, ...data };
    }
  • The tool definition/schema for delete_table — defines name, description, annotations (destructive: true), and inputSchema requiring appId, tableId, and expectedName.
    {
      name: 'delete_table',
      description: 'Delete a table from an Airtable base. Requires both tableId AND the expected table name as a safety guard — refuses to delete if the name does not match. Airtable rejects deleting the last remaining table in a base.',
      annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
      inputSchema: {
        type: 'object',
        properties: {
          appId: { type: 'string', description: 'The Airtable base/application ID' },
          tableId: { type: 'string', description: 'The table ID to delete (e.g. "tblXXX")' },
          expectedName: {
            type: 'string',
            description: 'The expected name of the table. Must match exactly or deletion is refused.',
          },
          debug: debugProp,
        },
        required: ['appId', 'tableId', 'expectedName'],
      },
    },
  • Registration mapping delete_table to the 'table-destructive' category in TOOL_CATEGORIES.
    delete_table:           'table-destructive',
  • Mirror registration mapping delete_table to 'table-destructive' category in the extension-side tool-profile (must mirror tool-config.js).
    delete_table:              'table-destructive',
Behavior4/5

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

Annotations already indicate destructiveHint=true. The description adds behavioral context: the name-matching guard prevents accidental deletion, and the last-table restriction. No contradictions with annotations.

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?

Two sentences front-load the purpose and then add critical behavioral details. No unnecessary words. Every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 4 parameters, full schema coverage, and destructive annotations, the description covers the key safety constraints and restrictions. It doesn't detail return values, but that is acceptable without an output schema. The description is sufficiently complete for a destructive action.

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

Parameters4/5

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

The input schema has 100% description coverage, but the description adds meaning beyond it by explaining the safety role of expectedName and the diagnostic use of debug, which helps the agent understand parameter purpose.

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 'Delete a table from an Airtable base' using a specific verb and resource. It distinguishes from sibling tools like create_table or rename_table.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains the safety guard requiring tableId and expectedName, and warns that Airtable rejects deleting the last remaining table. It provides clear context for using this tool safely, though it does not explicitly mention when not to use it.

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/Automations-Project/VSCode-Airtable-Formula'

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