Skip to main content

Tool Calling with Small Local Models: Which Ollama Models Actually Follow Your Schema? (LangChain4j)

The same four MCP-served tools and twelve prompts run five times each against six small Ollama models through LangChain4j 1.24.0: 360 scored answers. One model got 60 of 60 right, a 3.2B model got half, and the failures have recognisable shapes (a wrapped call, a number sent as a string, a tool called when none was wanted) with a repair for one of them.

You give a small local model a list of tools, ask it “remind me in two hours”, and one of three things comes back: a clean call, a call your code cannot parse, or a confident paragraph that never touches a tool at all. Which one you get depends heavily on the model, and the model’s parameter count turns out to predict it less well than you would hope. This post runs the same four tools and the same twelve prompts against six small Ollama models, five times each, through LangChain4j, and counts what actually came back. The tool definitions travel over MCP, so the wiring a real application would use is part of the test. The headline is unglamorous and useful: one model (qwen3:1.7b) got all 60 answers right, a 3.2B model got half of them right, and the failures are not random — they have fingerprints you can recognise and, in one case, repair in a few lines.
What this was run on. LangChain4j langchain4j and langchain4j-ollama 1.24.0 (GA; the artifacts carry a Maven Central date of 2026-11-18, read from maven-metadata.xml and the pom’s Last-Modified), langchain4j-mcp 1.24.0-beta34 (beta only, no GA exists), Ollama 0.40.18, JDK 25.0.5, Python mcp 2.3.0. Hardware: a 2-vCPU Intel Xeon @ 2.30 GHz sandbox with 8 GB RAM and no GPU, so the seconds-per-call figures are indicative of a small CPU box and nothing more. Every count below comes from a real run of the code in the companion module; the model names are exactly the Ollama tags that were pulled.

What “tool calling” actually asks of a small model

A language model cannot run code, call an API or read your calendar. When you register a tool, all that happens is that its name, a one-line description and a JSON schema for its arguments are added to the prompt. If the model decides the tool fits, it writes out a request — a tool name and a JSON object of arguments — and stops. Your application is the one that checks that request and runs the tool.
The modelreads the prompt andthe tool definitions A request, as textcreate_reminder{“minutes_from_now”:120} Your codechecks the schema,then runs the tool the result goes back to the model as a new message The model only ever produces the middle box. Everything this post counts is about whether that text is areal tool, with arguments that fit its schema, at the moment the prompt called for one.
The diagram marks the only thing the model contributes: the amber box. That is why this is a fair thing to benchmark. Small models are not being asked to be clever; they are being asked to produce one short, strictly shaped piece of text. The ways that can go wrong are finite, and they are the columns of the results table later: the wrong tool, an invented tool, arguments that break the schema, arguments that fit the schema but carry the wrong value, a plain-text answer where a call was needed, and — easy to forget — a call where none was needed. Ollama decides whether a model can do this at all by looking for a tools capability in the model’s metadata. All six models below report it (checked with Ollama’s /api/show before the runs), and each is a 4-bit quantisation except llama3.2:1b, which ships at 8-bit. The sizes Ollama reports: qwen3:0.6b 751.63M, qwen3:1.7b 2.0B, llama3.2:1b 1.2B, llama3.2:3b 3.2B, qwen2.5:1.5b 1.5B, granite3.3:2b 2.5B parameters.

The test: four tools, twelve prompts, one question per answer

