A §10 answer: {id, ok, data?} — keys byte-identical across ports.
Summary
Functions
The answer to a §10 suspension the human REFUSED (addendum A9). reason is
carried verbatim; "declined" is the spelling an MCP elicitation maps back to a
decline action, anything else maps to cancel.
The answer to a §10 kind: "input" suspension: the resolution IS the payload.
Coerce an %Answer{} or a plain atom/string-keyed map into an %Answer{}.
Decode from a JSON-shaped map (string keys).
Read a §10 answer's fields from an %Answer{} OR a plain map with ATOM or STRING
keys. §10 fixes the key spelling across every port, so a host resuming out of a
JSON column must not crash on %{"ok" => true} (ADR 0026 / D4).
True when this answer resolves the request affirmatively (atom or string keys).
Types
Functions
The answer to a §10 suspension the human REFUSED (addendum A9). reason is
carried verbatim; "declined" is the spelling an MCP elicitation maps back to a
decline action, anything else maps to cancel.
iex> Toolnexus.Answer.answer_declined("req-1", "declined").ok
false
The answer to a §10 kind: "input" suspension: the resolution IS the payload.
Hand-building %{id: id, ok: true, data: %{"output" => value}} is the one place a
host had to know an unwritten required key (ADR 0026); this constructor removes it.
output must be a STRING — anything else raises rather than degrading to "".
iex> Toolnexus.Answer.answer_output("req-1", "42").data
%{"output" => "42"}
Coerce an %Answer{} or a plain atom/string-keyed map into an %Answer{}.
Decode from a JSON-shaped map (string keys).
Read a §10 answer's fields from an %Answer{} OR a plain map with ATOM or STRING
keys. §10 fixes the key spelling across every port, so a host resuming out of a
JSON column must not crash on %{"ok" => true} (ADR 0026 / D4).
True when this answer resolves the request affirmatively (atom or string keys).