Prerequisites
- LithoBlocks API key and at least one template
- Connecting Slack for your LithoBlocks workspace
- CrewAI installed (
pip install crewaior equivalent)
Why use LithoBlocks with CrewAI
- Deterministic messages — The agent picks a template and data; the tool sends it. No Block Kit in the prompt.
- Lower LLM cost — The agent outputs only
template_idand a small payload; the tool does the HTTP call. LLM savings help offset LithoBlocks cost; at higher volumes, net cost reduction. - Consistency — Same layout every time; fewer malformed blocks. A dedicated “Notifier” agent can own the tool and send to Slack on behalf of other agents.
Implementing the tool
Define a CrewAI tool that acceptstemplate_id and payload, then POSTs to the LithoBlocks API.
POST /templates/{template_id}/compile. See the API reference for request/response shapes.
Using the tool in an agent or task
Assign the tool to an agent (e.g. “Notifier” or “Researcher”). The agent can send Slack messages by calling the tool withtemplate_id and payload.
send_slack_message with the appropriate template_id and payload for your template.