The tools are deliberately plain, so that a failure is the model’s and not the tool’s: get_weather(city, unit) where unit is an enum, convert_currency(amount, from_currency, to_currency), create_reminder(text, minutes_from_now) and search_notes(query, limit) where limit is optional. They live in one small Python MCP server, mcp/tool_server.py.
MCP server4 tools (Python) McpClientlistTools() Ollama modelChatRequest Scorerschema + values Outcome1 of 8 labels The tool definitions the model sees are the ones the MCP server published, not a second copy kept in the benchmark. 12 prompts x 5 runs x 6 models = 360 model answers. The tools are never executed during scoring; only what the model asks for is judged.
Read the diagram left to right: the server publishes the tools, McpClient.listTools() turns them into LangChain4j ToolSpecification objects, those go into a ChatRequest for an Ollama model, and the Scorer labels the reply. The twelve prompts are in ToolCase.java. Eight call a single tool, one needs two calls at once, one hides a unit trap (“in 2 hours” must become 120 minutes), and three want no tool: a general-knowledge question, a request to say hello in Marathi, and a request to email a report, for which no email tool exists.
            new ToolCase("06-reminder-unit-trap", "Set a reminder to call the vendor in 2 hours.",
                List.of(call("create_reminder", "text", contains("vendor"), "minutes_from_now", num(120)))),

The unit-trap prompt from ToolCase.java: a correct answer is the right tool, a text mentioning the vendor, and exactly 120.

Each answer gets exactly one label. When an answer has several problems, the most serious label wins, in this order:
LabelMeaning
HALLUa tool name that is not in the registry
SCHEMAright tool, but the arguments break the tool’s own schema: missing required key, unknown key, string where an integer is required, value outside the enum
WTOOLa real tool, but not the one the prompt called for
WVALschema-valid arguments with a wrong value (2 hours sent as 2, “IN” for INR)
PARTtwo-call prompt where only one expected call was made
NOCALLa tool was needed, the model answered in text
SPURno tool was needed, the model called one anyway
VALIDexactly what the prompt called for, including correctly calling nothing
Every model got the same system prompt (“call a tool when one fits, otherwise answer directly”), temperature 0.3, thinking switched off (the setting is sent for every model; only Qwen3 here has a thinking mode), and each prompt was asked five times. That is 60 answers per model. It is a small sample and the post treats it as one: differences of a few answers mean nothing, differences of 20 do.

Wiring the tools in over MCP

Model Context Protocol is a standard way for a program to publish tools that any client can list and call. In LangChain4j the client side is three lines: build a transport that launches the server process, build a DefaultMcpClient on it, and call listTools(). The whole class is McpTools.java.
    public static McpClient connect(String pythonExe, String serverScript) {
        StdioMcpTransport transport = StdioMcpTransport.builder()
                .command(List.of(pythonExe, serverScript))
                .logEvents(false)
                .build();
        return DefaultMcpClient.builder()
                .key("local-tool-suite")
                .transport(transport)
                .build();
    }
}
Running just the wiring, with no model, shows what a model will be handed. This output comes from scripts/mcp-wiring.sh on this machine:
get_weather -> Get the current weather for a city.
    schema: JsonObjectSchema {description = null, properties = {city=JsonStringSchema {description = null }, unit=JsonEnumSchema {description = null, enumValues = [celsius, fahrenheit] }}, required = [city], additionalProperties = null, definitions = {} }
convert_currency -> Convert an amount of money between two currencies using ISO 4217 codes such as USD or INR.
    schema: JsonObjectSchema {description = null, properties = {amount=JsonNumberSchema {description = null }, from_currency=JsonStringSchema {description = null }, to_currency=JsonStringSchema {description = null }}, required = [amount, from_currency, to_currency], additionalProperties = null, definitions = {} }
create_reminder -> Create a reminder that fires the given number of minutes from now.
    schema: JsonObjectSchema {description = null, properties = {text=JsonStringSchema {description = null }, minutes_from_now=JsonIntegerSchema {description = null }}, required = [text, minutes_from_now], additionalProperties = null, definitions = {} }
search_notes -> Search the user's personal notes. Optionally cap the number of results.
    schema: JsonObjectSchema {description = null, properties = {query=JsonStringSchema {description = null }, limit=JsonAnyOfSchema {description = null, anyOf = [JsonIntegerSchema {description = null }, JsonNullSchema {}] }}, required = [query], additionalProperties = null, definitions = {} }

