Interface: AskResponse<T>
Defined in: packages/core/src/core/elicitation/types.ts:222
Response from ask() or ask.redirect().
Provides boolean guards (.accepted, .declined, .cancelled) instead of string comparisons. .data throws if not accepted (fail-fast pattern — no silent undefined bugs).
Example
const result = await ask('Confirm:', { name: ask.string() });
if (result.declined) return f.error('CANCELLED', 'Aborted');
console.log(result.data.name); // string — fully typed, safeType Parameters
| Type Parameter | Description |
|---|---|
T | The inferred data shape from ask() fields, or void for ask.redirect() |
Properties
accepted
readonly accepted: boolean;Defined in: packages/core/src/core/elicitation/types.ts:226
True when the user submitted the form
action
readonly action: ElicitationAction;Defined in: packages/core/src/core/elicitation/types.ts:224
Raw MCP action string
cancelled
readonly cancelled: boolean;Defined in: packages/core/src/core/elicitation/types.ts:230
True when the user dismissed without choosing
data
readonly data: T;Defined in: packages/core/src/core/elicitation/types.ts:237
The submitted data — populated when accepted === true.
Fail-fast: Accessing .data when declined or cancelled throws ElicitationDeclinedError to prevent silent bugs.
declined
readonly declined: boolean;Defined in: packages/core/src/core/elicitation/types.ts:228
True when the user explicitly declined