LLM Tool-Call RPC binary to be run inside a sandbox to perform safe tool-calls
- Rust 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| agents | ||
| docs | ||
| src | ||
| temp | ||
| tests | ||
| .gitignore | ||
| AGENTS.md | ||
| Cargo.lock | ||
| Cargo.toml | ||
| Changelog.md | ||
| README.md | ||
Toolcall-RPC
A single-binary, stdin/stdout RPC utility that carries out one LLM tool-call
per process. It is spawned inside a sandbox — typically through ssh, with the
working directory set to the workspace — reads exactly one JSON request from
stdin, streams a plain-text result to stdout, and signals success (0) or
failure (1) through the exit code.
The contract
{"tool": "read_file", "args": {"path": "notes.txt"}}
- One JSON object on stdin:
toolnames the tool,argsis its argument object (omittable, defaults to{}). - Execution starts as soon as the object is complete — stdin never has to be closed, trailing bytes are ignored.
- Output is line-buffered plain text, never wrapped in JSON; binary file reads pass through byte-exact.
- On failure the last stdout line is the error message (
invalid arguments:,invalid input:,io error while ..., …); output streamed before the failure stays intact. - Logs go to stderr only and are off unless
RUST_LOGsays otherwise — stderr is never part of the result. - Paths resolve against the workspace (the process's current directory).
The full contract, error prefixes and per-tool arguments with verified examples live in the mdbook documentation.
The tools
| Group | Tools |
|---|---|
| Directories | list_directory, create_directory, copy_directory, delete_directory, move_directory |
| Files | file_type, write_file, copy_file, delete_file, move_file |
| Read & edit | read_file (line windows, numbering, binary passthrough), edit_file (range or needle mode, atomic) |
| Diff & patch | diff, apply_patch (unified diffs via diffy) |
| Search | find (name/extension/glob), grep (regex or literal, contexts, statistics) — ripgrep as a library |
| Scripts | run_script (node/python3/ruby/bash/perl, live streaming, timeout kills the whole process tree) |
| Skills | list_skills, load_skill (workspace registry via agent-parser) |
Quick start
cargo build
printf '%s' '{"tool":"list_directory","args":{}}' \
| ./target/debug/toolcall-rpc
Documentation
The user documentation is an mdbook in docs/:
mdbook serve docs # read it
mdbook build docs -d docs/book
Development
cargo test --workspace
cargo clippy --workspace --all-targets
cargo fmt --check
Conventions:
- Rust edition 2024
- one crate
- one module per tool category
- shared
Tooltrait - a tool name lives in exactly two places (the
dispatcharm and thetool_names()entry).