LLM Tool-Call RPC binary to be run inside a sandbox to perform safe tool-calls
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-23 00:58:58 +01:00
agents Bugfix B006: list_directory prints normalized paths like find/grep 2026-11-23 00:57:13 +01:00
docs Bugfix B006: list_directory prints normalized paths like find/grep 2026-11-23 00:57:13 +01:00
src Bugfix B006: list_directory prints normalized paths like find/grep 2026-11-23 00:57:13 +01:00
temp Initial commit, initial plan prompt 2026-11-10 19:50:33 +01:00
tests Bugfix B006: list_directory prints normalized paths like find/grep 2026-11-23 00:57:13 +01:00
.gitignore Update .gitignore 2026-11-10 19:51:05 +01:00
AGENTS.md Bugfix B003: machine-readable error taxonomy on the opt-in error fd 2026-11-23 00:02:45 +01:00
Cargo.lock Bugfix B001: write_file accepts base64 binary content via content_b64 2026-11-22 23:26:11 +01:00
Cargo.toml Bugfix B001: write_file accepts base64 binary content via content_b64 2026-11-22 23:26:11 +01:00
Changelog.md Bugfix B006: list_directory prints normalized paths like find/grep 2026-11-23 00:57:13 +01:00
README.md Documentation P001: rewrite the README as a human-facing overview of the finished tool 2026-11-11 04:00:46 +01:00

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: tool names the tool, args is 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_LOG says 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 Tool trait
  • a tool name lives in exactly two places (the dispatch arm and the tool_names() entry).