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

Helper module used to build the `Completion` structure.

_(MCP protocol: 2025-11-25)_

## Short example:

```elixir
%Completion{}
  |> Completion.values(["python", "pytorch", "pyside"])
  |> Completion.build()
```

Result:

```elixir
%{values: ["python", "pytorch", "pyside"]}
```

## Long example:

```elixir
%Completion{}
  |> Completion.values(["python", "pytorch", "pyside"])
  |> Completion.total(10)
  |> Completion.has_more(true)
  |> Completion.build()
```

Result:

```elixir
%{values: ["python", "pytorch", "pyside"], total: 10, hasMore: true}
```

Specification: [Completion](https://modelcontextprotocol.io/specification/2025-11-25/schema#completion)

## Fields

| Field | Setter | Type | Required |
|---|---|---|---|
| `values` | `values/2` | list | yes |
| `total` | `total/2` | non-negative integer | no |
| `hasMore` | `has_more/2` | boolean | no |

# `t`

```elixir
@type t() :: %OzMcp.Structs.Completion{
  hasMore: boolean() | nil,
  total: non_neg_integer() | nil,
  values: list()
}
```

# `build`

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

# `has_more`

```elixir
@spec has_more(t(), boolean() | nil) :: t()
```

# `total`

```elixir
@spec total(t(), non_neg_integer() | nil) :: t()
```

# `values`

```elixir
@spec values(t(), list()) :: t()
```

---

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