Tools
Tools in a Block Agent fundamentally behave the same as in a GPT or SAM Agent. Your Tools enable the agent to capture specific data points and detect user objectives during the course of a conversation.
There are a few special things to keep in mind when building your Block Agent:
-
Multiple Tools can be triggered at a single Turn.
-
For example, if you created a Tool that captures a caller’s name and a Tool that captures a caller’s date of birth, and a caller says, “My name is Jane Doe and I was born on May 5 1990”, we would expect that both Tools would trigger at that Turn.
-
-
The Block Agent makes two, parallel calls to the LLM at each Turn.
-
One call will produce an AI Response. The second call will trigger all appropriate Tools.
-
The LLM will always pick from one of the available Tools. Even if all choices are poor, it will attempt to select the best Tool from the available choices.
-
For example, if you “prime” an agent with an initial “hi” message for intent detection, and the available Tools at this step describe the known intent values, the model is going to pick an intent and move on to the next step (even if we are just using the primer message of “hi”). To get around this, we recommend including a function like “caller_intent_not_yet_detected”.
-
-
Tools follow the OpenAI function calling specification.
Types of Tools
Currently only function and mcp are accepted Tools.
Tool Properties
|
Property |
Description |
|---|---|
|
type |
function or mcp (Model Context Protocol) |
|
name |
A unique name for your function. |
|
description |
A brief blurb detailing when the Tool should be invoked. |
|
parameters |
Define any expected parameters associated with the Tool. |
Sample Tools
An intent detection Tool might look like this:
- type: function
function:
name: is_schedule_appointment
description: 'Use this when the user expresses interest/intent in scheduling an appointment, regardless of language. Common Spanish
phrases: ''quiero hacer una cita'', ''necesito programar una cita''.
Common English phrases: ''appointment'', ''I need to schedule'', ''cleaning'', ''new patient''.'
parameters:
type: object
properties:
schedule_appointment:
type: boolean
description: This will be true when the caller wants to schedule an appointment.
intent_utterance:
type: string
description: The verbatim user message that elicited this intent.
required:
- schedule_appointment
- intent_utterance
In this example, the description provides guidance for the LLM, including multilingual examples. When fired, the Tool captures both the intent boolean and the original utternace.
A data collection Tool, used to capture specific pieces of information from the user, might look like this:
- type: function
function:
name: collect_date_of_birth
description: 'Collect the full date of birth including year, month, and day. Execute this function whenever the user provides any date-related information.'
parameters:
type: object
properties:
birth_year:
type: string
description: The year of birth in numeric YYYY format.
pattern: ^[0-9]{4}$|^$
birth_month:
type: string
description: The month of birth in numeric MM format (01-12).
pattern: ^[0-9]{2}$|^$
birth_day:
type: string
description: The day of birth in numeric DD format (01-31).
pattern: ^[0-9]{2}$|^$
date_of_birth:
type: string
description: The complete date of birth in ISO format YYYY-MM-DD. ONLY populate when ALL three components are provided.
pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}$|^$
In this example, the pattern property enforces regex validation of the captured values. This ensures data quality at the point of collection.
A Tool supporting progressive data collection (capturing data across multiple Turns) might look like this:
- type: function
function:
name: collect_patient_profile
description: |-
Unified function to collect patient information for registration.
Call this function whenever the user provides ANY of the following:
- First name
- Last name
- Date of birth (full or partial)
- Phone number
You can call this function multiple times as you collect information progressively.
Tips
-
Remember, Tools are defined at the Block level, meaning all Turns within a Block share access to the same Tool definitions. This ensures:
-
Relevant tools are available where needed.
-
Block-specific data capture remains isolated.
-
The LLM's context isn't overwhelmed with irrelevant tools.
-