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

Helper module used to build `StringSchema` structure: a text field of an
elicitation form.

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

## Short example:

```elixir
%StringSchema{}
  |> StringSchema.title("Email")
  |> StringSchema.format("email")
  |> StringSchema.build()
```

Result:

```elixir
%{type: "string", title: "Email", format: "email"}
```

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

## Fields

| Field | Setter | Type | Required |
|---|---|---|---|
| `title` | `title/2` | string | no |
| `description` | `description/2` | string | no |
| `minLength` | `min_length/2` | non-negative integer | no |
| `maxLength` | `max_length/2` | non-negative integer | no |
| `format` | `format/2` | `"email"`, `"uri"`, `"date"`, `"date-time"` | no |
| `default` | `default/2` | string | no |

# `t`

```elixir
@type t() :: %OzMcp.Structs.StringSchema{
  default: String.t() | nil,
  description: String.t() | nil,
  format: term() | nil,
  maxLength: non_neg_integer() | nil,
  minLength: non_neg_integer() | nil,
  title: String.t() | nil
}
```

# `build`

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

# `default`

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

# `description`

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

# `format`

```elixir
@spec format(t(), term() | nil) :: t()
```

# `max_length`

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

# `min_length`

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

# `title`

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

---

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