Recipes
Tool Calling
AI Tool Calling with Jido
Give an LLM access to your app’s functions and let it call them itself. The LLM decides which tool to invoke and with what arguments. You write the tool, you write the prompt, the LLM does the routing.
This is the pattern behind Petal Pro’s admin chat — ask “how many users signed up this week” in plain English and the model invokes a get_site_stats Elixir function with period: "week". No regex, no NLU layer.
We use Jido.Action for tool definitions because it gives us validated schemas, atomized arg conversion, and a single source of truth that works for both ReqLLM tool-calling and MCP servers.
Why Jido actions?
- One action definition works for ReqLLM tool calling and MCP servers — see the MCP recipe for the same registry exposed over JSON-RPC.
-
Schema validation catches the LLM hallucinating
period: "yesterday"before it hits your DB. - Adding a tool is one file plus one line in the registry. No prompt engineering for routing.