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
TypeScript ai-agentai-agent-toolsai-agentsai-agents-frameworkmcpmcp-servermcp-toolsmcpsn8n-alternativeno-code-automationworkflowworkflow-automationworkflows
import { createAction, Property } from '@activepieces/pieces-framework';
import { calendar as googleCalendar } from '@googleapis/calendar';
import { googleCalendarCommon, googleCalendarAuth, createGoogleClient } from '../common';
import { calendarListEntryOutputSchema } from '../output-schemas';
export const addCalendarToCalendarlist = createAction({
auth: googleCalendarAuth,
name: 'addCalendarToCalendarlist',
classification: 'WRITE',
displayName: 'Add Calendar to calendarList',
description: "Adds other people's calendars to your calendarList",
props: {
id: Property.ShortText({
displayName: "Calendar Id",
description: "Find calendar id by going to calendar settings",
required: true
})
},
outputSchema: calendarListEntryOutputSchema,
async run(context) {
const id = context.propsValue.id;
const authClient = await createGoogleClient(context.auth);
const calendar = googleCalendar({ version: 'v3', auth: authClient});
const response = await calendar.calendarList.insert({
requestBody: {
id: id
}
})
return response.data;
},
});