Function Calling

Agents that do things,
not just say them.

We build your agent to call your APIs mid-conversation — look up an order, write to a CRM, charge a card, page an on-call — without dropping context or pausing the caller. You bring the endpoints; we do the wiring.

tools.tsTypeScript
import { tool } from "@convexa/sdk";

export const lookupOrder = tool({
  name: "lookup_order",
  description: "Look up an order by ID. Returns status, items, and ETA.",
  parameters: z.object({
    orderId: z.string().regex(/^ORD-\d{6}$/),
  }),
  run: async ({ orderId }) => {
    const r = await fetch(`https://api.acme.com/orders/${orderId}`);
    return r.json();
  },
});
CALL TIMELINE · call_3f9a
0:00.4
“Hi, this is Owen from Acme. How can I help?”
0:03.1
“Checking on my order — it’s ORD-441298.”
0:04.0
FUNCTION · 312 ms
lookup_order({ orderId: "ORD-441298" })
{ status: "shipped", eta: "Tue 14 May" }
0:04.5
“It shipped — should be at your door Tuesday. Want me to text you the tracking link?”
0:08.2
“Yeah please.”
0:08.8
FUNCTION · 88 ms
send_sms({ to: "+1415★★0922", body: "tracking link…" })
{ sent: true }
0:09.2
“Sent. Anything else?”
How it runs on the wire

Tool calls happen
during the call,
not after.

Convexa runs your functions inline in the conversation loop. The agent waits for a result, narrates a polite hold (“one sec, let me pull that up”), and continues — typically in around 140 ms.

Parallel execution

The model calls multiple tools in one turn — look up the order, check inventory, fetch the customer’s tier — and reasons over the results.

Graceful waiting

If a tool will take > 300 ms, the agent fills with a natural “let me check that” line — never silent dead air.

Validated arguments

JSON-schema or Zod validation runs before your function executes. Bad arguments are refused without you writing the guard.

Retry & fail-safe

Retries with exponential backoff, tuned per tool. On final failure, the agent owns up — “the system isn’t responding, can I take a message?”

Secrets stay yours

Tool URLs and headers are stored encrypted, scoped per-agent, never logged. The model never sees raw credentials.

Per-tool permissions

We flag sensitive tools as “requires_confirmation” and the agent reads the action back to the caller before invoking — perfect for refunds, charges, deletions.

Why latency matters

The difference between
an agent that feels alive
and one that doesn’t.

Most voice platforms run tools serially with the LLM call. Convexa runs them in the same forward pass.

Before · cascade pipeline

1.8 second tool round-trip

ASR~ 200 ms
LLM thinks & emits tool call~ 600 ms
Tool executes~ 140 ms
LLM thinks & emits answer~ 600 ms
TTS~ 280 ms
Total dead air1,820 ms
With Convexa · speech-to-speech

620 ms — including the tool

Speech model receives audio~ 80 ms
Tool emitted in-pass~ 220 ms
Tool executes (parallel)~ 140 ms
Speech response generated~ 180 ms
Filler fades into responseseamless
Total perceived gap620 ms
Common tools

A few of the tools
we wire up for customers.

Convexa isn’t a closed library. Any HTTP endpoint, any internal service, any third-party SaaS — tell us where it lives and our team connects it to your agent. It pairs naturally with order management and appointment scheduling workflows.

lookup_order

Pull order status, items, ETA, tracking URL.

get_customer

Profile by phone or account ID. Tier, balance, last contact.

book_appointment

Real-time slot lookup + booking in Calendly, Acuity, or your DB.

charge_card

Tokenized capture; secrets never seen by the model. PCI scope contained.

refund

Confirmation-gated. Reads the amount back before executing.

open_ticket

Create in Zendesk, Intercom, Linear, or Jira. Auto-tagged from intent.

send_sms

Drop a follow-up text from the same agent number.

send_email

Templated, with caller-fillable variables.

write_crm

Update Salesforce, HubSpot, Pipedrive on call outcome.

page_oncall

Trip a PagerDuty page when the caller mentions a P0 keyword.

repeat_rx

Clinical-system-gated repeat prescriptions. NHS DSPT-scoped.

custom HTTP

Any internal service. Auth via header, mTLS, or OAuth.

Built to scale,
human by design.

Talk to our team about wiring tools into your agent.