The agent calls your own scenario as a tool
A slice of graph that queries your table becomes a tool the model calls when it decides to.
What the scenario looks like
- Execute + Data
- LLM
- Extension
Putting a query into the chain is easy, but then it runs every time: on “how much is the grinder” and on “how do I return this”. As a tool it runs only when needed, and the model decides that after reading the question.
What is inside
- A customer question — the entry.
- The agent answers and decides whether to call the tool.
- Stock check — the tool node. Between its
InputandResultports sits an ordinary slice of graph: a collection query and some formatting. - The template’s result goes back to the model, which phrases the answer.
The tool description is its interface. The model decides whether to call it from the name and the description and nothing else: a vague “checks data” means it gets called at the wrong moments, or never.
What to set up for yourself
- The tool name and description — the most important field in this scenario.
- The argument schema. One argument today: the product name. Add a city or a quantity and the model starts passing them.
- The tool’s body. The query can be replaced with anything: a call to your API, a file read, a calculation in code. Nothing changes for the model.
What to connect
A collection of stock levels under Tables. This is the most flexible way to give a model access to your data: it does not know where the data comes from and cannot damage it — it sees only what the template returned.