delete_table
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
| Name | Required | Description | Default |
|---|---|---|---|
| appId | Yes | The Airtable base/application ID | |
| tableId | Yes | The table ID to delete (e.g. "tblXXX") | |
| expectedName | Yes | The expected name of the table. Must match exactly or deletion is refused. | |
| debug | No | When 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'], }, }, - packages/mcp-server/src/tool-config.js:44-44 (registration)Registration mapping delete_table to the 'table-destructive' category in TOOL_CATEGORIES.
delete_table: 'table-destructive', - packages/extension/src/mcp/tool-profile.ts:53-53 (registration)Mirror registration mapping delete_table to 'table-destructive' category in the extension-side tool-profile (must mirror tool-config.js).
delete_table: 'table-destructive',