mcp-starterREADME.md1 match
30## What is the adapter for?
3132The MCP TypeScript SDK uses Node-specific APIs that don't play nicely with Deno
33or edge functions:
34
4const app = new Hono();
56// --- NEW VAPI WEBHOOK ENDPOINT ---
7app.post("/vapi-webhook", async (c) => {
8try {
9const webhookData = await c.req.json(); // Parse the incoming JSON payload from Vapi
1011// As per Vapi's 'end-of-call-report' format, the main payload is under 'message'
12if (webhookData && typeof webhookData.message === "object" && webhookData.message !== null) {
13console.log("--- Received Vapi End-of-Call Report Message ---");
14// Print the entire 'message' object, pretty-formatted for readability in Val Town logs
15console.log(JSON.stringify(webhookData.message, null, 2));
16console.log("--- End of Vapi Report ---");
17} else {
18console.warn(
19"Received Vapi webhook payload, but 'message' field was not an object or was missing. Full payload:",
20webhookData,
21);
22}
2324// Always return a 200 OK status to Vapi to acknowledge successful receipt of the webhook.
25// If you don't return 200, Vapi might retry sending the webhook.
26return c.json({ status: "success", message: "Webhook received and processed" }, 200);
27} catch (error) {
28// If there's any error during processing, log it and return a 500 status.
29console.error("Error processing Vapi webhook:", error);
30return c.json({ status: "error", message: "Failed to process webhook" }, 500);
31}
GlancersetCobrowse.ts1 match
13console.log(page.id);
14// get the cobrowse value from the payload
15// warning: properties in Notion are capitalized as a convention (see Cobrowse)
16const cobrowse = page.properties.Cobrowse.checkbox ? false : true;
17// save new cobrowse boolean to Notion page
GlancerdemoCache.ts1 match
6// Initialize Notion client
7const notion = new Client({
8auth: Deno.env.get("NOTION_API_KEY"),
9});
10
4// Initialize Notion client
5const notion = new Client({
6auth: Deno.env.get("NOTION_API_KEY"),
7});
8
3// Initialize Notion client
4const notion = new Client({
5auth: Deno.env.get("NOTION_API_KEY"),
6});
7
GlancerpageID.controller.ts1 match
3// Initialize Notion client
4const notion = new Client({
5auth: Deno.env.get("NOTION_API_KEY"),
6});
7
3// Initialize Notion client
4const notion = new Client({
5auth: Deno.env.get("NOTION_API_KEY"),
6});
7
GlancerdemoURL.controller.ts1 match
3// Initialize Notion client
4const notion = new Client({
5auth: Deno.env.get("NOTION_API_KEY"),
6});
7
3// Initialize Notion client
4const notion = new Client({
5auth: Deno.env.get("NOTION_API_KEY"),
6});
7