list_tables
Lists all tables in an Airtable base, returning their names and IDs. Enables quick identification of table structure for further operations.
Instructions
List all tables in an Airtable base with their IDs and names. Uses lightweight scaffolding data.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| appId | Yes | The Airtable base/application ID | |
| debug | No | When true, include raw Airtable response in output for diagnostics |
Implementation Reference
- The main handler function for list_tables. Calls client.getScaffoldingData(appId) to fetch lightweight table scaffolding data, extracts tables from the response, and returns a summary of table IDs and names. Uses the lightweight scaffolding API endpoint rather than the full application/read endpoint.
async list_tables({ appId, debug }) { const raw = await client.getScaffoldingData(appId); const tables = raw?.data?.tableSchemas || raw?.data?.tables || raw?.data?.tableOrder?.map(id => { const t = raw?.data?.tableDatas?.[id] || raw?.data?.tableById?.[id] || {}; return { id, name: t.name || id }; }) || Object.values(raw?.data?.tableById || {}); const summary = tables.map(t => ({ id: t.id, name: t.name, })); return ok(summary, raw, debug); }, - The input schema definition for list_tables. Defines the tool name, description ('List all tables...uses lightweight scaffolding data'), annotations (readOnlyHint: true), and inputSchema (requires appId, optional debug). Registered in the TOOLS array.
{ name: 'list_tables', description: 'List all tables in an Airtable base with their IDs and names. Uses lightweight scaffolding data.', annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false }, inputSchema: { type: 'object', properties: { appId: { type: 'string', description: 'The Airtable base/application ID' }, debug: debugProp, }, required: ['appId'], }, }, - packages/mcp-server/src/tool-config.js:20-20 (registration)Registration of list_tables in the TOOL_CATEGORIES mapping, categorizing it as 'read' (read-only/inspection).
list_tables: 'read', - packages/extension/src/mcp/tool-profile.ts:34-34 (registration)Mirror registration of list_tables in the VS Code extension's tool-profile mapping, also categorized as 'read'.
list_tables: 'read', - The getScaffoldingData method on AirtableClient that the list_tables handler calls. Hits the Airtable internal API endpoint /v0.3/{appId}/getApplicationScaffoldingData for lightweight data, uses caching via SchemaCache.
async getScaffoldingData(appId) { assertAirtableId(appId, 'appId'); const cached = this.cache.getScaffolding(appId); if (cached) return cached; const url = `https://airtable.com/v0.3/${appId}/getApplicationScaffoldingData`; const res = await this.auth.get(url, appId); if (!res.ok) { const text = await res.text(); throw new Error(`getScaffoldingData failed (${res.status}): ${text}`); } const data = await res.json(); this.cache.setScaffolding(appId, data); return data; }