Prompt message helper with content normalization.
This helper exists for the cases where a prompt wants explicit control over roles and content blocks without forcing every handler to build raw MCP maps by hand.
Accepted content forms:
- strings - emitted as text content
- MCP-style content maps - passed through
- maps, lists, tuples, structs, and other values - JSON encoded as text
Examples
FastestMCP.Prompts.Message.new("Summarize the diff")
FastestMCP.Prompts.Message.new("Done.", role: :assistant)
FastestMCP.Prompts.Message.new(%{type: "resource", resource: %{uri: "file:///tmp/out.txt"}})
Summary
Functions
Normalizes a message-like value into %FastestMCP.Prompts.Message{}.
Builds a normalized prompt message.
Converts the helper struct into the normalized prompt-message map used by the runtime.