Question. A local model is given a handful of tools and a request. How often does it call the right tool, with the right arguments, and only when a tool is needed? Does it carry a value from one call into the next when a task takes two or three steps? When a tool returns an error, does it fix the call, retry, or tell the user it cannot be done? And how much of that changes when the tool interface changes: more tools to choose from, terse descriptions, vague names, free-string arguments, or bare error codes?
This repository is a measurement study with local open-weight models, the next in the series after
prompt-brittleness, memory-rot, rag-poisoning, llm-judge-bias and long-context-recall. Every number in
reports/results.md is produced by the code here from cached model calls, so it regenerates
exactly. Predictions: HYPOTHESES.md, committed before the full run.
How it relates to agent-interface-lab. agent-interface-lab is a simulated study of the same kind of question: its agent is a hand-written policy whose sensitivity to each interface feature was set by hand, so its numbers describe the harness, not any model. This study measures: real local models, called through Ollama's own tool-calling API, in a deterministic sandbox where every task has a checkable answer. The baseline interface here is the one agent-interface-lab recommends (few tools, a one-line description that says when to use each, typed inputs, small structured results, errors that say how to recover), and each condition takes one of those recommendations away, so the two studies can be read side by side.
Full run: 3,180 episodes (6,465 model turns, 3,534 tool calls) on 120 tasks, three main models under
every condition plus qwen3:30b-a3b with thinking on the first 60 tasks, temperature 0. Eight of the
fourteen pre-registered predictions held; the scoring is in
reports/results.md. Intervals are 95% bootstraps over tasks, and
every condition is compared with the baseline on the same tasks.
- One call is solved; chains are not. At baseline every main model completed 92 to 100% of
single-call tasks. Two-step chains:
qwen3:8b25%,llama3.1:8b0%,gemma3:12b35%. Three-step chains: 12%, 0% and 56%. Of the 85 failed chains, 74 never called a tool the task needed. Two habits account for most of them. About half made the first call right and then stopped, handing the next step to the user ("the email address is not provided in the order details. You may need to look up Nerys Haldric's contact information", withfind_contactoffered all along). The rest skipped the lookup and guessed, for example inventing an attendee's email address instead of finding it. llama3.1:8bcannot leave the tools alone. It called a tool on 90% of the tasks that need none (arithmetic, a weekday, a request no tool covers), for example looking up a SKU when asked to transfer money.qwen3:8bandgemma3:12bcalled one on 0%.- Small models do not recover from errors they could fix. When a fixable error came back (a
misspelt name, a clashing booking, a timeout) and the error said how to fix it,
qwen3:8brecovered on 9% of those episodes,llama3.1:8bon 0% andgemma3:12bon 36%. The usual reply relayed the error or asked the user ("The closest match is Ilse Corvane. Would you like me to look up that name?") instead of making the call. Errors that cannot be fixed (a shipped order, a date beyond the forecast) were reported correctly 100% of the time by all three. - The interface changes mostly did not matter. Twenty tools instead of eight, terse descriptions,
vague near-duplicate names and free-string arguments each moved overall success by under 5 pp for every
main model, none beyond the noise floor. Two changes did count: three tools instead of eight helped
qwen3:8b(+8.3 pp [+1.7, +15.0]), and bare error codes costgemma3:12b20 pp on error tasks [-40.0, -5.0], the one model that recovered at all. - A typed schema prevents the error that the models then cannot fix. With the id format in the
schema, every model wrote
ORD-1043itself on the four bad-format tasks and succeeded on all of them. With free-string arguments, all three sent the bare number, got an error that said exactly how to fix it, and replied to the user instead of retrying, in all 12 episodes. That is a small sample (four tasks), but the effect is complete. - Native tool calling and a prompted JSON protocol scored the same.
qwen3:8bunder both, same tasks: 59% and 60% (+0.8 pp [-3.3, +5.0]). Sogemma3:12b, which has no native tool support in Ollama and runs the prompted protocol, can be compared with the other two. - The thinking model does chains and recovers.
qwen3:30b-a3bwith thinking completed 92% of the first 60 tasks, 31.7 pp aboveqwen3:8bon the same tasks [+18.3, +45.0], with every two-step chain and every error task. That is confounded with size and thinking, and it took about 10 seconds an episode against 3. - The noise floor is zero. The identical baseline sent again, as separate calls, flipped 0 of 120 episodes for each main model.
What this means in practice. The interface advice usually given for tools (fewer tools, good names, good descriptions) moved these models very little. What separated them was the loop: carrying a result into the next call, and acting on an error instead of reporting it. A tool-use check that matters needs multi-step tasks and injected errors, and should score whether the model finished the task, not whether its first call was right (78 to 80% here for all three small models, which hides a 36 to 69% task rate). A strict schema earns its place by stopping bad calls before they happen.
Checker revision after the run. Reading the report's sample transcripts showed the answer checker
marking correct answers wrong in two ways: refusals worded "None of the provided tools can be used to
..." or "there is no weather forecast available" did not match its refusal phrases, and counts written
as words ("There are three events") were not read as numbers. Both were widened, with tests, in the
commit that adds these results, and every episode was re-scored from the cache. Seventy episodes changed, all from
fail to pass, and each was read by hand and is a correct answer. Nothing else changed. Two predictions
moved to "held" as a result (#2, chains fail more often than single calls, for gemma3:12b; #11, tasks
that cannot be done are reported, for llama3.1:8b), so the count under the original checker is six of
fourteen. The report under the original checker is kept as
reports/results_checker_v1.md.
The checker has not yet been checked by hand: the sample in handcheck/sample.csv is waiting for
labels (see Hand-check).
A sandbox where every task has a checkable answer. The tools act on the fixed data of an invented
wholesale company, Quillfen Supply Co. (src/toolrel/world.py, committed as
data/world.json): 28 contacts (8 staff, 20 people at 8 customer companies), 12 products with stock at
4 warehouses, 60 orders in 5 states, 41 events on the user's calendar over two weeks, and a 7-day forecast
for 6 invented cities (Vellmark, Ostmoor, Quenvale, Harrowfell, Ivelstow, Corrabay). Today is fixed at
Tuesday 2026-03-03 and stated in the system prompt. Everything is invented, so a fact can only come from a
tool. The tools are plain Python functions with no network, clock or randomness
(src/toolrel/sandbox.py); every change of state (a booking, a cancellation, a
sent email) is recorded, so tasks that must change something are checked on the state, and a call that
changes something it should not is caught.
The tools. Eight core tools, and twelve plausible distractors for the 20-tool condition:
| core tool | what it does | name under names_vague |
|---|---|---|
find_contact(name) |
one person by full name: email, phone, company, city | lookup_entry |
get_order(order_id) |
one order: status, customer, SKU, quantity, warehouse | get_record |
cancel_order(order_id, reason) |
cancel an order that has not shipped | update_record |
check_stock(sku, warehouse) |
units on hand of one SKU at one warehouse | get_count |
list_events(date) |
the user's calendar for one date | list_entries |
create_event(title, date, start_time, duration_minutes, attendees) |
book an event; refuses a clash | add_entry |
convert_units(value, from_unit, to_unit) |
length, mass, volume, temperature | convert |
get_weather(city, date) |
forecast for an office city, today and the next six days | get_conditions |
Distractors: list_orders (beside get_order), search_contacts (beside find_contact), get_climate
(beside get_weather), get_product, update_order, send_email, delete_event, get_exchange_rate,
get_time_zone, list_warehouses, create_ticket, list_holidays. They work and return real data from
the sandbox; no task needs them. Results are small JSON objects. A tool that cannot do what was asked
raises an error with a code, a message and a fix (NOT_FOUND, "No contact named 'Ilse Crvane'.",
"Closest match in the directory: 'Ilse Corvane'. If that is the person, call find_contact with that
name."). What a tool accepts never changes between conditions: it is lenient in obvious ways (case,
spaces, "30" for 30, a city for its warehouse code, unit names for codes) and strict where a real service
would be (order ids must look like ORD-1043, dates must be YYYY-MM-DD, attendees must be directory emails).
Tasks of graded difficulty (src/toolrel/tasks.py, committed as
data/tasks.jsonl): 120 main tasks and 12 pilot tasks (2 per category, excluded from every reported
number), built from 30 seeded templates.
| category | main | what it asks | example |
|---|---|---|---|
| single | 24 | one call with the right arguments | "What is the status of order ORD-1010, and how many units are on it?" |
| choose | 20 | one call, but the words do not match the tool and an argument must be derived | "How warm will it get in Harrowfell this Friday?" |
| chain2 | 20 | two calls, the second needing a value from the first | "Who placed order ORD-1013, and what is their email address?" |
| chain3 | 16 | three calls, each needing the one before; a conditional cancel; the first free slot | "Book a 30-minute call titled 'Sample request call' with whoever placed order ORD-1047, on 2026-03-06 at 15:30." |
| none | 20 | no tool should be called: 10 answerable directly, 10 out of scope for every tool | "What does the abbreviation KPI stand for?", "Book me a train ticket from Vellmark to Ostmoor for Friday morning." |
| error | 20 | a tool returns an error; fix the call (bad id format, misspelt name, a clashing booking), retry (a timeout), or tell the user (a shipped order, a date beyond the forecast) | "What is the phone number for Ilse Crvane? I may have the spelling slightly wrong." |
Each task carries the required calls with their reference arguments, the tools whose calls are reasonable for it (any other call is unnecessary), the acceptable first tools, the facts the final answer must contain, the state changes it must make and no others, and a reference plan used only by the stub and the tests. Every number a final answer must contain is checked at build time not to appear in the request, and no required word either, so echoing the request cannot pass. Tasks are ordered so that every prefix of the list keeps the category mix (a test checks prefixes of 30, 60 and 90), so a grid cut to its first N tasks is still balanced.
Conditions, one factor at a time from a baseline (src/toolrel/toolsets.py):
| condition | what changes | baseline value |
|---|---|---|
base |
nothing | 8 core tools, one-line "use when" descriptions, strict schema, errors that say how to recover |
tools3 |
only 3 tools: the ones the task needs, filled up from the core set (seeded per task) | 8 |
tools20 |
the 12 distractors added | 8 |
desc_terse |
tool descriptions cut to a few words ("Order info.", "Stock."); argument descriptions kept | one line saying what and when |
names_vague |
tool names replaced by generic near-duplicates (table above); descriptions kept | descriptive names |
schema_loose |
every argument a free string: no types, enums, patterns, required list or format notes | typed, enums, id and date patterns, required, no extra properties, a format note per argument |
errors_bare |
an error is only its code, {"error": "NOT_FOUND"} |
code, message and fix |
| A/A | base again, as separate calls in a later stage |
Why a good baseline: the practical question is what each shortcut in a tool interface costs, and a baseline
that follows the advice leaves room to fall on every factor; against a mediocre baseline some conditions
would be improvements and others not, and the comparisons would not line up. Why the same tool functions in
every condition: so that a condition changes only what the model is told, not what the tool will accept
(under schema_loose a model that writes "Thursday" for a date gets the same error it would get under the
strict schema; it was simply not told the format). schema_loose removes both the machine-readable
constraints and the format notes in the argument descriptions, as loose schemas in practice usually do;
the two are not separated (see Limits). names_vague keeps the clear descriptions, so it tests whether
names matter when descriptions are good, and desc_terse keeps the names, so it tests the reverse. Tools
are listed in a seeded per-task order, and every condition lists its subset in that order, so the relative
order of the core tools is the same in every condition of a task.
Two tool-calling protocols (src/toolrel/prompts.py). Native: the tool list
goes in the tools field of Ollama's /api/chat, calls come back in message.tool_calls, and results go
back as tool messages; the model's chat template decides how the tools are shown to it. Prompted: no
tools field; the tool list is written into the system prompt as JSON, the model is asked to reply with
{"tool": ..., "arguments": {...}} to call one, and results come back as a user message. gemma3:12b runs
every condition under the prompted protocol, because its Ollama template has no tools block (read from the
local model blob, without calling the server). Ollama derives tool support from the template, so it does
not offer tool calling for this model, and the template has no case for tool messages either. To show how much the protocol alone moves the numbers, qwen3:8b also runs the
baseline under the prompted protocol. gemma3:12b's results are labelled (prompted) everywhere and are not
a like-for-like comparison with the native models.
What the templates do, as served. Read from the local template blobs: the llama3.1:8b template writes
the tool list into the user message only while that message is the last one, so after the first tool
result the tool definitions are no longer in its prompt; it also tells the model to "respond with a JSON
for a function call" whenever tools are present. The qwen3 templates put the tool list in the system
prompt on every turn; qwen3:8b's template drops a call from the history when the same reply also had text.
These are properties of the models as Ollama serves them, which is what is measured, and they are why the
predictions expect llama3.1:8b to call tools on tasks that need none and to do worse on chains. Ollama's
tool type may also keep only type, description, enum, items and required of a schema, dropping
pattern and additionalProperties before the template sees them; the format notes in the argument
descriptions carry the same information either way, and toolrel probe checks it in the pilot by
comparing prompt token counts with and without those keywords.
The agent loop (src/toolrel/agent.py). Call the model; run each tool call in the
reply, in order, against the episode's sandbox; send the results back; repeat until a reply has no tool
calls (its text is the final answer) or 8 model turns have passed (the longest reference plan takes 5). A
call to a tool that was not offered gets an UNKNOWN_TOOL error in the condition's error style. Under the
native protocol, a reply that writes a tool call out as text with no tool_calls ends the episode as
leaked_call (the call is not run: what is measured is whether native tool calling works as served); under
the prompted protocol, a reply that starts a JSON call that does not parse ends it as malformed_call.
Every turn is logged with its text, calls, results, token counts and timings.
Measures, checked by code (src/toolrel/check.py). Per episode: success (the
final answer contains every required fact, the state is exactly as required, every required call was made
with the reference arguments after the same normalisation the tool applies, and a none task called no
tool); right tool first; right arguments; schema-invalid calls (arguments that break the schema the
model was shown); unnecessary calls (calls to tools the task has no use for, and repeats of an identical
successful call); extra calls beyond the reference plan; hallucinated tools (a name that was not
offered) and hallucinated arguments (an argument the tool does not have); called a tool on a none
task; recovery (success among episodes where a tool error came back) and what the next call after the
first error was; steps used; and one outcome label per episode (success, truncated, leaked_call,
malformed_call, step_cap, unneeded_call, no_call, failed_recovery, hallucinated_tool,
wrong_tool, bad_args, bad_state, wrong_answer, the first that applies). Answer facts are matched as
whole words after lower-casing and stripping punctuation; numbers are read from the answer after removing
ids, dates, times and phone numbers, within a stated tolerance (a temperature may be given in Celsius or
Fahrenheit); phone numbers as digit strings; "cannot be done" answers by a fixed list of phrases. Every
stored episode is re-scored from its transcript each time the report is built, replaying its calls in a
fresh sandbox, so a change to a checker rule updates every number and a change to the world is caught.
Noise floor. The baseline is run a second time for every model, in a later stage, as separate calls with their own cache entries. The flip rate (episodes whose success differs between the two runs) is the floor: an effect counts only when its 95% interval excludes zero and it is larger than that model's flip rate. The same rule as llm-judge-bias and long-context-recall.
Statistics. 95% percentile bootstraps over tasks, 2,000 resamples; the same task is run under every condition, so every comparison between conditions is paired by task. Comparisons between categories (which hold different tasks) resample each side on its own.
Run order. Stages run one at a time, each for every main model before the next starts, in the order below, so a cut keeps the baseline, the protocol bridge, the two factors with the largest expected effects and the noise floor first. The number of tasks per stage is a placeholder (all 120) until the pilot has measured seconds per episode (RUN.md).
| order | stage | condition | models | tasks (placeholder) |
|---|---|---|---|---|
| 1 | base | base |
qwen3:8b, llama3.1:8b, gemma3:12b (prompted) | 120 |
| 2 | protocol | base, prompted protocol |
qwen3:8b | 120 |
| 3 | errors_bare | errors_bare |
the three main models | 120 |
| 4 | tools20 | tools20 |
the three main models | 120 |
| 5 | aa | base again |
the three main models | 120 |
| 6 | desc_terse | desc_terse |
the three main models | 120 |
| 7 | schema_loose | schema_loose |
the three main models | 120 |
| 8 | names_vague | names_vague |
the three main models | 120 |
| 9 | tools3 | tools3 |
the three main models | 120 |
| 10 | (late) | base, errors_bare, tools20 |
qwen3:30b-a3b, thinking on | 60 each |
In all 3,180 episodes at the placeholder sizes.
Settings. Temperature 0, seed 7, num_ctx 16,384 on every call (the 20-tool set is about 2,800 tokens
and the longest conversation about 5,000 by the character estimate), at most 1,024 new tokens per turn
(6,144 with thinking). think: false for qwen3:8b; qwen3:30b-a3b is the thinking-only release, which
keeps reasoning when thinking is turned off (found in memory-rot), so it runs with thinking on as its own
reduced grid; only its calls and final answer are checked, and its thinking is passed back in the history
as its template expects. One call at a time. Before a call is sent, 1.5 times its estimated prompt tokens
plus the output cap must fit num_ctx; after it returns, the server's prompt token count plus the output cap
must fit, or the run stops (Ollama shortens an over-long prompt without an error).
Requires uv and, for real runs, Ollama with the four models pulled.
uv sync
uv run pytest # no server needed: the tests use the stub and block the network
uv run toolrel build # data/world.json and data/tasks.jsonl, seeded (already committed)
uv run toolrel show main-010 --cond names_vague --tools # a task and the tools one condition shows for it
# a dry run of the whole pipeline on the stub, written outside results/
uv run toolrel run --backend stub --root scratch/stub --split pilot --stage all
uv run toolrel report --split pilot --root scratch/stub
# the pilot and the full run: see RUN.md
uv run toolrel handcheck sample # handcheck/sample.csv, labels left empty
uv run toolrel report # reports/results.md and reports/figures/Every model call is cached in cache/llm.sqlite, keyed by model, messages, tools, options, think flag and
a repeat tag (each A/A repeat has its own entry, so it is a real second episode with identical requests).
An episode's later requests depend only on earlier replies and the deterministic sandbox, so with the cache
present toolrel run ... --cache-only rebuilds every row without a server, and an interrupted run resumes:
episodes with rows are skipped, and a half-finished episode replays from the cache up to its first missing
turn. A stub run must be given --root, so canned responses cannot mix with real results.
| Item | Source | Version | Size | Licence |
|---|---|---|---|---|
| Sandbox world and tasks | generated by this repository, seed 7 | data/world.json, data/tasks.jsonl |
46 KB, 150 KB | MIT |
| Models | Ollama 0.40.6 library tags qwen3:8b, llama3.1:8b, gemma3:12b, qwen3:30b-a3b (Q4_K_M) |
manifests 500a1f067a9f, 46e0c10c039e, b92b218582c5, ad815644918f; recorded again in results/models.json at run time |
4.9 to 18.6 GB | Apache 2.0 (Qwen3), Llama 3.1 Community Licence, Gemma Terms of Use |
No external data is downloaded. The model digests above were read from the local manifest files; the run records the server's own digests and capabilities.
src/toolrel/ config (settings, grid), world (the invented company), sandbox (tools, normalisers, errors,
state), toolsets (tool definitions and the interface conditions), tasks (templates, the seeded
task set), prompts (system prompt, the two protocols), llm (Ollama client, disk cache, reply
parsing), stub (canned responses for tests and dry runs), agent (the loop), check (the
checker), runner (stages), stats (task bootstrap), analysis, hypotheses (scoring of the
predictions), report, handcheck, cli
tests/ data, sandbox, tool views, checker, client and cache, the reference plan under every condition
and protocol, end to end on the stub (run, resume, report, predictions, hand-check)
data/ world.json and tasks.jsonl
results/ rows/<model>.jsonl (one row per episode, with every turn) and models.json, after a run
reports/ pilot.md and results.md with figures, after a run
handcheck/ sample.csv (label column empty) and parser_key.csv, after a run
cache/ llm.sqlite: every model call
After the run, toolrel handcheck sample writes handcheck/sample.csv: 60 random episodes stratified by
category plus up to 20 where the checker is likelier to be wrong (a final answer marked wrong although the
calls were right, failed recoveries, none tasks passed on a refusal phrase, the tasks that cannot be
done). Each row has the request, what a correct episode needs, a readable transcript, the final answer and
an empty label column; the checker's reading is kept apart in handcheck/parser_key.csv. The labelling
pass is Srikar's, and no agreement figure is reported until it is done. Labels are one outcome from the list
above (success, or the first failure that applies). toolrel handcheck score reports agreement on
success and on the outcome.
- Small models, one setup. Four local models, 4-bit quantised, one system prompt, temperature 0 and one seed, served by one version of Ollama. The grid was sized from the pilot to fit a night of laptop compute, so intervals on single categories (16 to 24 tasks) are wide, and the bad-format result rests on four tasks. The thinking model ran only the first 60 tasks under three conditions.
- Models as served. What is measured is a model with its Ollama chat template and Ollama's tool-call parser, not the model alone. The llama3.1:8b template drops the tool list after the first tool result; another template or server could give different numbers for the same weights.
- The prompted protocol is a different condition. gemma3:12b is measured only under it, so its numbers mix the model and the protocol; the qwen3:8b bridge shows the size of the protocol effect for one model on the baseline only.
- A synthetic sandbox. The tasks come from 30 templates over a small invented company, written so code can check them; real tool sets are larger, messier and less regular, and real requests are more varied. English only.
- One factor at a time. Each condition removes one good practice from a good baseline; interactions (20
tools and vague names) are not tested, and the effect of a factor from a weaker baseline could differ.
schema_looseremoves types and format notes together. - Tool order. Tools are listed in a seeded order per task; position effects within the list are not studied.
- Checking by rule. Answers are checked by facts, numbers and a fixed list of "cannot be done" phrases. A correct answer phrased in an unexpected way, or a refusal without any of the phrases, is misread. The full run found two such gaps, fixed after the results were seen (see Findings); the hand-check measures what is left.
- Asking back counts as failure. A model that asks the user to confirm a misspelt name, instead of using the directory's closest match, fails that task, although asking can be the better behaviour (the request says the spelling may be slightly wrong).
- Prompt cache and timing. Turns of an episode share a long prefix, which the server reuses; this changes speed and in principle could change the numeric path of a computation; the A/A repeat, sent in a later stage under a different cache state, measures that noise with the rest.
- The templates, the checker and the predictions were written by the same person who will label the hand-check sample.
- Schick et al. Toolformer: Language Models Can Teach Themselves to Use Tools. NeurIPS 2023 (arXiv:2302.04761). Self-supervised learning of when and how to call APIs.
- Patil et al. Gorilla: Large Language Model Connected with Massive APIs (2023,
arXiv:2305.15334), and the Berkeley Function Calling Leaderboard
(gorilla.cs.berkeley.edu/leaderboard.html). Function
calling scored by matching calls to reference calls, including "irrelevance" cases where no function
should be called; the template for this study's argument checks and
nonetasks. - Qin et al. ToolLLM: Facilitating Large Language Models to Master 16000+ Real-world APIs. ICLR 2024 (arXiv:2307.16789). Large-scale multi-step tool use with real APIs.
- Li et al. API-Bank: A Comprehensive Benchmark for Tool-Augmented LLMs. EMNLP 2023 (arXiv:2304.08244). Executable APIs and multi-turn dialogues; separates calling, retrieving and planning.
- Huang et al. MetaTool Benchmark for Large Language Models: Deciding Whether to Use Tools and Which to Use. ICLR 2024 (arXiv:2310.03128). Tool-use awareness and tool selection, including requests that need no tool.
- Yao et al. τ-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domains (2024, arXiv:2406.12045). Stateful domains checked on the final database state, and pass^k, the chance that all of k repeated trials succeed; a stricter view of reliability than this study's A/A flip rate.
- Lu et al. ToolSandbox: A Stateful, Conversational, Interactive Evaluation Benchmark for LLM Tool Use Capabilities (2024, arXiv:2408.04682). Stateful tools, implicit dependencies between calls, and milestones along a trajectory.
- agent-interface-lab, in this series. A simulated study of tool-interface design whose recommendations are this study's baseline.
What this study adds, if the run goes as planned: the interface factors varied one at a time on the same tasks, so every effect is paired by task, with a deterministic sandbox that checks arguments, state and the final answer by code; tasks that need no tool and tasks that end in an error in the same grid; an A/A noise floor; native tool calling and a prompted protocol bridged on one model; on local open models as Ollama serves them.
MIT, Kameswara Sai Srikar Manda, 2026.
