# `ToolCall.Diagnostic`

A structured compile-time diagnostic returned by a function-declaration source.

`line` and `column` point at the declaration that produced the diagnostic, such
as the `@spec` line, and are optional: a source that cannot locate its input
leaves them `nil` and the builder falls back to the definition location.

`severity` decides what the builder does with it: `:warning` is reported and
the affected tool is skipped, `:error` fails the compile.

# `location`

```elixir
@type location() :: [line: pos_integer(), column: pos_integer()]
```

# `severity`

```elixir
@type severity() :: :warning | :error
```

# `t`

```elixir
@type t() :: %ToolCall.Diagnostic{
  column: pos_integer() | nil,
  line: pos_integer() | nil,
  message: String.t(),
  severity: severity()
}
```

# `error`

```elixir
@spec error(String.t(), location()) :: t()
```

# `message`

```elixir
@spec message(t()) :: String.t()
```

# `position`

```elixir
@spec position(t()) :: {pos_integer() | nil, pos_integer() | nil} | nil
```

Returns the diagnostic's own `{line, column}`, or `nil` when unknown.

# `warning`

```elixir
@spec warning(String.t(), location()) :: t()
```

---

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