> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lumisreach.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom Toolcalls

> Connect your AI phone agent to your own systems through a REST API, a webhook or GraphQL, so it can check an order, take a purchase or update an account during the call.

Custom Toolcalls let the AI agent on a phone number act in your own systems while it is on the call: look up where an order is, place a purchase, change a delivery address, update an account, or kick off a Zapier automation. Each toolcall is added to the agent's instructions and tool list as soon as you save it.

Find it at **Configure → Answer**, open a phone number, then the **Custom Toolcalls** tab.

## Add a toolcall

Click **Add toolcall** and start from a template or from scratch:

| Template | What the agent does |
| - | - |
| **Order status** | Looks up an order by the number the caller reads out |
| **Order history** | Lists the caller's recent orders |
| **Make a purchase** | Orders a product, confirming the saved card by its last 4 digits |
| **Send payment link** | Texts the caller a link to pay an amount |
| **Change an order** | Changes or cancels an order |
| **Update account** | Changes an account setting |
| **Automation webhook** | Sends the call's details to Zapier, Make, n8n or Pipedream (for example a callback request) |
| **GraphQL lookup** | Runs a GraphQL query against your API |

Then fill in three parts:

<Steps>
  <Step title="What it does">
    A name and a description of what it does and **when to use it**, for example "Look up the status of an order. Use when the caller asks where their order is." The agent decides when to call it from this description. Tick **Confirm with the caller before running** for anything that changes data or spends money.
  </Step>

  <Step title="Your backend">
    Pick **REST API**, **Webhook** or **GraphQL** and enter the endpoint. Reference inputs in the URL, headers or body as `{{order_number}}`. Put credentials in a header, never in the URL. Webhooks are signed with a secret you can rotate, sent as `X-LumisReach-Signature-256`, so your server can verify the request came from LumisReach.
  </Step>

  <Step title="Inputs the agent collects">
    The details the agent asks the caller for, each with a type, a description and, if you like, a list of allowed values (for example small, medium, large).
  </Step>
</Steps>

A connection test must pass before the toolcall can be saved.

## Call details you can use

These are filled in automatically at call time and never asked of the caller:

| Variable | Value |
| - | - |
| `{{caller_phone}}` | The caller's phone number (E.164) |
| `{{business_phone}}` | This LumisReach number (E.164) |
| `{{call_id}}` | The LumisReach call id |
| `{{tool_name}}` | This toolcall's name |

Requests also carry an `X-LumisReach-Call-Id` header, and `X-LumisReach-Test: true` when they come from a test.

## Limits

* Up to 20 toolcalls per phone number, and up to 20 inputs per toolcall.
* Your endpoint has up to 20 seconds to respond.
* Toolcalls work on both voice stacks.

<CardGroup cols={2}>
  <Card title="Custom prompts" icon="pen" href="/getting-started/customization/custom-prompts">
    Tell the agent how to use the results.
  </Card>

  <Card title="Test your agent" icon="flask" href="/getting-started/setup/testing">
    Run a test call before you go live.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.