Skip to main content
Glama
webhooks.ts1.17 kB
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { createToolHandler, getAuthToken } from "../utils.js"; import { JustCallApiService } from "../../sdk/justcall.js"; import { ListWebhooksSchema, CreateWebhookSchema } from "../../schema/index.js"; export const registerWebhookTools = (server: McpServer) => { const justcallAPIservice = new JustCallApiService(); // List Webhooks Tool server.tool( "list_webhooks", "Retrieve all configured webhooks", ListWebhooksSchema, { readOnlyHint: true, }, createToolHandler(async (params, context) => { const authToken = getAuthToken(context); return justcallAPIservice.listWebhooks({ authToken, context, ...params, }); }), ); // Create Webhook Tool server.tool( "create_webhook", "Create a new webhook endpoint to receive real-time notifications", CreateWebhookSchema, createToolHandler(async (params, context) => { const authToken = getAuthToken(context); return justcallAPIservice.createWebhook({ authToken, context, ...params, }); }), ); };

Latest Blog Posts

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/saaslabsco/justcall-mcp-server'

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