Skip to main content
Glama

Activepieces MCP Server

by eldoonreval
webhook-simulation-side-effects.tsβ€’1.72 kB
import { ActivepiecesError, EngineResponseStatus, ErrorCode, FlowId, FlowVersionId, isNil, ProjectId, } from '@activepieces/shared' import { FastifyBaseLogger } from 'fastify' import { flowService } from '../../flows/flow/flow.service' import { triggerHooks } from '../../flows/trigger' type BaseParams = { projectId: ProjectId flowId: FlowId flowVersionId?: FlowVersionId } type PreCreateParams = BaseParams type PreDeleteParams = BaseParams export const webhookSideEffects = (log: FastifyBaseLogger) => ({ async preCreate({ projectId, flowId }: PreCreateParams): Promise<void> { const { version: flowVersion } = await flowService(log).getOnePopulatedOrThrow({ id: flowId, projectId, }) const response = await triggerHooks.enable({ projectId, flowVersion, simulate: true, }, log) if (isNil(response) || response.status !== EngineResponseStatus.OK) { throw new ActivepiecesError({ code: ErrorCode.TRIGGER_ENABLE, params: { flowVersionId: flowVersion.id, }, }) } }, async preDelete({ projectId, flowId, flowVersionId, }: PreDeleteParams): Promise<void> { const { version: flowVersion } = await flowService(log).getOnePopulatedOrThrow({ id: flowId, projectId, versionId: flowVersionId, }) await triggerHooks.disable( { projectId, flowVersion, simulate: true, }, log, ) }, })

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/eldoonreval/activepieces'

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