# `OzMcp.Structs.EnumOptions`
[🔗](https://github.com/oz-elixir/oz_mcp/blob/v0.9.0/lib/oz_mcp/structs/enum_options.ex#L1)

Helper module shared by `OzMcp.Structs.EnumSchema` and
`OzMcp.Structs.MultiSelectEnumSchema`.

An option is a string (`"red"`), a `{value, title}` tuple, or a map with
the keys `:const` / `"const"` and `:title` / `"title"`. A list where no
option has a title is rendered as `enum`; as soon as one option has a
title, the list is rendered as `{const, title}` pairs (a missing title
defaults to the value).

# `option`

```elixir
@type option() :: String.t() | {String.t(), String.t()} | map()
```

# `normalize`

```elixir
@spec normalize(term()) :: [{String.t(), String.t() | nil}]
```

Normalizes the options to a list of `{value, title | nil}`. Raises
`ArgumentError` when the list is empty, an option is invalid, or a value
is repeated.

# `render`

```elixir
@spec render([{String.t(), String.t() | nil}]) ::
  {:enum, [String.t()]} | {:titled, [map()]}
```

Renders normalized options: `{:enum, values}` or `{:titled, [%{const:, title:}]}`.

# `values`

```elixir
@spec values([{String.t(), String.t() | nil}]) :: [String.t()]
```

The values of normalized options.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
