Skip to main content
Glama

mcp-google-sheets

new-saved-message.ts1.09 kB
import { TriggerStrategy, createTrigger } from '@activepieces/pieces-framework'; import { slackAuth } from '../../'; export const newSavedMessageTrigger = createTrigger({ auth: slackAuth, name: 'new-saved-message', displayName: 'New Saved Message', description: 'Triggers when you save a message.', props: {}, type: TriggerStrategy.APP_WEBHOOK, sampleData: undefined, onEnable: async (context) => { // Older OAuth2 has team_id, newer has team.id const teamId = context.auth.data['team_id'] ?? context.auth.data['team']['id']; context.app.createListeners({ events: ['star_added'], identifierValue: teamId, }); }, onDisable: async (context) => { // Ignored }, run: async (context) => { const payloadBody = context.payload.body as PayloadBody; // check if it's saved message if (payloadBody.event.type === 'star_added' && payloadBody.event.item.type ==='message') { return [payloadBody.event.item]; } return []; }, }); type PayloadBody = { event: { type: string; event_ts: string; item:{ type:string } }; };

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