duplicate_view
Duplicate an Airtable view including filters, sorts, and field visibility to reuse full configuration.
Instructions
Duplicate an existing view with all its configuration (filters, sorts, field visibility, etc).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| appId | Yes | The Airtable base/application ID | |
| tableId | Yes | The table ID the view belongs to | |
| sourceViewId | Yes | The view ID to duplicate (e.g. "viwXXX") | |
| newName | Yes | Name for the duplicated view | |
| debug | No | When true, include raw Airtable response in output for diagnostics |
Implementation Reference
- The handler function that executes the duplicate_view tool logic. Calls client.duplicateView() and returns the result.
async duplicate_view({ appId, tableId, sourceViewId, newName, debug }) { const result = await client.duplicateView(appId, tableId, sourceViewId, newName); return ok( { duplicated: true, viewId: result.viewId, name: newName, sourceViewId }, result, debug, ); }, - The tool definition and inputSchema for duplicate_view, specifying required parameters: appId, tableId, sourceViewId, newName.
{ name: 'duplicate_view', description: 'Duplicate an existing view with all its configuration (filters, sorts, field visibility, etc).', annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false }, inputSchema: { type: 'object', properties: { appId: { type: 'string', description: 'The Airtable base/application ID' }, tableId: { type: 'string', description: 'The table ID the view belongs to' }, sourceViewId: { type: 'string', description: 'The view ID to duplicate (e.g. "viwXXX")' }, newName: { type: 'string', description: 'Name for the duplicated view' }, debug: debugProp, }, required: ['appId', 'tableId', 'sourceViewId', 'newName'], }, }, - The AirtableClient.duplicateView() method that makes the actual API call to /v0.3/view/{viewId}/create with copyMode: 'duplicate'.
async duplicateView(appId, tableId, sourceViewId, newName) { assertAirtableId(appId, 'appId'); assertAirtableId(tableId, 'tableId'); assertAirtableId(sourceViewId, 'sourceViewId'); const viewId = 'viw' + this._genRandomId(); const url = `https://airtable.com/v0.3/view/${viewId}/create`; const payload = { tableId, name: newName, type: 'grid', // type is inherited from source when duplicating copyFromViewId: sourceViewId, copyMode: 'duplicate', personalForUserId: null, lock: null, }; const res = await this.auth.postForm(url, this._mutationParams(payload, appId), appId); if (!res.ok) { const errBody = await res.text().catch(() => ''); throw new Error(`duplicateView failed (${res.status}): ${errBody}`); } this.cache.invalidate(appId); const data = await res.json().catch(() => ({})); return { viewId, ...data }; } - packages/mcp-server/src/tool-config.js:60-60 (registration)Tool category registration mapping duplicate_view to 'view-write' category in the tool configuration system.
duplicate_view: 'view-write', - packages/extension/src/mcp/tool-profile.ts:67-67 (registration)Mirror registration of duplicate_view in the VS Code extension's tool profile (kept in sync with tool-config.js).
duplicate_view: 'view-write',