Skip to main content
Glama

mcp-google-sheets

move-email-to-folder.ts1.27 kB
import { createAction, Property, OAuth2PropertyValue } from '@activepieces/pieces-framework'; import { Client, PageCollection } from '@microsoft/microsoft-graph-client'; import { MailFolder } from '@microsoft/microsoft-graph-types'; import { microsoftOutlookAuth } from '../common/auth'; import { mailFolderIdDropdown, messageIdDropdown } from '../common/props'; export const moveEmailToFolderAction = createAction({ auth: microsoftOutlookAuth, name: 'moveEmailToFolder', displayName: 'Move Email to Folder', description: 'Moves an email message to a specific folder.', props: { messageId: messageIdDropdown({ displayName: 'Email', description: 'Select the email message to move.', required: true, }), destinationFolderId: mailFolderIdDropdown({ displayName: 'Destination Folder', description: 'The folder to move the email to.', required: true, }), }, async run(context) { const { messageId, destinationFolderId } = context.propsValue; const client = Client.initWithMiddleware({ authProvider: { getAccessToken: () => Promise.resolve(context.auth.access_token), }, }); const response = await client.api(`/me/messages/${messageId}/move`).post({ destinationId: destinationFolderId, }); return response; }, });

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/activepieces/activepieces'

If you have feedback or need assistance with the MCP directory API, please join our Discord server