# `Planck.AI.Tool`
[🔗](https://github.com/alexdesousa/planck/blob/v0.1.0/lib/planck/ai/tool.ex#L1)

Defines a tool that can be called by the model during a conversation.

The `parameters` field is a JSON Schema map describing the tool's input.

## Examples

    iex> Planck.AI.Tool.new(
    ...>   name: "bash",
    ...>   description: "Execute a shell command",
    ...>   parameters: %{
    ...>     "type" => "object",
    ...>     "properties" => %{
    ...>       "command" => %{"type" => "string", "description" => "The command to run"}
    ...>     },
    ...>     "required" => ["command"]
    ...>   }
    ...> )
    %Planck.AI.Tool{name: "bash", description: "Execute a shell command", parameters: %{"type" => "object", "properties" => %{"command" => %{"type" => "string", "description" => "The command to run"}}, "required" => ["command"]}}

# `t`

```elixir
@type t() :: %Planck.AI.Tool{
  description: String.t(),
  name: String.t(),
  parameters: map()
}
```

# `new`

```elixir
@spec new(keyword()) :: t()
```

Builds a `%Planck.AI.Tool{}` struct from keyword options.

## Options

- `:name` — tool name (required)
- `:description` — human-readable description (required)
- `:parameters` — JSON Schema map describing the tool's input (required)

---

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