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.8 KB
Raw Blame
import { createAction, Property } from '@activepieces/pieces-framework';
import { HttpMethod } from '@activepieces/pieces-common';
import { vercelAuth } from '../common/auth';
import { vercelApiCall } from '../common/client';
import { vercelProjectDropdown } from '../common/props';

export const listEnvironmentVariables = createAction({
  auth: vercelAuth,
  name: 'list_environment_variables',
  classification: 'SEARCH',
  displayName: 'List Environment Variables',
  description: 'Retrieve environment variables for a Vercel project.',
  audience: 'both',
  aiMetadata: {
    description: 'List the environment variables configured on a Vercel project, optionally filtered to a specific Git branch (preview-scoped vars only) and optionally requesting decrypted values where permitted. Use this to discover existing keys before reading or upserting a variable. Requires the target project. Read-only and idempotent.',
    idempotent: true,
  },
  props: {
    project: vercelProjectDropdown,
    decrypt: Property.Checkbox({
      displayName: 'Decrypt Values',
      description: 'Deprecated by Vercel. If enabled, Vercel will attempt to return decrypted values when allowed.',
      required: false,
      defaultValue: false,
    }),
    git_branch: Property.ShortText({
      displayName: 'Git Branch',
      description: 'Optional branch filter. Only valid for preview-scoped variables.',
      required: false,
    }),
  },
  async run(context) {
    const { project, decrypt, git_branch } = context.propsValue;

    return await vercelApiCall({
      method: HttpMethod.GET,
      path: `/v10/projects/${encodeURIComponent(String(project))}/env`,
      auth: context.auth,
      query: {
        decrypt: decrypt ? 'true' : undefined,
        gitBranch: git_branch,
      },
    });
  },
});