Skip to main content

Overview

The AskUserQuestion tool allows agents to pause execution and ask users multiple-choice questions. The agent can ask 1-4 questions at a time, each with 2-4 options, supporting both single-select and multi-select modes.

Message Flow

Data Structures

Output

Input (Response)

For multi-select questions, join multiple labels with commas: "Option A, Option B".

Example

Single-select:
Response: { "Database": "PostgreSQL" } Multi-select:
Response: { "Features": "Caching, Metrics" }

Agent State

While waiting, the agent enters AgentState::WaitingForUserInput { request_id }. Use this to show a waiting indicator in your UI.

Tauri Integration

Backend

Frontend

Validation Rules

  • 1-4 questions per request
  • 2-4 options per question
  • Headers: max 12 characters
  • Labels: 1-5 words
If validation fails, the agent receives a tool error and may ask via a different method.

Handling Cancellation

If the user cancels instead of answering, send an interrupt:
The tool returns ToolResult::error("Interrupted") and the agent ends the turn. See Interrupt Handling for details.

Limitations

  • No custom input: Users must choose from provided options only.
  • No nested questions: Cannot show conditional follow-ups within one request.
  • No rich media: Options support text only (no images or formatting).

Next Steps

Message Flow

Communication patterns

Interrupt Handling

Canceling questions