A prompt listed by a server (prompts/list).
arguments is the list of wire PromptArgument maps (string keys:
"name", "title", "description", "required"), keeping only entries
that are maps with a string "name". raw keeps the wire map untouched.
Prompt argument values sent to prompts/get are always strings.
Summary
Functions
Builds a Prompt from a wire Prompt map listed by server_id.
Types
Functions
@spec from_wire(String.t(), term()) :: {:ok, t()} | {:error, ConduitMcp.Client.Error.t()}
Builds a Prompt from a wire Prompt map listed by server_id.
name must be a string; otherwise the result is a :protocol error with
reason :invalid_prompt.
iex> {:ok, prompt} =
...> ConduitMcp.Client.Prompt.from_wire("docs", %{
...> "name" => "summarize",
...> "arguments" => [%{"name" => "topic", "required" => true}]
...> })
iex> Enum.map(prompt.arguments, & &1["name"])
["topic"]