Prerequisites
- LithoBlocks API key and at least one template
- Connecting Slack for your LithoBlocks workspace
- LlamaIndex installed (
pip install llama-indexor equivalent)
Why use LithoBlocks with LlamaIndex
- 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.
Implementing the tool
Define a LlamaIndex tool that acceptstemplate_id and payload, then POSTs to the LithoBlocks API.
POST /templates/{template_id}/compile and return the blocks. See the API reference for request/response shapes.
Using the tool in an agent
Add the tool to your agent. The agent can then invoke “send Slack message” withtemplate_id and payload.
send_slack_message with the appropriate template_id and payload for your template.
Next steps
AI agents overview
Why templates and agents fit together.
API reference
Endpoints, auth, and parameters.
Placeholders
Template data shape and syntax.

