Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

1.1 KB
Raw Blame
import { createAction } from '@activepieces/pieces-framework';
import { airtableAuth } from '../auth';
import { airtableCommon } from '../common';
import { getBaseSchemaActionOutputSchema } from '../output-schemas';

export const airtableGetBaseSchemaAction = createAction({
  auth: airtableAuth,
  name: 'airtable_get_base_schema',
  classification: 'READ',
  displayName: 'Get Base Schema',
  description: 'Lists every table in a base with its fields and views.',
  audience: 'human',
  outputSchema: getBaseSchemaActionOutputSchema,
  aiMetadata: {
    description:
      'Returns the full schema of a base — the list of all its tables along with their fields and types. Use to discover what tables and fields a base contains before reading or writing records. Read-only and idempotent.',
    idempotent: true,
  },
  props: {
    base: airtableCommon.base,
  },
  async run(context) {
    const { auth: personalToken, propsValue } = context;
    const { base: baseId } = propsValue;

    return await airtableCommon.fetchTableList({
      token: personalToken.secret_text,
      baseId: baseId as string,
    });
  },
});