AI Helper's agentic tool-calling workflow explained
A chat that only answers in text is useful. A chat that can inspect the page, write code into a live TEMP window, and save a finished rule for you is something else. AI Helper does the second thing through an agentic tool-calling workflow. Here is how it works.
What "agentic" means here
When you send a message, the model does not have to answer in one shot. It can decide it needs information — call a tool to get it — read the result, and continue. That cycle of think → act → observe → think is the agentic loop. In AI Helper the loop runs up to 8 steps per turn, then the model must give you a final answer. The cap keeps a turn bounded and predictable.
The tool protocol
Every provider has its own native function-calling format, and they do not match. To avoid three separate code paths, AI Helper uses one provider-independent text protocol. The model emits a tool call as a tagged block:
@@JZ_TOOL@@ {"tool": "query_page", "args": {"selector": ".cookie-banner"}} @@END@@
The extension parses that block, runs the tool, and feeds the result back into the conversation so the model can continue. Because it is just text, the exact same prompt and parsing logic work identically for OpenAI, Anthropic and Gemini — switch providers mid-chat and the workflow does not change.
The tools
AI Helper exposes a small, focused set of tools. They fall into three groups.
Inspection
query_page— give it a CSS selector, get back the match count and the HTML of the matches. This is how the model looks at the live DOM on demand.list_structure— returns your existing folders, groups and rules with their ids, so the model knows what already exists and where new things could go.
Live testing
open_temp_pane— opens a TEMP CSS or JS window in the page.set_temp_pane_code— writes code into that TEMP pane. The page updates immediately, so you see the model's proposed change on the real site before anything is saved.
Persisting (with your confirmation)
create_folder— creates a folder.create_group— creates a group inside a folder.create_rule— creates a rule with CSS and/or JS and a URL pattern.
Each of these three requires a separate, explicit user confirmation. The model cannot quietly write into your library — every folder, every group, every rule is a deliberate yes from you. Creating actions or action-bars is not part of this stage; the tools cover folders, groups and rules with CSS and JS.
The workflow the system prompt drives
The tools are only half the story — the system prompt tells the model how to use them in order:
- Ask for details — clarify what you actually want before touching anything.
- Inspect the page — use
query_pageto confirm the real structure instead of guessing. - Test in a TEMP window — open a pane, set the code, let you see it live.
- Ask you to verify — "does the page look right now?"
- Persist only after you agree — and only then call a create tool, with its own confirmation.
This is the same path a careful human takes: look first, test second, save last.
A turn, step by step
Turn: "make the comments section collapsible"
step 1 query_page .comments -> 1 match, HTML returned
step 2 open_temp_pane css -> TEMP CSS window opens
step 3 set_temp_pane_code ... -> collapse CSS injected live
step 4 (text) "I added a collapse toggle - check the page."
--- model stops, waits for you ---
You: "good, save it"
step 5 list_structure -> reads your folders/ids
step 6 create_rule (confirm?) -> you click confirm -> saved
Six steps used, two left in the budget. If a turn ever hits the 8-step cap, the model wraps up with what it has and tells you where things stand.
Tool-call chips
You are never guessing what the model did. Every tool call and its result render as a chip in the chat window — a compact card showing the tool name, its arguments, and a summary of what came back. Scroll the conversation and you can audit the entire turn: which selector was queried, what code went into which pane, which rule was created.
Why the text protocol matters to you
Provider-independent tooling is not just an implementation detail. It means you can pick a provider for cost or quality reasons and the agentic capability is identical. No "tool calling only works on provider X" caveats. Switch in the chat window mid-task and keep going.
See also
- The page-inspection tools in depth
- Build a rule with AI Helper, step by step
- Testing in TEMP windows before saving
The agentic workflow is built into AI Helper today. Download JustZix, add an API key, and ask it to build something — then watch the chips.
Rate this post
No ratings yet — be the first.