# `LlmCore.Agent.Components.ValidateCalls`
[🔗](https://github.com/fosferon/llm_core/blob/v0.3.0/lib/llm_core/agent/components/validate_calls.ex#L1)

Validates parsed tool calls against available tool definitions.

Checks that each tool call's name exists in `ctx.tools`. Calls to
unknown tools are removed from `tool_calls` and converted to error
results so the LLM can self-correct in the next iteration.

Optionally validates arguments via `LlmCore.Tool.Validator` when
the tool definition includes parameter schemas.

Skips processing when the decision is already `:done` (no tool calls)
or when the pipeline is in error status.

# `call`

```elixir
@spec call(
  LlmCore.Agent.Context.t(),
  keyword()
) :: LlmCore.Agent.Context.t()
```

Validates tool calls against available tool definitions.

Unknown tools produce error results that are fed back to the LLM.
Tools with invalid arguments (per JSON Schema) also produce error
results.

## Parameters

  * `ctx` — `%Context{}` with `tool_calls` and `tools`
  * `opts` — ALF stage options (unused)

## Returns

  Updated `%Context{}` with validated `tool_calls`, error `tool_results`
  for invalid calls, and any `validation_errors`.

---

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