executeTool(create_reminder) -> {"result":"Reminder set for +120 min: call the vendor"}
Two real surprises from this step. First, the Python SDK moved: with mcp 2.x the familiar from mcp.server.fastmcp import FastMCP raises ModuleNotFoundError because FastMCP was renamed MCPServer (mcp.server.mcpserver); the server in the repo uses the new name. Second, the symptom of that mistake is not a helpful error. The server process dies on import, and the Java client reports only a TimeoutException after it tried to auto-detect the protocol version: “The server answered neither the 2026-07-28 protocol detection request nor the 2025-11-25 initialization that followed it.” If you see that, start the server by hand first and read its own stderr.
Look at the schemas in that output. The description of every parameter is null: the Python server derives the schema from type hints, and a docstring only describes the tool, not each argument. A small model therefore sees from_currency as a bare string and has to guess it means an ISO code. Also note that limit, declared Optional[int], arrives as an anyOf of integer and null rather than a plain integer; a schema checker that does not understand anyOf will reject every legitimate call to it, so Scorer handles it explicitly.

The results: 60 answers per model

One loop sends every prompt to a model through LangChain4j and records what came back. The core of it, from Benchmark.java:
                        ChatResponse resp = model.chat(ChatRequest.builder()
                                .messages(SystemMessage.from(SYSTEM), UserMessage.from(tc.prompt()))
                                .toolSpecifications(tools).build());
The table below is printed by scripts/summarize.py from the per-answer files the benchmark writes. ENVEL is a subset of SCHEMA, explained in the next section: answers whose real arguments arrived wrapped in an envelope under a parameters or arguments key; JSONtx counts answers where a tool call was printed as text instead of being sent as a call; s/call is mean wall-clock seconds per answer on this CPU-only box.
model            n  VALID  HALLU SCHEMA  WTOOL   WVAL   PART NOCALL   SPUR  ENVEL JSONtx  s/call
granite3.3:2b   60     32      0      9      0      5      0      8      6      9      0     4.4
llama3.2:1b     60     15      0     30      0      1      0      0     14     19      1     3.5
llama3.2:3b     60     30      0     16      0      0      0      0     14      0      1     4.2
qwen2.5:1.5b    60     54      0      5      0      0      0      0      1      0      0     2.6
qwen3:0.6b      60     42      0      5      0      8      0      5      0      0      0     1.8
qwen3:1.7b      60     60      0      0      0      0      0      0      0      0      0     4.1
Valid answers out of 60 (12 prompts x 5 runs, temperature 0.3)qwen3:1.7b60 / 60qwen2.5:1.5b54 / 60qwen3:0.6b42 / 60granite3.3:2b32 / 60llama3.2:3b30 / 60llama3.2:1b15 / 60 Size does not order this chart: the 3B Llama sits below a 0.6B Qwen. How a model was trained to emit tool calls matters more.
The chart restates the VALID column, and its caption is the point: llama3.2:3b, the largest model here at 3.2B parameters, scored 30 of 60 and landed below the 0.6B qwen3. Meanwhile qwen3:1.7b got every one of its 60 answers right, including the two-call prompt that every other model fumbled. Treat 60 out of 60 as “no failure observed in 60 tries on this suite”, not as a guarantee. And the per-prompt view, same script with --cases (each cell is VALID answers out of five):
case                     granite3.3:2b   llama3.2:1b   llama3.2:3b  qwen2.5:1.5b    qwen3:0.6b    qwen3:1.7b
01-weather-plain                   5/5           4/5           5/5           5/5           5/5           5/5
02-weather-unit-enum               1/5           4/5           5/5           5/5           0/5           5/5
03-currency-codes                  0/5           3/5           4/5           5/5           5/5           5/5
04-currency-big-number             5/5           0/5           4/5           5/5           5/5           5/5
05-reminder-minutes                2/5           0/5           2/5           5/5           5/5           5/5
06-reminder-unit-trap              4/5           0/5           0/5           5/5           0/5           5/5
07-notes-optional-int              3/5           0/5           4/5           5/5           5/5           5/5
08-notes-no-limit                  3/5           3/5           5/5           5/5           0/5           5/5
09-two-calls                       0/5           0/5           0/5           0/5           2/5           5/5
10-no-tool-knowledge               0/5           0/5           0/5           5/5           5/5           5/5
11-no-tool-chat                    4/5           0/5           0/5           4/5           5/5           5/5
12-no-such-tool                    5/5           1/5           1/5           5/5           5/5           5/5
Three prompts separate the models more than any others. The two-call prompt (09) was answered correctly five times out of five by only qwen3:1.7b; qwen3:0.6b managed two. The no-tool prompts (10, 11, 12) were passed cleanly by both Qwen3 models and mostly by qwen2.5:1.5b, and failed most of the time by both Llama 3.2 models. The unit-trap prompt (06) is the interesting one: three models passed it, but both qwen3:0.6b and llama3.2:1b sent minutes_from_now as 2 — hours treated as minutes — in every one of their runs where a number appeared. The table does not show that as a wrong value, because the same answers were also missing a required field or carried junk keys and the scorer reports the most serious label only. That is a limit of one-label-per-answer scoring, and the next section shows what the structural failures look like.

