Skip to main content
Glama

mcp-google-sheets

delete-contact.ts1.22 kB
import { createAction } from '@activepieces/pieces-framework'; import { HttpMethod } from '@activepieces/pieces-common'; import { callClickSendApi, clicksendCommon } from '../common'; import { clicksendAuth } from '../..'; export const clicksendDeleteContactAction = createAction({ auth: clicksendAuth, name: 'delete_contact', description: 'Deletes a contact from a contact list.', displayName: 'Delete Contact', props: { contact_list_id: clicksendCommon.contact_list_id, contact_id: clicksendCommon.contact_id, }, async run(context) { const { contact_id,contact_list_id } = context.propsValue; const username = context.auth.username; const password = context.auth.password; try { await callClickSendApi({ method: HttpMethod.DELETE, path: `/lists/${contact_list_id}/contacts/${contact_id}`, username, password, }); return { success: true, message: 'Contact deleted.' }; } catch (error: any) { if (error?.response?.status === 404) { throw new Error('Contact not found.'); } if (error?.response?.status === 403) { throw new Error('Permission denied.'); } throw error; } }, });

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