Use the example tool
Pixie ships with one fully-working example tool at
tools/example-compound-interest/. It exists so that on first run you have
something to click, and so that the format documentation has a concrete
reference to point at.
Click the tool
In the sidebar under Finance, click Compound interest. The launcher will:
- Notice the tool isn’t warm.
- Bind to
127.0.0.1:0to pick a free port, release the binding. - Run
tools/example-compound-interest/.venv/bin/python main.py --port <port>. - Poll
http://127.0.0.1:<port>/healthzuntil it returns{"ok": true}. - Fetch
/schemaand compare it to the on-disktool.json. - Register the running tool in the launcher’s in-memory state.
- Render the form on the left and the empty output panel on the right.
You should see the status pill flip from dormant to running in
~200–500 ms on the first click. Subsequent clicks within warm_keep_seconds
(default 300) are instant.
Run a calculation
Enter:
- Principal:
10000 - Monthly contribution:
200 - Years:
20 - Annual rate (%):
7 - Compounding:
Monthly
Click Run. The right panel updates with:
- Final balance — a
numberoutput withformat: "currency", precision 2. - Growth over time — a
chart_lineshowing principal, contributions, and interest accumulated by year. - Year-by-year breakdown — a
tablelisting each year’s contributions, interest, and end balance.
The same data also lands in pixie.db as a row in runs with the inputs and
the (truncated) outputs. Hit the run-history dropdown in the header to
reload any past run with one click.
Look under the hood
The whole tool is four small files:
tools/example-compound-interest/├── tool.json # schema: inputs, outputs, layout, metadata├── pyproject.toml # deps: fastapi, uvicorn, python-dotenv├── main.py # ~40 lines of FastAPI doing the calculation└── README.md # how to run the tool standalone for debuggingOpen tool.json to see the schema, then open main.py to see how it gets
wired to FastAPI. Then read Tool anatomy — that
page walks through every line.
Validate it manually
You can re-run the validator on any tool from the command line:
uv run pixie validate example-compound-interestYou’ll get a structured report with 11 checks (folder structure, schema parsing, sample-input run, output conformance, clean shutdown, …). All green means the tool is fit to ship.
See The validator for what each check does and Validator checks reference for the exact behaviour of each.
Stop the tool
Walk away. After warm_keep_seconds of inactivity (300 by default), the
launcher sends SIGTERM, waits up to 5 seconds, then SIGKILL if needed. The
tool’s port is released. Memory usage drops back to roughly Pixie’s own
baseline.
Next
Now that you’ve run a working tool end-to-end, the fun starts — add your first real tool via Claude Code →