Skip to content

Examples

toolexec ships with runnable examples that cover execution, chaining, streaming, discovery integration, and runtime isolation.

Basic execution

go run ./examples/basic

Shows: - Local backend registration - Input validation and execution - Structured results

Tool chaining

go run ./examples/chain

Shows: - Sequential chains - UsePrevious argument injection - Step results and errors

Discovery + execution

go run ./examples/discovery

Shows: - Index + docs store integration - Search + execute via exec facade

Streaming

go run ./examples/streaming

Shows: - Streaming events from execution - Progress + chunk envelopes

Runtime isolation

go run ./examples/runtime

Shows: - Security profiles - Runtime selection (unsafe / docker / wasm)

Full integration

go run ./examples/full

Shows: - End-to-end setup with discovery + exec + runtime