Skip to main content
Glama

mcp-google-sheets

send-message.ts1.92 kB
import { createAction, Property } from '@activepieces/pieces-framework'; import { createSNS } from '../common'; import { amazonSnsAuth } from '../..'; import { ListTopicsCommand, PublishCommand } from "@aws-sdk/client-sns"; export const sendMessageAction = createAction({ auth: amazonSnsAuth, name: 'send-message', displayName: 'Send Message', description: 'Sends a message to an Amazon SNS topic.', props: { topic: Property.Dropdown({ displayName: 'Topic', description: 'Select a topic', required: true, refreshers: ['auth'], options: async ({ auth }) => { if (!auth) { return { disabled: true, options: [], placeholder: 'Please authenticate first', }; } const sns = await createSNS((auth as { accessKeyId: string, secretAccessKey: string, region: string, endpoint: string })); const topics = await sns.send(new ListTopicsCommand({})); if (topics.Topics) { return { options: topics.Topics.map((topic) =>( { label: topic.TopicArn?.split(':').pop() as string, value: topic.TopicArn as string, } )), }; } else { return { options: [], placeholder: 'No topics found', }; } }, }), message: Property.LongText({ displayName: 'Message', required: true, }), }, async run(context) { const { topic, message } = context.propsValue; const sns = createSNS(context.auth); const response = await sns.send(new PublishCommand({ TopicArn: topic, Message: message })); 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