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.2 KB
Raw Blame
import { HttpMethod } from '@activepieces/pieces-common';
import { createAction, Property } from '@activepieces/pieces-framework';
import { ticktickAuth } from '../auth';
import { tickTickApiCall } from '../common/client';
import { getProjectOutputSchema } from '../output-schemas';

export const getProjectAction = createAction({
	auth: ticktickAuth,
	name: 'get_project',
	outputSchema: getProjectOutputSchema,
	classification: 'READ',
	displayName: 'Get Task List',
	description: 'Retrieves the details of a specific task list by ID.',
	audience: 'human',
	aiMetadata: {
		description:
			'Fetches the details of a single TickTick task list (project) by its list ID. Use when you have a list ID and need its metadata. Read-only and idempotent.',
		idempotent: true,
	},
	props: {
		projectId: Property.ShortText({
			displayName: 'List ID',
			description: 'Select the list to retrieve details for.',
			required: true,
		}),
	},
	async run(context) {
		const { projectId } = context.propsValue;

		const response = await tickTickApiCall({
			accessToken: context.auth.access_token,
			method: HttpMethod.GET,
			resourceUri: `/project/${projectId}`,
		});

		return response;
	},
});