Skip to main content

Collect Data

The collect data tool generates dynamic input forms that users fill out during a conversation. Agents use it to gather structured information before proceeding with a task.

Tool: collect_data

Generates a form with specified fields and waits for the user to fill it out. Returns the submitted values as a structured JSON object.

Arguments

ArgumentTypeDescription
titlestringForm title shown to the user
descriptionstringOptional description or instructions
fieldsarrayList of field definitions

Field definition

PropertyTypeRequiredDescription
namestringYesField key in the returned data
typestringYestext, number, email, date, phone, select
labelstringYesDisplay label
requiredbooleanNoWhether the field is required
placeholderstringNoInput placeholder text
optionsstringFor selectComma-separated options

Use cases

Before I run the report, I need to collect some parameters from you.
Please fill in your project details so I can set up the repository.
I need a few details to book the meeting. Let me show you a form.

Example

{
"tool": "collect_data",
"title": "Report Configuration",
"description": "Please provide the parameters for your report.",
"fields": [
{
"name": "date_range",
"type": "select",
"label": "Date Range",
"options": "last_7_days,last_30_days,last_quarter,custom",
"required": true
},
{
"name": "email",
"type": "email",
"label": "Send report to",
"required": true
},
{
"name": "include_charts",
"type": "select",
"label": "Include charts?",
"options": "yes,no"
}
]
}

The user sees the form rendered in the chat UI. After submitting, the agent receives:

{
"date_range": "last_30_days",
"email": "alice@example.com",
"include_charts": "yes"
}

Integration with orchestrations

In an orchestration, use a human step for structured data collection before other steps — it offers more persistence and resumability than the collect_data tool. Use collect_data for lightweight, in-conversation data gathering.