NAME
anyevent-mcp-form-elicitation - display an MCP elicitation form using YAD or a terminal
SYNOPSIS
anyevent-mcp-form-elicitation <request.json >response.json
DESCRIPTION
Reads one UTF-8 JSON object containing MCP form elicitation parameters: mode (optional, form), message and requestedSchema. It displays the form using YAD, or uses /dev/tty if YAD cannot start. It writes one ordinary MCP response to stdout:
{"action":"accept","content":{"answer":"Some text"}}
{"action":"decline"}
{"action":"cancel"}
Exit status zero means a valid response, including decline or cancel. Nonzero means invalid input or a helper failure; diagnostics go to stderr. Closing a working dialog cancels the question and does not open another prompt. Without YAD or a terminal the helper fails rather than inventing an answer.
Forms contain at most 32 fields. Supported field types are strings, single-select string enums (enum or titled oneOf values), booleans, numbers and integers. Titles, descriptions, defaults, required fields, string length limits and numeric bounds are supported. Unsupported schema features, including string formats, nested objects, multi-select arrays and URL elicitation, produce an error.
Text fields accept multiline answers. Optional unselected choices, booleans and blank numbers are omitted; empty text is returned as an empty string. In a terminal, enter << to start multiline text, ending with a line containing only .. :cancel and :decline leave the form; :omit omits an optional field. Prefix a literal colon command with another colon. A final confirmation lets you submit or edit the entered answers.
The helper does not speak an MCP transport or maintain continuation tokens. It can be used directly from shell scripts or replaced by another executable with the same stdin/stdout contract. MCP callers use PERL_ANYEVENT_MCP_ELICITATION_HELPER to select an alternative.