Helper module used to build Prompt structure.
(MCP protocol: 2025-11-25)
Short example:
%Prompt{}
|> Prompt.name("get_weather")
|> Prompt.description("Get the weather for a city")
|> Prompt.build()Result:
%{name: "get_weather", description: "Get the weather for a city"}Long example:
%Prompt{}
|> Prompt.name("get_weather")
|> Prompt.title("Get the weather")
|> Prompt.description("Get the weather for a city")
|> Prompt.arguments([
%PromptArgument{}
|> PromptArgument.name("city")
|> PromptArgument.description("The city name")
|> PromptArgument.required(true)
])
|> Prompt.icons([
%Icon{}
|> Icon.src("https://img.com/icon.png")
|> Icon.mime_type("image/png")
|> Icon.sizes(["16x16"])
])
|> Prompt.build()Result:
%{
name: "get_weather",
description: "Get the weather for a city",
title: "Get the weather",
arguments: [%{name: "city", description: "The city name", required: true}],
icons: [
%{
src: "https://img.com/icon.png",
sizes: ["16x16"],
mimeType: "image/png"
}
]
}The required_scopes field holds the scopes that a principal must hold to
use the prompt. OzMcp uses them for the check of prompts/get and for the
filter of prompts/list. They are never sent to the client.
Specification: Prompt
Fields
| Field | Setter | Type | Required |
|---|---|---|---|
name | name/2 | string | yes |
title | title/2 | string | no |
description | description/2 | string | no |
arguments | arguments/2 | list of OzMcp.Structs.PromptArgument.t/0 | no |
_meta | _meta/2 | map | no |
icons | icons/2 | list of OzMcp.Structs.Icon.t/0 | no |
required_scopes | required_scopes/2 | list of scopes, never sent | no |
extras | extras/2 | map | no |
Summary
Types
@type t() :: %OzMcp.Structs.Prompt{ _meta: map() | nil, arguments: [OzMcp.Structs.PromptArgument.t()] | nil, description: String.t() | nil, extras: map() | nil, icons: [OzMcp.Structs.Icon.t()] | nil, name: String.t(), required_scopes: [String.t()], title: String.t() | nil }
Functions
@spec arguments(t(), [OzMcp.Structs.PromptArgument.t()] | nil) :: t()
@spec icons(t(), [OzMcp.Structs.Icon.t()] | nil) :: t()