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

Evaluates the dispatch recipe to produce an execution plan.

The recipe is a function that takes the tool call's arguments and returns
an execution plan with serial steps (dependent, run in order) and
parallel steps (independent, run concurrently).

## Plan Structure

    %{
      serial: [%{tool: "tool_name", arguments: %{...}, label: "Step label"}],
      parallel: [%{tool: "tool_name", arguments: %{...}, label: "Step label"}],
      compose: &custom_compose_fn/1  # optional
    }

# `call`

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

Evaluates the recipe function to produce an execution plan.

## Parameters

  * `event` — `%Event{}` with `recipe` function and `call`
  * `opts` — ALF stage options (unused)

## Returns

  Updated `%Event{}` with `plan` and `total_parallel` populated.
  On recipe error, sets `status: :error` with details.

---

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