A chatbot that only answers questions is half an agent. Attach a governed Tool and it can act — file a ticket, update a record — but only for people who are actually allowed to, with a graceful fallback for everyone else instead of a hard failure.
Scaffold the project
npx tiged --mode=git gleanwork/glean-cookbook/recipes/multi-step-agent multi-step-agentInstall dependencies
cd multi-step-agent/tool-server && pip install -r requirements.txt && cd ../invoke-agent && pip install -r requirements.txtRun the tool server
Listens on port 8080. Keep this running in its own terminal — the agent calls it over HTTP once registered.
cd multi-step-agent/tool-server && python server.pyRegister the tool
Manual, UI-only step — there is no API to create a tool. In Admin > Platform > Tools > Add, register the tool and upload multi-step-agent/tool-server/openapi.yaml as its API spec.
Create the agent
Manual, UI-only step. In Agent Builder: paste the recipe's instructions, turn retrieval on, attach the tool you just registered. Copy the agent's ID for the next step.
Set credentials
Fill in GLEAN_API_TOKEN, GLEAN_INSTANCE, and GLEAN_AGENT_ID (the ID from the previous step).
cd multi-step-agent/invoke-agent && cp .env.example .envRun it
python main.pyVerify
Run as a permitted user (Acme-Engineering) and confirm the ticket actually gets filed; run as a non-permitted user and confirm a graceful no-write fallback summary instead of a hard failure.
run_stream() and parse the SSE text yourself for a live-updating UI.Copies a prompt your AI assistant can build from.