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

Helper module used to build `NumberSchema` structure: a numeric field of
an elicitation form. The type is `number` by default; use `type/2` with
`:integer` for a whole number.

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

## Short example:

```elixir
%NumberSchema{}
  |> NumberSchema.type(:integer)
  |> NumberSchema.minimum(1)
  |> NumberSchema.maximum(10)
  |> NumberSchema.build()
```

Result:

```elixir
%{type: "integer", minimum: 1, maximum: 10}
```

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

## Fields

| Field | Setter | Type | Required |
|---|---|---|---|
| `type` | `type/2` | `:number`, `:integer`, `"number"`, `"integer"` | yes |
| `title` | `title/2` | string | no |
| `description` | `description/2` | string | no |
| `minimum` | `minimum/2` | number | no |
| `maximum` | `maximum/2` | number | no |
| `default` | `default/2` | number | no |

# `t`

```elixir
@type t() :: %OzMcp.Structs.NumberSchema{
  default: number() | nil,
  description: String.t() | nil,
  maximum: number() | nil,
  minimum: number() | nil,
  title: String.t() | nil,
  type: term()
}
```

# `build`

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

# `default`

```elixir
@spec default(t(), number() | nil) :: t()
```

# `description`

```elixir
@spec description(t(), String.t() | nil) :: t()
```

# `maximum`

```elixir
@spec maximum(t(), number() | nil) :: t()
```

# `minimum`

```elixir
@spec minimum(t(), number() | nil) :: t()
```

# `title`

```elixir
@spec title(t(), String.t() | nil) :: t()
```

# `type`

```elixir
@spec type(t(), term()) :: t()
```

---

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