added some extra sample tool scripts
This commit is contained in:
@@ -201,6 +201,53 @@ MicroBantam (`mb`) is a compressed Perl 5 reference implementation of the same a
|
||||
- `model.cfg`, `system.txt` — shared configuration and system prompt
|
||||
- `README.md` — this document
|
||||
|
||||
## Extra tools
|
||||
|
||||
The `extras/` directory contains small, dependency-light shell scripts that extend Bantam without changing its core. Because Bantam's only built-in tools are `shell_exec` and `run_subagent`, these helpers can be invoked directly by the agent through `shell_exec` to give it real-world capabilities (web search, live weather) that the base model alone does not have. They are plain `/bin/sh` scripts depending only on `curl` (and `jq` where noted), so the agent can discover and run them just like any other command.
|
||||
|
||||
### `extras/websearch`
|
||||
|
||||
A simple web search tool for Bantam built on [Exa's MCP server](https://mcp.exa.ai/mcp)
|
||||
(Streamable HTTP). It speaks the JSON-RPC MCP protocol (`initialize` ->
|
||||
`notifications/initialized` -> `tools/call` with `web_search_exa`) and prints
|
||||
the formatted result text. Usage:
|
||||
|
||||
```sh
|
||||
extras/websearch "your query" # default 5 results
|
||||
extras/websearch "your query" 10 # custom number of results
|
||||
```
|
||||
|
||||
Environment:
|
||||
|
||||
- `EXA_MCP_ENDPOINT` — endpoint URL (default `https://mcp.exa.ai/mcp`).
|
||||
- `EXA_API_KEY` — optional; when set, it is passed as an `?api_key=` query
|
||||
parameter so no extra HTTP headers are added beyond `Content-Type`.
|
||||
|
||||
Dependencies: `curl`, `jq`.
|
||||
|
||||
### `extras/weather`
|
||||
|
||||
A wrapper around the [wttr.in](https://github.com/chubin/wttr.in) weather API
|
||||
that queries current conditions and forecasts for any location. It supports the
|
||||
graphical ANSI terminal view (default), one-line presets (`1`-`4`), custom
|
||||
`%`-notation formats, and the rich JSON document (`?format=j1`). Usage:
|
||||
|
||||
```sh
|
||||
extras/weather # auto-detect location from request IP
|
||||
extras/weather London # graphical report
|
||||
extras/weather -f 3 "New York" # one-line preset
|
||||
extras/weather -f "%l: %c %t" Paris # custom one-line format
|
||||
extras/weather -u u -L de Berlin # USCS units, German output
|
||||
extras/weather -j Tokyo # raw JSON (pretty-printed via jq)
|
||||
```
|
||||
|
||||
Options include `-l/--location`, `-u/--units` (`m`/`u`/`M`), `-L/--lang`,
|
||||
`-f/--format`, `-j/--json`, `-0`/`-1`/`-2` (view depth), `-q`/`--quiet`,
|
||||
`-A` (force ANSI) and `-h/--help`. Environment overrides: `WTTRAPI` (default
|
||||
`https://wttr.in`) and `WEATHER_TIMEOUT` (default `20`s).
|
||||
|
||||
Dependencies: `curl`, `jq` (only required for the JSON format).
|
||||
|
||||
## FAQ
|
||||
|
||||
### Does Bantam support `AGENTS.md` etc?
|
||||
|
||||
Reference in New Issue
Block a user