# `ExAthena.Tools`
[🔗](https://github.com/udin-io/ex_athena/blob/v0.7.1/lib/ex_athena/tools.ex#L1)

Resolves tools into `ExAthena.Tool.Spec` structs for the provider and loop.

Consumers supply tools in one of two ways:

  1. **At config time:**

         config :ex_athena, tools: [MyApp.ToolA, MyApp.ToolB]

  2. **Per-call:**

         ExAthena.Loop.run(messages, tools: [MyApp.ToolA, ExAthena.Tools.Read])

Per-call wins; the configured list is the default when no tools are passed.

`resolve/1` returns `[ExAthena.Tool.Spec.t()]`. Built-in modules are wrapped
into `:module` specs; MCP-discovered tools are appended as `:mcp` specs
(unless suppressed via `mcp: false`).

# `builtins`

```elixir
@spec builtins() :: [module()]
```

List the builtin tool modules.

# `describe_for_prompt`

```elixir
@spec describe_for_prompt([ExAthena.Tool.Spec.t()]) :: [map()]
```

Build the prompt-friendly list used by `ExAthena.ToolCalls.augment_system_prompt/3`
when we fall back to the TextTagged protocol.

# `describe_for_provider`

```elixir
@spec describe_for_provider([ExAthena.Tool.Spec.t()]) :: [map()]
```

Build the provider-facing tool schema list — the same shape Ollama /
OpenAI-compatible providers send on the wire.

# `find`

```elixir
@spec find([ExAthena.Tool.Spec.t()], String.t()) :: ExAthena.Tool.Spec.t() | nil
```

Find the spec that handles a call by name.

# `resolve`

```elixir
@spec resolve(keyword()) :: [ExAthena.Tool.Spec.t()]
```

Resolve the tools to use for a call. Returns `[Tool.Spec.t()]`.

Accepts:

  * a list of modules (each wrapped into a `:module` spec)
  * `:all` — every builtin as specs
  * `nil` — falls back to `config :ex_athena, tools: ...` or `:all`

Options:

  * `mcp: true | false | [server_name]` — controls MCP tool inclusion.
    Defaults to `true` when the MCP supervisor is running, `false`
    otherwise. Pass `false` to suppress MCP tools entirely; pass a list
    of server names to include only tools from those servers.

# `validate!`

```elixir
@spec validate!([ExAthena.Tool.Spec.t()]) :: :ok
```

Validate a list of specs. Raises if any module spec's module doesn't implement the Tool behaviour.

---

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