The failures have fingerprints

Each of the shapes below showed up repeatedly, so they are worth learning to recognise. The lines are quoted exactly as the benchmark recorded them (one JSON line per answer, trimmed to the fields that matter in the accordion at the end).

The envelope: right call, wrong shape

llama3.2:1b returned 30 schema-invalid answers, and 19 of them were the same mistake. It put the whole call inside the arguments (and granite3.3:2b did a variant of it nine times, with the real arguments under an arguments key instead):
{"model":"llama3.2:1b","case":"01-weather-plain","run":2,"outcome":"SCHEMA_INVALID","calls":["get_weather{\"type\":\"function\",\"function\":\"get_weather\",\"parameters\":{\"city\":\"Pune\",\"unit\":\"celsius\"}}"],"notes":["get_weather: missing required 'city'; unknown argument 'type'; unknown argument 'function'; unknown argument 'parameters'"],"jsonInText":false,"text":"","ms":1565}
{"model":"granite3.3:2b","case":"09-two-calls","run":1,"outcome":"SCHEMA_INVALID","calls":["get_weather{\"type\":\"get_weather\",\"arguments\":{\"city\":\"Mumbai\",\"unit\":\"celsius\"}}","convert_currency{\"type\":\"convert_currency\",\"arguments\":{\"amount\":100,\"from_currency\":\"GBP\",\"to_currency\":\"INR\"}}"],"notes":["get_weather: missing required 'city'; unknown argument 'type'; unknown argument 'arguments'","convert_currency: missing required 'amount'; missing required 'from_currency'; missing required 'to_currency'; unknown argument 'type'; unknown argument 'arguments'"],"jsonInText":false,"text":"","ms":9376}
The second block is Granite’s variant on the two-call prompt: both calls wrapped, with the tool name repeated under type. Read the calls value: the tool name is right, but the arguments are {"type":"function","function":"get_weather","parameters":{...}} instead of the {...} alone. The city and unit inside are correct. A strict validator sees a missing city and three unknown keys, and rejects it. Because the damage is purely wrapping, it can be undone mechanically, and EnvelopeUnwrap does exactly that and nothing more (source: EnvelopeUnwrap.java, download):
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

/**
 * Some small models send the whole call as the arguments, under "parameters" or "arguments":
 *   {"type":"function","function":"get_weather","parameters":{"city":"Pune","unit":"celsius"}}
 *   {"type":"get_weather","arguments":{"city":"Mumbai","unit":"celsius"}}
 * instead of {"city":"Pune","unit":"celsius"}. If the arguments are shaped like that envelope, return the inner object.
 * Anything else, including an object with other real keys next to the wrapper, is returned unchanged, so a genuinely invalid call still fails validation.
 */
public final class EnvelopeUnwrap {

    private static final ObjectMapper JSON = new ObjectMapper();

