LlmCore.Agent.Components.ValidateCalls (llm_core v0.3.0)

Copy Markdown View Source

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.

Summary

Functions

Validates tool calls against available tool definitions.

Functions

call(ctx, opts)

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.