Wymcp. Hint
(Wymcp v0.6.2)
View Source
Struct for follow-up action suggestions in MCP tool responses.
Every hint represents a concrete next action the LLM can take. new/1
enforces required fields at construction time and validates every field
against the types t/0 publishes (matching the JSON wire format), so a
wrong-typed value is refused where the hint is built rather than emitted to
the client. A hint serializes to a flat JSON map via the module's
JSON.Encoder implementation, and is consumed by Wymcp.Tool, which
injects hints returned from the Wymcp.Tool.hints/2 callback into tool
responses.
Fields
tool(required) — tool name, e.g."tasks"action(required) — action name, e.g."get"description(required) — human-readable explanation of why this action is relevant. Consumer-authored text, governed by the contract at its definition home, theWymcp.Toolmoduledoc, section "Consumer-authored text".example(optional) — exampledatapayload, e.g.%{data: %{id: "..."}}
Usage
Hint.new(tool: "tasks", action: "get", description: "View the task", example: %{data: %{id: id}})