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
| Argument | Type | Description |
|---|---|---|
title | string | Form title shown to the user |
description | string | Optional description or instructions |
fields | array | List of field definitions |
Field definition
| Property | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Field key in the returned data |
type | string | Yes | text, number, email, date, phone, select |
label | string | Yes | Display label |
required | boolean | No | Whether the field is required |
placeholder | string | No | Input placeholder text |
options | string | For select | Comma-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.