# klieo-tools

Tool dispatch + JSON-schema arg validation + timeout enforcement for klieo-core.

Part of the [klieo](https://crates.io/crates/klieo) Rust agent framework.

## Features

- `ToolInvoker` implementation that dispatches to registered `Arc<dyn Tool>`
- JSON-schema validation on tool arguments before invoke
- Per-tool configurable timeouts with `ToolError::Timeout` on expiry
- Duplicate-name detection: `add_tool` / `with_tool` return `Err(InvokerError::DuplicateTool)` instead of panicking

## Usage

```toml
[dependencies]
klieo-tools = "2"
```

```rust,ignore
use klieo_tools::ChainedInvoker;

let invoker = ChainedInvoker::new()
    .with_tool_owned(MyToolA::new())?
    .with_tool_owned(MyToolB::new())?;

let mut invoker = ChainedInvoker::new();
invoker.add_tool(Arc::new(my_tool))?;
```

Use `with_tool(Arc<dyn Tool>)` when you need to share the `Arc` across
other dispatch paths.

`add_tool` and `with_tool` return `Err(InvokerError::DuplicateTool)` if a tool
with the same name is already registered.

## Status

`2.x` — stable.
See [`docs/SEMVER.md`](https://github.com/mohrimic/klieo/blob/main/docs/SEMVER.md).

## License

MIT — see [`LICENSE`](https://github.com/mohrimic/klieo/blob/main/LICENSE).
