Ask the user one interactive question with up to three choices, or a custom answer.
- Created for: Asking the user one interactive question with up to three choices during a Pi session.
- Advantage: Offers a keyboard-selectable prompt and returns one explicit answer instead of relying on free-form chat parsing.
pi install npm:@henryqw/pi-ask-question| Surface | Type | Purpose |
|---|---|---|
ask_question |
tool | Pause for one interactive answer. |
{
"question": "Which database should we use?",
"options": [
{ "label": "PostgreSQL", "description": "Shared server database" },
{ "label": "SQLite", "description": "Local, embedded storage" },
{ "label": "File", "description": "Plain file storage" }
]
}Supply one to three options in preference order. UI marks the first (Recommended) and adds Something else., which opens a text input for a custom answer. Empty questions, blank or duplicate labels, empty lists, more than three options, and non-interactive sessions return an error. Aborting the tool closes the pending question.