# `Nous.Tools.ReActTools`
[🔗](https://github.com/nyo16/nous/blob/v0.21.1/lib/nous/tools/react_tools.ex#L1)

Built-in tools for ReAct (Reasoning and Acting) agents.

These tools provide structured planning, note-taking, todo management,
and explicit task completion for ReAct agents.

## Tools Included

- `plan/2` - Create structured plan with facts survey
- `note/2` - Record observations and insights
- `add_todo/2` - Add item to todo list
- `complete_todo/2` - Mark todo as complete
- `list_todos/2` - View current todos
- `final_answer/2` - Provide final answer (signals completion)

## Usage

    agent = ReActAgent.new("lmstudio:qwen3-vl-4b-thinking-mlx",
      instructions: "Solve complex problems step by step"
    )

The agent will automatically have access to all ReAct tools.

# `args`

```elixir
@type args() :: %{optional(String.t()) =&gt; term()}
```

Tool arguments exactly as the model produced them: JSON object keys stay
strings, values are unvalidated.

# `result`

```elixir
@type result() :: %{required(atom()) =&gt; term()}
```

Tool result: an atom-keyed map. A `:__update_context__` key, when present,
is merged back into `ctx.deps` by the runner.

# `add_todo`

```elixir
@spec add_todo(Nous.RunContext.t(), args()) :: result()
```

Add a task to the todo list.

Use this to break down complex problems into manageable subtasks.
Track what needs to be done and maintain focus.

## Arguments

- `item` - Description of the todo item (string)
- `priority` - Optional priority: "high", "medium", "low" (default: "medium")

## Returns

Confirmation with current todo count.

# `complete_todo`

```elixir
@spec complete_todo(Nous.RunContext.t(), args()) :: result()
```

Mark a todo item as complete.

## Arguments

- `id` - The todo ID to complete (integer)

OR

- `item` - Description matching the todo item (string)

## Returns

Confirmation message.

# `final_answer`

```elixir
@spec final_answer(Nous.RunContext.t(), args()) :: result()
```

Provide the final answer to complete the task.

This tool MUST be called to signal task completion.
The agent should only use this after gathering all necessary
information and solving the problem.

## Arguments

- `answer` - The final answer or solution (string)

## Returns

The final answer wrapped with completion metadata.

# `list_todos`

```elixir
@spec list_todos(Nous.RunContext.t(), args()) :: result()
```

List all current todos with their status.

Shows pending and completed tasks to help track progress.

## Returns

Formatted list of todos.

# `note`

```elixir
@spec note(Nous.RunContext.t(), args()) :: result()
```

Record an observation or insight during the reasoning process.

Use this to document important findings, intermediate results,
or thoughts that will inform future actions.

## Arguments

- `content` - The note content (string)

## Returns

Confirmation message.

# `plan`

```elixir
@spec plan(Nous.RunContext.t(), args()) :: result()
```

Create a structured plan for solving a task.

Helps the agent organize its approach by identifying:
- Known facts
- Facts to look up
- Facts to derive/calculate
- Step-by-step action plan

## Arguments

- `task` - The task or problem to plan for (string)
- Can also be called with no arguments to plan the current conversation

## Returns

A confirmation message. The plan is stored in context for reference.

---

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