# `Codex.Tool`
[🔗](https://github.com/nshkrdotcom/codex_sdk/blob/v0.18.1/lib/codex/tool.ex#L1)

Behaviour and helper macros for Codex tool modules.

Tools must implement `c:invoke/2`, returning either `{:ok, map()}` or `{:error, term()}`.
Optional metadata is surfaced via `metadata/0` and merged with registry attributes on
registration.

# `invoke`

```elixir
@callback invoke(map(), map()) :: {:ok, map()} | {:error, term()}
```

# `metadata`
*optional* 

```elixir
@callback metadata() :: map()
```

# `metadata`

```elixir
@spec metadata(module()) :: map()
```

Returns metadata for a tool module, normalising to a map.

# `normalize_metadata`

```elixir
@spec normalize_metadata(term()) :: map()
```

Normalizes metadata options to a map.

---

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