Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.lithoblocks.com/llms.txt

Use this file to discover all available pages before exploring further.

LithoBlocks templates let your AI agent send Slack messages without generating Block Kit JSON. The agent picks a template and fills in the data; LithoBlocks handles the message structure. Use templates so your agent uses far fewer tokens. The resulting LLM savings help offset LithoBlocks credits, with net cost reduction at higher volumes and for richer messages.

Why use templates with agents

  • Deterministic output — The agent chooses a template and supplies variables. The LLM does not need to generate Block Kit JSON, so output is predictable and valid.
  • Lower LLM cost — The agent sends only a template ID and a small payload instead of long block structures. The resulting LLM savings help offset LithoBlocks cost; at higher volumes and for medium/large messages, many customers see net cost reduction.
  • Consistency and safety — The same layout and structure every time; fewer malformed blocks or prompt drift.
  • Faster iteration — Change the message in LithoBlocks once; every agent using that template gets the update.

Common pattern (generic tool)

Your agent decides what to do and what data to send; the LithoBlocks API handles how (the Slack message).
  1. Tool/action inputs: template_id, data (template fields; you can keep calling this payload in your agent and map it to data in the request) and optionally a send destination such as channel_id.
  2. One HTTP call: POST /v1/templates/compile or POST /v1/templates/send with a JSON body; return success or error to the agent.
  3. Optional: Use webhooks for two-way flows (e.g. button click in Slack triggers the agent).

Prerequisites

  • LithoBlocks API key (from your dashboard → API Keys)
  • At least one template (see Quickstart)
  • Connecting Slack for your LithoBlocks workspace (required for send)
  • Optional: webhook destination if the agent should react to button or modal interactions

Implementing the tool (generic)

  • Base URL: https://api.lithoblocks.com (staging: https://staging.api.lithoblocks.com)
  • Authentication: Authorization: Bearer YOUR_LITHOBLOCKS_API_KEY
  • Paths: e.g. POST /v1/templates/compile, POST /v1/templates/send (template id is in the JSON body, not the path). See the API reference for all endpoints and parameters.
  • Body: JSON with template_id and data (same shape as sample data); send also requires a destination such as channel_id where applicable. The agent supplies these fields; your tool forwards them to the API.
Return the API response (or a short success/error message) to the agent so it can decide the next step.

Platform guides

Same pattern in each framework: define a tool that calls the LithoBlocks API with template_id and data (often built from an agent-side payload), then add that tool to your agent.

LangChain

Use LithoBlocks from LangChain agents and chains.

LlamaIndex

Use LithoBlocks from LlamaIndex agents and tools.

CrewAI

Use LithoBlocks from CrewAI agents and tasks.

n8n AI

Use LithoBlocks from n8n AI nodes (no code).

Next steps

Quickstart

Build a template and send a message.

API reference

Endpoints, auth, and parameters.

Placeholders

Template data shape and syntax.

Sample data

Structure payloads for your templates.