    public static String unwrap(String arguments) {
        try {
            JsonNode n = JSON.readTree(arguments);
            if (n != null && n.isObject()) {
                for (String key : new String[] {"parameters", "arguments"}) {
                    if (n.has(key) && n.get(key).isObject() && onlyEnvelopeKeysBesides(n, key)) {
                        return JSON.writeValueAsString(n.get(key));
                    }
                }
            }
        } catch (Exception ignored) {
            // not JSON at all: let the schema check report it
        }
        return arguments;
    }

    /** True when every other key is envelope furniture (type, function, name, label), so no real argument is thrown away. */
    private static boolean onlyEnvelopeKeysBesides(JsonNode n, String key) {
        var names = n.fieldNames();
        while (names.hasNext()) {
            String f = names.next();
            if (!f.equals(key) && !java.util.Set.of("type", "function", "name", "label").contains(f)) return false;
        }
        return true;
    }

    public static void main(String[] a) {
        System.out.println(unwrap("{\"type\":\"function\",\"function\":\"get_weather\",\"parameters\":{\"city\":\"Pune\",\"unit\":\"celsius\"}}"));
        System.out.println(unwrap("{\"type\":\"get_weather\",\"arguments\":{\"city\":\"Mumbai\",\"unit\":\"celsius\"}}"));
        System.out.println(unwrap("{\"city\":\"Pune\"}"));
        System.out.println(unwrap("{\"type\":\"object\",\"properties\":{\"minutes_from_now\":2,\"text\":{\"type\":\"string\"}}}"));
    }
}
Run against four strings — the Llama envelope, the Granite variant, an already-correct call, and a different garbled shape llama3.2:1b also produced — it unwraps the first two and leaves the other two alone, which is the behaviour you want (output captured by running that file against the module’s classpath):
{"city":"Pune","unit":"celsius"}
{"city":"Mumbai","unit":"celsius"}
{"city":"Pune"}
{"type":"object","properties":{"minutes_from_now":2,"text":{"type":"string"}}}
What I did not measure. I did not re-run the benchmark with this unwrapping switched on, so I cannot tell you how many of those 19 answers it would turn into VALID. The values inside could still be wrong. It is offered as a repair for a recognisable shape, not as a score.

The string that should be a number

llama3.2:3b kept producing the right number as text. This is one of its answers to the unit-trap prompt:
{"model":"llama3.2:3b","case":"06-reminder-unit-trap","run":1,"outcome":"SCHEMA_INVALID","calls":["create_reminder{\"text\":\"Call the vendor\",\"minutes_from_now\":\"120\"}"],"notes":["create_reminder: 'minutes_from_now' should be an integer, got \"120\""],"jsonInText":false,"text":"","ms":3974}
Here "minutes_from_now":"120" is the correct value in the wrong type. The tool wants an integer; the model sent a string. If your tool layer coerces types leniently it will pass, and if it validates strictly it will fail, which is why the same model looks very different depending on the framework around it. All 16 of its schema failures were this one mistake: a number sent as a string (ENVEL is 0 for it).

A call where none was wanted

Both Llama 3.2 models, and to a lesser extent granite3.3:2b, treat the presence of tools as an instruction to use one. Asked “What is the capital of France?”:
{"model":"llama3.2:3b","case":"10-no-tool-knowledge","run":1,"outcome":"SPURIOUS_CALL","calls":["get_weather{\"city\":\"Paris\",\"unit\":\"celsius\"}"],"notes":["unexpected call get_weather{\"city\":\"Paris\",\"unit\":\"celsius\"}"],"jsonInText":false,"text":"","ms":3066}
It looked up the weather in Paris. Each Llama model made 14 such spurious calls across the three no-tool prompts (15 answers); granite3.3:2b made 6 and searched the user’s notes for “capital of France”. If your tool can have side effects, an unprompted call is the most dangerous row in the table, not the least.

Made-up argument names and wrong values that still validate

