Examples
Each example here is one story solved three ways — on the Dashboard, over the HTTP API, and through MCP — with a tab per surface so you can read whichever one matches how you build. The stories are ordered by increasing complexity: rungs one to five each introduce a single primitive, and the sixth composes all four.
These pages narrate and link; they don't duplicate scripts. The runnable code
lives in the repo's examples/
directory, and each page quotes only the key excerpt and points at the full file.
For MCP, "runnable" is an agent conversation, so the MCP tabs show the prompt you
give the agent and the tool calls it makes in response.
The ladder
- Remind me in three days — a one-shot schedule.
- Send the weekly report — a recurring schedule with cron and series semantics.
- Renew the certificate — a deadline with an escalation policy and the cross-session query payoff.
- Ask before sending money — an approval gate with a human in the loop.
- Watch the pricing page — a watch with a match rule and change history.
- The renewals agent — all four primitives composing into one workflow.
Running the code
The scripts and how to run them are documented in
examples/README.md.
Every example reads the same three environment variables:
AIGEARS_API_KEY— the Bearer token for the API (required; the Team is derived from the key).AIGEARS_HOST— the base URL of the AIGears instance (defaults tohttp://localhost:8000).AIGEARS_WEBHOOK_URL— a placeholder target registered on schedules, deadlines and watches.
The examples are request-side only: they call AIGears, but they don't stand
up a webhook receiver. Because delivery applies an SSRF guard that rejects
localhost and other private addresses, a webhook target on your own machine
won't be reached — receiving real callbacks needs a public tunnel to a real
endpoint. For that side, see
Receiving webhooks.