Canonical prompt result helper.
FastestMCP.Prompts.Result gives prompt handlers one explicit return type
when they need multiple messages, custom roles, or result-level metadata.
Accepted message inputs:
- a string - wrapped as one user message
- a list of
FastestMCP.Prompts.Message
Bare single-message structs are rejected on purpose. Use a list to make the cardinality explicit.
Examples
FastestMCP.Prompts.Result.new("Hello")
FastestMCP.Prompts.Result.new([
FastestMCP.Prompts.Message.new("Review this diff"),
FastestMCP.Prompts.Message.new("I can do that.", role: :assistant)
], description: "Code review prompt")
Summary
Functions
Normalizes prompt-result input into %FastestMCP.Prompts.Result{}.
Builds a normalized prompt result.
Types
@type t() :: %FastestMCP.Prompts.Result{ description: String.t() | nil, messages: [FastestMCP.Prompts.Message.t()], meta: map() | nil }