OzMcp.Structs.ElicitRequestURLParams (OzMcp v0.9.0)

Copy Markdown View Source

Helper module used to build the params of an elicitation/create request in URL mode: the user is sent to a web page, the data never passes through the client.

(MCP protocol: 2025-11-25)

url must be an absolute http or https URL without credentials (https://user:pass@host/ is rejected: clients show the URL to the user). elicitationId identifies the interaction (the server sends notifications/elicitation/complete with it).

Short example:

%ElicitRequestURLParams{}
  |> ElicitRequestURLParams.message("Authorize the access")
  |> ElicitRequestURLParams.url("https://example.com/authorize")
  |> ElicitRequestURLParams.elicitation_id("e-1")
  |> ElicitRequestURLParams.build()

Result:

%{
  mode: "url",
  message: "Authorize the access",
  url: "https://example.com/authorize",
  elicitationId: "e-1"
}

Specification: ElicitRequestURLParams

Fields

FieldSetterTypeRequired
messagemessage/2stringyes
urlurl/2stringyes
elicitationIdelicitation_id/2stringyes
_meta_meta/2mapno
tasktask/2OzMcp.Structs.TaskMetadata.t/0no

Summary

Types

t()

@type t() :: %OzMcp.Structs.ElicitRequestURLParams{
  _meta: map() | nil,
  elicitationId: String.t(),
  message: String.t(),
  task: OzMcp.Structs.TaskMetadata.t() | nil,
  url: String.t()
}

Functions

build(struct)

@spec build(t()) :: map()

elicitation_id(struct, value)

@spec elicitation_id(t(), String.t()) :: t()

message(struct, value)

@spec message(t(), String.t()) :: t()

task(struct, value)

@spec task(t(), OzMcp.Structs.TaskMetadata.t() | nil) :: t()

url(struct, value)

@spec url(t(), String.t()) :: t()