By Sagar Shankaran, Founder of CallSphere
VAPI deprecated 'Custom Functions' for the Tools API. Wire a webhook tool, secure with HMAC, and ship a working appointment-booker — code + pitfalls.
Key takeaways
TL;DR — VAPI's "Custom Functions" feature was deprecated in 2026 in favor of the Tools API. Tools are reusable across assistants, support async webhooks, and have a clean HMAC-signed contract. This is the only correct way to extend a VAPI agent today.
A VAPI assistant that calls a book_appointment tool against your Next.js webhook, validates the HMAC signature, books the slot in Postgres, and returns a confirmation the assistant speaks aloud.
flowchart LR
CL[Caller] --> VP[VAPI assistant]
VP -- function_call --> TL[Tool: book_appointment]
TL -- HMAC POST --> WH[Your /api/vapi/book webhook]
WH -- result JSON --> VP --> CL
In dash.vapi.ai → Tools → Create. Pick Custom Tool and fill:
book_appointmenthttps://yourhost.com/api/vapi/book```json { "type": "object", "properties": { "iso": { "type": "string", "description": "ISO-8601 datetime" }, "name": { "type": "string" } }, "required": ["iso", "name"] } ```
Hear it before you finish reading
Talk to a live CallSphere AI voice agent in your browser — 60 seconds, no signup.
In Assistants → Edit → Tools, toggle book_appointment on. The system prompt should mention "Use book_appointment once the caller confirms."
```ts // app/api/vapi/book/route.ts import crypto from "crypto"; import { db } from "@/lib/db";
export async function POST(req: Request) {
const raw = await req.text();
const sig = req.headers.get("x-vapi-signature") ?? "";
const expected = crypto.createHmac("sha256", process.env.VAPI_WEBHOOK_SECRET!)
.update(raw).digest("hex");
if (!crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(expected))) {
return new Response("bad sig", { status: 401 });
}
const body = JSON.parse(raw);
const call = body.message.toolCallList[0];
const { iso, name } = call.function.arguments;
await db.appt.create({ data: { iso, name } });
return Response.json({
results: [{
toolCallId: call.id,
result: Booked ${name} for ${iso}.,
}],
});
}
```
```ts
const r = await fetch("https://api.vapi.ai/assistant", {
method: "POST",
headers: { Authorization: Bearer ${process.env.VAPI_API_KEY},
"Content-Type": "application/json" },
body: JSON.stringify({
name: "Clinic Concierge",
model: { provider: "openai", model: "gpt-4o", toolIds: ["tool_book_appointment"] },
voice: { provider: "11labs", voiceId: "rachel" },
transcriber: { provider: "deepgram", model: "nova-3" },
firstMessage: "Hi — Sunrise Clinic, how can I help?",
}),
});
```
For long-running work (>5s), set async: true on the tool. VAPI keeps the user engaged with a fill phrase ("One sec while I check that...") and waits up to 60s for your webhook to POST a result back via the /call/:id/control endpoint.
vapi-cli simulate --assistant <id> --transcript 'I want 3pm tomorrow' exercises the tool path without spending phone minutes.
Still reading? Stop comparing — try CallSphere live.
CallSphere ships complete AI voice agents per industry — 14 tools for healthcare, 10 agents for real estate, 4 specialists for salons. See how it actually handles a call before you book a demo.
toolCallId mismatch: Your response results[].toolCallId MUST match the request call.id — otherwise VAPI ignores the result.200 even on duplicate, with the same result body.CallSphere ships 37 agents · 90+ tools · 115+ DB tables · 6 verticals, including a VAPI tier for low-volume franchise customers. $149/$499/$1,499 · 14-day trial · 22% affiliate.
Default vs custom tools? VAPI ships defaults like endCall, transferCall, dtmf — use them for control flow and reserve custom tools for business logic.
Latency? Tool execution adds your webhook RTT; keep p95 under 800ms or VAPI fills with a "still checking" line.
Streaming responses? Tools are request/response only — for streaming use a Custom LLM URL instead (separate feature).
Multi-step workflows? Use VAPI Workflows (visual graph) or chain tool calls in your prompt.
Written by
Sagar Shankaran· Founder, CallSphere
Sagar Shankaran is the founder of CallSphere, where he builds production AI voice and chat agents deployed across healthcare, hospitality, real estate, and home services. He writes about agentic AI, LLM engineering, and shipping voice agents that handle real calls in production.
See how AI voice agents work for your industry. Live demo available -- no signup required.
The voice AI market hits $47.5B by 2034. For gyms and PT studios, voice agents now make economic sense for member intake, upsells, and reactivation campaigns.
With the voice AI market at $47.5B by 2034 and OpenAI's realtime release this week, every dealership and service shop should be evaluating voice agents. Here's how.
Spring 2026 AC season starts now. With the voice AI market at $47.5B by 2034, HVAC shops without after-hours voice agents will lose to those that have them.
OpenAI's GPT-Realtime-Translate handles 70 input languages live at $0.034/min. Here is what that means for multilingual restaurant takeout — and how CallSphere ships it.
OpenAI's GPT-Realtime-Translate hits 70 languages at $0.034/min. For dental practices in diverse metros, this changes who picks up the phone — and who books the appointment.
Google Cloud Next rebranded Vertex AI as Gemini Enterprise Agent Platform with 2M context. Here is what that means for salon and beauty bookings — and where CallSphere fits.
© 2026 CallSphere LLC. All rights reserved.
Watch how CallSphere handles real customer calls, schedules appointments, and processes payments — live.