qwen2.5:1.5b scored 54 of 60. Five of its six misses were one thing, on the two-call prompt: it glued two parameter names together (the sixth was one spurious currency call on the say-hello prompt).
{"model":"qwen2.5:1.5b","case":"09-two-calls","run":1,"outcome":"SCHEMA_INVALID","calls":["get_weather{\"city\":\"Mumbai\",\"unit\":\"fahrenheit\"}","convert_currency{\"amount_from_currency\":\"GBP\",\"to_currency\":\"INR\",\"amount\":100}"],"notes":["convert_currency: missing required 'from_currency'; unknown argument 'amount_from_currency'"],"jsonInText":false,"text":"","ms":4414}
This is where “hallucination” really shows up with only four tools to choose from. No model, in any of the 360 answers, invented a tool name (the HALLU column is zero throughout); they invented an argument name instead, amount_from_currency. The opposite kind of error passes the schema check entirely, so only a value check can catch it:
{"model":"granite3.3:2b","case":"03-currency-codes","run":1,"outcome":"WRONG_VALUE","calls":["convert_currency{\"amount\":250,\"from_currency\":\"USD\",\"to_currency\":\"IN\"}"],"notes":["convert_currency: 'to_currency' = \"IN\""],"jsonInText":false,"text":"","ms":4988}
"to_currency":"IN" is a valid string. It is also not a currency, and the tool would have been called with it. A schema validator cannot see that; comparing against expected values (which a benchmark can do and production cannot) can. In production this is what an enum in the schema, or a validation step inside the tool, is for.

Silence where a call was needed

qwen3:0.6b never sent a call with junk in it; its schema failures were all one omitted text field. But it sometimes just talked:
{"model":"qwen3:0.6b","case":"08-notes-no-limit","run":1,"outcome":"NO_CALL","calls":[],"notes":[],"jsonInText":false,"text":"I'll look through your notes to see if there are any related to invoice disputes. Let me check.","ms":1524}
The text says “Let me check” and no call follows. Its failures were omissions: it dropped an enum it was asked to set (the unit in the Fahrenheit prompt: 0 of 5 correct), skipped a call, or answered USD where the prompt said British pounds in three of five runs of the two-call prompt (WVAL is 8 in total). Smaller is not noisier here; it is quieter.

What to do with this

Four habits fall straight out of the failures above, and none requires a bigger model:
  • Validate before you execute. Check every request against the same schema you advertised. Three of the five failure shapes above (the envelope, the string-for-number and the invented argument name) are caught by exactly that check.
  • Repair shapes you can name, reject the rest. The envelope is mechanical to undo. A wrong value is not, so do not guess.
  • Decide how strict to be about types. Accepting "120" for an integer rescues llama3.2:3b on some prompts and is a policy choice you should make on purpose.
  • Gate side effects. A model that calls a tool for a capital-city question will also call the “send email” tool when it should not. Confirm anything that writes, spends or sends.
Should you do this at all? If you can afford one model of roughly 2B parameters, this suite says qwen3:1.7b is the one to start from, and that every model below it needs the habits above around it. If your tools have side effects and your model is one of the Llama 3.2 pair, put a confirmation step in front of them. And if the suite you care about is not these four tools, treat this table as a method rather than a ranking: twelve prompts and one machine cannot tell you how a model behaves on yours. The repository lets you swap the tools and prompts in an hour.
How the scoring works, exactly

For each answer the Scorer does three checks per requested call, in this order: is the tool name registered (otherwise HALLU), do the arguments satisfy the tool’s own JSON schema (otherwise SCHEMA), and do the values match what the prompt called for (otherwise WVAL). The schema step is this method, which also understands the anyOf that MCP produces for an optional parameter:

    private static String typeProblem(JsonSchemaElement el, JsonNode v) {
        if (el instanceof JsonAnyOfSchema any) {   // Optional[int] arrives from MCP as anyOf [integer, null]
            String last = "matches no anyOf branch";
            for (JsonSchemaElement branch : any.anyOf()) {
                if (branch instanceof JsonNullSchema) continue;
                String err = typeProblem(branch, v);
                if (err == null) return null;
                last = err;
            }
            return last;
        }
        if (el instanceof JsonStringSchema && !v.isTextual()) return "should be a string, got " + v.getNodeType();
        if (el instanceof JsonIntegerSchema && !v.isIntegralNumber()) return "should be an integer, got " + v;
        if (el instanceof JsonNumberSchema && !v.isNumber()) return "should be a number, got " + v.getNodeType();
        if (el instanceof JsonBooleanSchema && !v.isBoolean()) return "should be a boolean, got " + v.getNodeType();
        if (el instanceof JsonEnumSchema e && !(v.isTextual() && e.enumValues().contains(v.asText())))
            return "should be one of " + e.enumValues() + ", got " + v;
        return null;
    }

