Prerequisites
- Completed Your first app — you have a working project with
src/exulu.ts. - Read ExuluTool — introduction and ExuluTool — configuration.
What you will build
order_lookup— a standard tool with a Zod schema, two admin config params,needsApproval: false, and a{result}return.batch_report_generator— a streaming tool that yields results incrementally as it processes items.
1
Create the tools file
Create You will fill in
src/tools/index.ts:src/tools/index.ts
orderLookupTool and batchReportTool in the following steps.2
Build the order lookup tool
The order lookup tool fetches order details from an internal API. Because it is read-only and low-risk, A few points about this tool:
needsApproval is false — the agent calls it without interrupting the user:src/tools/order-lookup.ts
configparams —orders_api_url(type"string") andorders_api_key(type"variable") are set by an administrator in the agent workbench, not in code. Variable-type params are stored encrypted and looked up at call time. The agent never sees them.needsApproval: false— read-only, reversible operations should not block the user. Settrue(the default) for any action that modifies data or has side effects.- Return shape —
{ result: string }is the standard return for tools that produce a text or JSON response. AlwaysJSON.stringifyobjects before returning — agents parse JSON automatically.
3
Build a streaming tool
Return an The
AsyncGenerator from execute for long-running operations that should stream progress to the agent. Each yielded value is the same { result } shape:src/tools/batch-report.ts
async function* syntax marks execute as an async generator. IMP’s framework handles both the regular Promise and AsyncGenerator return types — the agent sees a stream of result tokens as each yield resolves.4
Register the tools on the app
src/exulu.ts
5
Verify tool behavior
Start the server and open the agent workbench. Enable
order_lookup on an agent, set the config params, and send a test message that prompts the agent to look up an order. Because needsApproval: false, the agent calls the tool immediately without a confirmation prompt.Enable batch_report_generator on the same agent. When prompted to generate a report, the agent surfaces a Confirm dialog (because needsApproval: true) before calling the tool. After approval, streaming results appear in the conversation.What you built
order_lookup— a standard async tool with a Zod schema, two admin config params (one a"variable"for secrets), andneedsApproval: false.batch_report_generator— a streamingAsyncGeneratortool that yields progress for each processed account.
Next steps
OAuth tools
Wrap a tool in an OAuth 2.0 flow so agents can act on behalf of the signed-in user.
ExuluTool — configuration
Full reference for every constructor option including the ExuluOauthConfig shape.
Tools and skills
Enable and configure tools in the agent workbench UI.