Tools & planner
Built-in tools callable from workers via ctx.tool(...). The planner chooses execution strategy (single node vs map-reduce) from worker intent.
LIVE
echo tool
Calls dispatch_tool("echo", …) on the real registry — same path workers use with ctx.tool("echo", …).
Built-in tools
| Name | Purpose |
|---|---|
echo | Passthrough args (testing) |
fetch | HTTP GET/POST with SSRF protection |
scrape | Search HTML stub (override in prod) |
ai | OpenAI-compatible chat (RESUMA_AI_*) |
Call from a worker
#[worker(intent = "fetch and summarize with AI")]
async fn pipeline(input: Value, ctx: WorkerContext) -> Result<Value> {
let page = ctx.tool("fetch", json!({ "url": input["url"] })).await?;
let summary = ctx.tool("ai", json!({
"prompt": "Summarize",
"data": page
})).await?;
Ok(summary)
}Register custom tools
register_tool("my_api", |args| {
Box::pin(async move {
// call your API
Ok(json!({ "ok": true }))
})
});SSRF & fetch limits
RESUMA_FETCH_ALLOWLIST— optional host allowlistRESUMA_FETCH_MAX_BYTES— default 5 MB response cap- Private IPs, metadata hosts, and redirects are blocked
Map-reduce parallelism
Heavy intents (e.g. containing "AI" with large item lists) trigger map-reduce. Concurrency is capped by RESUMA_NODE_PARALLEL (default 4) via a semaphore.