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.3 KB
Raw Blame
import { Property, createAction } from '@activepieces/pieces-framework';
import { HttpMethod, getAccessTokenOrThrow } from '@activepieces/pieces-common';

import { callClickUpApi } from '../../common';
import { clickupAuth } from '../../auth';
import { membersOutputSchema } from '../../output-schemas';

export const clickupGetTaskMembersAi = createAction({
  auth: clickupAuth,
  name: 'clickup_get_task_members',
  classification: 'READ',
  description: 'List the members who have access to a task',
  audience: 'ai',
  aiMetadata: {
    description:
      'List the people who have access to a ClickUp task, identified by its task ID. Use this to discover member IDs (e.g. before assigning) or to check who can see a task. Read-only and idempotent.',
    idempotent: true,
  },
  displayName: 'Get Task Members',
  outputSchema: membersOutputSchema,
  props: {
    task_id: Property.ShortText({
      displayName: 'Task ID',
      description: 'The ID of the task to list members for.',
      required: true,
    }),
  },
  async run(configValue) {
    const { task_id } = configValue.propsValue;
    const response = await callClickUpApi(
      HttpMethod.GET,
      `task/${task_id}/member`,
      getAccessTokenOrThrow(configValue.auth),
      undefined
    );

    return response.body;
  },
});