Skip to main content
Glama

mcp-google-sheets

app-connection-worker-controller.ts1.52 kB
import { ActivepiecesError, AppConnection, assertNotNullOrUndefined, EnginePrincipal, ErrorCode, GetAppConnectionForWorkerRequestQuery, isNil, PrincipalType, } from '@activepieces/shared' import { FastifyPluginAsyncTypebox, } from '@fastify/type-provider-typebox' import { appConnectionService } from './app-connection-service/app-connection-service' export const appConnectionWorkerController: FastifyPluginAsyncTypebox = async (app) => { app.get('/:externalId', GetAppConnectionRequest, async (request): Promise<AppConnection> => { const enginePrincipal = (request.principal as EnginePrincipal) assertNotNullOrUndefined(enginePrincipal.projectId, 'projectId') const appConnection = await appConnectionService(request.log).getOne({ projectId: enginePrincipal.projectId, platformId: enginePrincipal.platform.id, externalId: request.params.externalId, }) if (isNil(appConnection)) { throw new ActivepiecesError({ code: ErrorCode.ENTITY_NOT_FOUND, params: { entityId: `externalId=${request.params.externalId}`, entityType: 'AppConnection', }, }) } return appConnection }, ) } const GetAppConnectionRequest = { config: { allowedPrincipals: [PrincipalType.ENGINE], }, schema: { params: GetAppConnectionForWorkerRequestQuery, }, }

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