← playbookhome →

Deeper · 03.B

One tool. One decision.

dispatch_lead is the only tool the AI receptionist needs. It converts spoken intent into routed work in under one second.

01

What dispatch_lead expects

  • customer_name — string
  • customer_phone — E.164 format
  • service_category — enum (plumbing, dental, locksmith, etc.)
  • location — city + neighborhood when known
  • urgency — enum (emergency, today, this_week)
  • notes — free text from the call
02

What dispatch_lead does

  1. 01
    Validate inputs
    Phone is valid for the country. Service category exists in the roster.
  2. 02
    Insert row in Supabase leads table
    Status pending, source domain stamped, conversion ID linked.
  3. 03
    Run provider lookup
    Roster query: same country + same service + capacity > 0 + last_dispatched < 5 minutes ago is excluded (to avoid spamming).
  4. 04
    Build the dispatch payload
    Customer info, service, urgency, scheduled time if any. Plus the Stripe-ready commission record stub.
  5. 05
    Fire three notifications
    WhatsApp template via SEND-MESSAGE.ts (never direct fetch to graph.facebook.com). Email via Mailgun. SMS via Twilio.
  6. 06
    Update lead status to dispatched
    Returns the success ack to ElevenLabs so the agent can close the call cleanly.
03

What dispatch_lead must not do

It must not give the customer the provider's direct number. The customer must not be able to bypass bord. That single rule is the entire reason the commission gets paid. The lead is a relationship, not a referral.

The moat is that the customer does not know who they're actually calling. They called bord. bord routed them. The provider serves them. The transaction never has bord's logo on the receipt, but bord owns the transaction.