Skip to main content

collect_form

Renders a structured form in the chat to collect multiple fields at once (lead capture, contact intake, structured questionnaire). Returns immediately with an interaction_id; submitted values arrive on the next turn keyed exactly by key. Use instead of asking field-by-field. The form schema is the contract — the LLM cannot misread the values because they come back under the keys it specified.

Parameters

Field definition

Returns

On submit (next turn): { status: "submitted", result: { values: { <key>: <value>, ... } } }.

Examples

Callback scheduler

Result values shape: { name, email, when, notes }.

Support ticket


Newsletter preferences

Result values shape: { topics: ["product", "tutorials"], frequency: "weekly", unsubscribe_all: false }.

Product configuration (numeric bounds + URL)


Date-range report request


Call from your own custom tool

Values come back on the next turn:

Does this use json-render?

No. collect_form has its own purpose-built renderer and a fixed field-type catalog. It’s optimised for simple data collection — the LLM describes what it needs, the renderer builds the HTML natively. If you need a fully custom layout — data tables, stat cards, buttons, nested sections — use render_ui instead. render_ui accepts a json-render.dev spec and can render arbitrary UI including form components with submit actions.

Choosing the right tool


Notes

  • Always registered.
  • Duplicate keys within a form are rejected by the input schema.
  • For select / multiselect, options is required (also rejected if missing).