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

# Custom mid-call tools

> Create custom API integrations that your AI assistant can use during calls to fetch real-time data or interact with external systems.

Custom mid-call tools let your AI assistant interact with your external systems during a call — checking inventory, verifying customer data, fetching real-time information, or triggering any API you own.

<Note>
  No coding is required to configure a custom tool. You define the API endpoint, parameters, and when the AI should use it. The AI automatically knows how to call it.
</Note>

## What you can build

* Look up order status from your backend
* Verify a customer's identity against your CRM
* Check appointment availability from a custom calendar system
* Fetch product pricing, stock levels, or account information
* Trigger any REST API endpoint with dynamic data from the conversation

## Setting up a custom tool

### 1. Create the tool

<Steps>
  <Step title="Navigate to mid-call tools">
    In your assistant settings, go to **Prompt & Tools** → **Custom Mid-Call Tools** and click **Create Mid-Call Tool**.
  </Step>

  <Step title="Fill in the main settings">
    Configure the essential details:

    * **Name:** Use lowercase letters and underscores (e.g., `check_order_status`). This is what the AI refers to internally.
    * **Description:** Explain when and how the AI should use this tool. Be specific — this directly affects when the AI decides to call it.
    * **Endpoint:** Your API URL (e.g., `https://api.yourcompany.com/orders`).
    * **Timeout:** How long to wait for a response, in seconds.
    * **Method:** Choose GET, POST, PUT, PATCH, or DELETE.
  </Step>

  <Step title="Add headers">
    Include any required headers, such as:

    ```yaml theme={null}
    Content-Type: application/json
    Authorization: Bearer your_token
    ```
  </Step>
</Steps>

### 2. Define parameters

Parameters are the pieces of information the AI collects during the call and passes to your API.

<Steps>
  <Step title="Add a parameter">
    For each piece of data your API needs, configure:

    * **Name:** The parameter identifier (e.g., `order_number`)
    * **Type:** `string`, `number`, or `true_false`
    * **Description:** What the AI should collect and any format requirements
  </Step>

  <Step title="Set validation rules">
    Add format requirements in the description field:

    ```yaml theme={null}
    "Date in dd/mm/yyyy format"
    "10-digit phone number without spaces"
    "Email address for confirmation"
    ```
  </Step>
</Steps>

## Parameter types

<CardGroup cols={2}>
  <Card title="String" icon="font">
    Text values like names, addresses, or reference numbers.

    ```yaml theme={null}
    Type: string
    Examples: "John Doe", "ORD-12345"
    ```
  </Card>

  <Card title="Number" icon="calculator">
    Numeric values like amounts, quantities, or IDs.

    ```yaml theme={null}
    Type: number
    Examples: 42, 99.99
    ```
  </Card>

  <Card title="true_false" icon="toggle-on">
    Boolean values for yes/no situations.

    ```yaml theme={null}
    Type: true_false
    Examples: true, false
    ```
  </Card>

  <Card title="Format hints" icon="wand-magic-sparkles">
    Add format instructions in the description to guide the AI.

    ```yaml theme={null}
    "Date in dd/mm/yyyy"
    "Phone without spaces"
    ```
  </Card>
</CardGroup>

## Dynamic endpoints

You can make your endpoint URL dynamic by including parameter names in curly braces:

```yaml theme={null}
Static URL:
https://api.example.com/orders/status

Dynamic URL:
https://api.example.com/orders/{order_id}/status
```

The AI automatically replaces `{order_id}` with the actual value it collects during the conversation.

<Warning>
  Enclose variable names in curly braces and use the exact parameter name as defined in your parameter configuration.
</Warning>

## Testing your tool

Click **Test Tool** to run a test with dummy data:

* String parameters use `"test"`
* Number parameters use `1`
* Boolean parameters use `true`

You'll see the response status code and body, so you can verify your endpoint is reachable and returning the expected structure before going live.

## Integrating with the automation platform

For complex logic that goes beyond a single API call, connect your custom tool to the no-code automation platform:

<Steps>
  <Step title="Create a webhook flow">
    In the automation platform, create a new flow with a **Webhook trigger**, add your logic (multiple API calls, data transformation, error handling), and end with **Return Response**.
  </Step>

  <Step title="Use the webhook URL as your endpoint">
    In your custom tool settings, set the endpoint to your webhook URL and append `/sync`:

    ```
    https://portal.intellixent.ai/automation/webhook/abc123/sync
    ```
  </Step>
</Steps>

This approach lets you transform data, make sequential API calls, apply business logic, and handle errors gracefully — all without code.

## Real-world examples

<AccordionGroup>
  <Accordion title="Order lookup" icon="magnifying-glass">
    ```yaml theme={null}
    Name: check_order
    Endpoint: https://api.yourshop.com/orders/{order_number}
    Parameters:
      - Name: order_number
        Type: string
        Description: "Order reference (format: ORD-XXXXX)"
    ```

    The AI will:

    1. Ask the caller for their order number.
    2. Fetch the status from your API.
    3. Explain the delivery date and status in plain language.
  </Accordion>

  <Accordion title="Appointment availability" icon="calendar">
    ```yaml theme={null}
    Name: check_slots
    Endpoint: https://api.calendar.com/availability
    Parameters:
      - Name: service
        Type: string
        Description: "Service type (haircut, massage, consultation)"
      - Name: date
        Type: string
        Description: "Preferred date (dd/mm/yyyy)"
    ```

    The AI will:

    1. Ask about the desired service.
    2. Get the caller's preferred date.
    3. Show available time slots.
  </Accordion>

  <Accordion title="Customer verification" icon="shield-check">
    ```yaml theme={null}
    Name: verify_customer
    Endpoint: https://api.crm.com/verify
    Parameters:
      - Name: phone
        Type: string
        Description: "10-digit phone number"
      - Name: email
        Type: string
        Description: "Email address for verification"
    ```

    The AI will:

    1. Collect the caller's contact details.
    2. Verify them against your CRM.
    3. Proceed based on the verification result.
  </Accordion>
</AccordionGroup>

## Configuring your assistant to use the tool

Add instructions to your system prompt so the AI knows when and how to use each custom tool:

```yaml theme={null}
When to use check_order:
1. Customer asks about order status
2. Customer mentions tracking or delivery
3. Customer wants to know where their package is

How to use it:
1. Ask for the order number if not provided
2. Verify the format (ORD-XXXXX)
3. Call the tool to fetch the status
4. Explain the result in simple terms
```

<Tip>
  Test your tools with various conversation flows before going live. Start with simple scenarios and work toward edge cases.
</Tip>
