Skip to main content
Glama

mcp-google-sheets

updated-subscriber.ts1.42 kB
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework'; import { makeSenderRequest, senderAuth } from '../common/common'; import { HttpMethod } from '@activepieces/pieces-common'; export const updatedSubscriberTrigger = createTrigger({ auth: senderAuth, name: 'updated_subscriber', displayName: 'Updated Subscriber', description: "Fires when a subscriber's data (fields) is updated", type: TriggerStrategy.WEBHOOK, props: {}, async onEnable(context) { const webhookUrl = context.webhookUrl; const webhookData = { url: webhookUrl, topic: 'subscribers/updated', }; const response = await makeSenderRequest( context.auth, '/account/webhooks', HttpMethod.POST, webhookData ); await context.store.put('webhookId', response.body.data.id); }, async onDisable(context) { const webhookId = await context.store.get<string>('webhookId'); if (webhookId) { await makeSenderRequest( context.auth, `/account/webhooks/${webhookId}`, HttpMethod.DELETE ); } await context.store.delete('webhookId'); }, async run(context) { return [context.payload.body]; }, async test(context) { const response = await makeSenderRequest( context.auth, '/subscribers?limit=1', HttpMethod.GET ); return response.body.data || []; }, sampleData: {}, });

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