Skip to main content
Glama
webhook-module.ts925 B
import { FastifyPluginAsync } from 'fastify' import fastifyXmlBodyParser from 'fastify-xml-body-parser' import { webhookController } from './webhook-controller' export const webhookModule: FastifyPluginAsync = async (app) => { app.addContentTypeParser( 'application/json', { parseAs: 'string' }, (_req, body: string, done) => { if (body == null || body.trim() === '') { return done(null, {}) } try { done(null, JSON.parse(body)) } catch (err) { const error: Error & { statusCode?: number } = err instanceof Error ? err : new Error('JSON parsing failed') error.statusCode = 400 done(error, undefined) } }, ) await app.register(fastifyXmlBodyParser) await app.register(webhookController, { prefix: '/v1/webhooks' }) }

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