Value matching is deliberately forgiving about presentation and strict about substance: city and currency codes compare case-insensitively, free text must contain a keyword (“timesheet”, “vendor”), numbers must be equal. Arguments the prompt does not constrain are not checked, which is why unit being set to fahrenheit on the Mumbai prompt did not count against anyone. The scorer itself is tested in ScorerTest.java with hand-written tool requests; those nine tests use no model and prove nothing about any model.

The raw answers behind the tables (verbatim)

Each answer the benchmark records is one JSON line in results/<model>.jsonl (generated by scripts/benchmark.sh; not committed, because the numbers are machine-specific). Here is the first answer of qwen3:1.7b to the two-call prompt, the one every other model got wrong at least sometimes, and the matching llama3.2:3b line:

{"model":"qwen3:1.7b","case":"09-two-calls","run":1,"outcome":"VALID","calls":["get_weather{\"city\":\"Mumbai\",\"unit\":\"fahrenheit\"}","convert_currency{\"amount\":100,\"from_currency\":\"GBP\",\"to_currency\":\"INR\"}"],"notes":[],"jsonInText":false,"text":"","ms":7347}
{"model":"llama3.2:3b","case":"09-two-calls","run":1,"outcome":"SCHEMA_INVALID","calls":["get_weather{\"unit\":\"celsius\",\"city\":\"Mumbai\"}","convert_currency{\"amount\":\"100\",\"from_currency\":\"GBP\",\"to_currency\":\"INR\"}"],"notes":["convert_currency: 'amount' should be a number, got STRING"],"jsonInText":false,"text":"","ms":7277}

The second line has two calls; the amount in the second is the string "100", which is why it is SCHEMA_INVALID and why the same model scored 0 of 5 on that prompt.

How to reproduce this on your machine

You need Ollama, JDK 25, Maven and pip install "mcp>=2". Then, from the module directory:

$ scripts/pull-models.sh        # roughly 7 GB of models
$ scripts/mcp-wiring.sh         # MCP only, no model
$ RUNS=5 scripts/benchmark.sh   # writes results/*.jsonl
$ scripts/summarize.py --cases  # the two tables above

Expect different numbers: another CPU, another Ollama version or a GPU can change timing, and sampling at temperature 0.3 means individual answers differ between runs. The shape of the results (which models fail in which way) is what should transfer.

How the runs went, and what is not covered

The first benchmark invocation ran all six models in one go. It completed qwen3:0.6b, qwen3:1.7b and llama3.2:1b, and then the Ollama server’s model process was killed by the operating system while loading llama3.2:3b (Ollama logged “llama-server process has terminated: signal: killed”, which on an 8 GB sandbox points at memory pressure; I did not isolate the cause), and the Java run ended with an exception. I restarted Ollama with a short keep-alive and ran the remaining three models (llama3.2:3b, qwen2.5:1.5b, granite3.3:2b) in a second invocation with identical settings. So the table is two runs stitched together by summarize.py, not one.

Not measured: models above about 4B parameters, GPU inference, other temperatures, longer tool lists (hallucinated tool names may well appear with 30 tools instead of 4), multi-turn tool loops, and parallel tool calling beyond the single two-call prompt. A seventh candidate, smollm2:1.7b, was pulled and reports the tools capability but was not benchmarked. Qwen3 ran with thinking disabled, which suits latency but may not be how you would run it.

Further reading

No Comments yet!

This site uses Akismet to reduce spam. Learn how your comment data is processed.