mcp-dispatch (Qwen3-1.7B)
mcp-dispatch takes a user request and a shortlist of MCP tools, picks the right tool, and writes a valid JSON-RPC tools/call. It runs locally. When none of the tools can do what was asked, it says so, and when a required argument is missing, it asks for it instead of making one up.
This repository holds the merged 16-bit weights: Qwen/Qwen3-1.7B fine-tuned with a LoRA adapter, with the adapter merged in. The adapter alone is at vivekparikh-ideas/mcp-dispatch-qwen3-1.7b-lora.
- Code: github.com/vivekparikh-ideas/mcp-dispatch
- Public test set: vivekparikh-ideas/mcp-dispatch-public-test
What it returns
Exactly one JSON object:
// A tool call
{"jsonrpc": "2.0", "method": "tools/call",
"params": {"name": "get_current_weather", "arguments": {"city": "Lisbon"}}}
// No tool fits (chit-chat, or a request none of the tools can do)
{"tool": null}
// A required argument is missing
{"needs_clarification": {"tool": "create_event", "missing": ["start_time"]}}
It never runs a tool. Your host decides whether to run the call.
Where it fits
mcp-dispatch does not search a large catalog. Put it behind the tool search your host already has (for example LiteLLM's MCP tool search or FastMCP's search transforms) and pass the top 5 tools or fewer. Tools and request must fit in about 1,000 prompt tokens.
Usage
Use the Dispatcher from the GitHub repository. It builds the exact prompt the model was trained on, trims the tool schemas to fit, and checks every output against the tool's schema before returning it.
from mcp_dispatch import Dispatcher
dispatcher = Dispatcher.from_pretrained("vivekparikh-ideas/mcp-dispatch-qwen3-1.7b")
# GPU servers: Dispatcher.from_pretrained(..., backend="vllm"), about twice as fast
result = dispatcher.dispatch("What's the weather in Porto right now?", tools)
print(result.kind, result.output) # tool_call / needs_clarification / no_tool, and the JSON
tools is the shortlist in tools/list format (name, description, inputSchema), best match first. Installation steps are in the repository README.
The model was trained in Qwen3's non-thinking mode with greedy decoding and one fixed system prompt. Calling it directly with a different prompt will give worse results.
Evaluation
Strict accuracy: an output counts only if it passes the schema check and matches the label exactly (same tool and arguments, the same missing arguments, or no tool). Local models ran on an NVIDIA L4 in float16 with greedy decoding; hosted models were called through their native tool-calling APIs.
With the candidate tools given (the right tool is in the shortlist whenever one exists):
| Model | New tools (2,000 rows) | Public set (198 rows) | Unsupported requests (400 rows) |
|---|---|---|---|
| Qwen3-1.7B (base) | 39.9% | 49.5% | 93.0% |
| mcp-dispatch | 91.7% | 95.0% | 99.3% |
| Qwen3-4B | 66.7% | 73.7% | 51.0% |
| Qwen3-8B | 70.8% | 74.2% | 20.8% |
| Claude Haiku 5.5 | 77.1% | 91.9% | 98.0% |
| Claude Sonnet 5.5 | not run | 98.0% | not run |
"New tools" uses 262 tools that never appear in training. "Unsupported requests" are requests that are close to one of the offered tools, but none of them can do it. On new tools with a missing required argument, mcp-dispatch asks for it 94.3% of the time and calls the tool anyway 1.7% of the time. It followed no instruction planted in a tool description on any test set. Only the public set is released.
With a tool search in front. A BM25 search over every tool in the test set picks the top 5, and every model gets the same shortlist. Requests whose tool the search missed count as failures.
| Model | New tools | Public set | Unsupported requests |
|---|---|---|---|
| mcp-dispatch | 82.9% | 80.6% | 95.5% |
| Claude Haiku 5.5 | 71.9% | 79.4% | 94.9% |
| Claude Sonnet 5.5 | not run | 85.0% | not run |
Speed. One request at a time on an NVIDIA L4: a median of 0.65 to 0.77 s with vLLM, and 1.45 to 1.74 s with Hugging Face transformers. Claude Haiku 5.5 over its API took 0.76 to 0.79 s on the same requests.
Training
LoRA (rank 16, alpha 32, dropout 0.05) on all attention and MLP projections of the frozen 16-bit base model, with the loss on answer tokens only. The training data is 31,390 synthetic rows over 1,175 tools; every label was checked against the tools' JSON Schemas before it was kept. It includes requests with missing arguments, chit-chat, requests no offered tool can do, and tool descriptions with planted instructions. The training data is not released.
Limitations
- One request, one tool call. It does not plan multi-step work.
- It picks only from the shortlist it is given. When the right tool isn't there, it usually answers "no tool", but in testing it called a wrong tool on 16% of those requests.
- It sometimes adds an optional argument nobody asked for. The schema check does not catch this, because the call is still valid.
- Tools plus request must fit in about 1,000 prompt tokens, roughly 3 to 5 typical tools.
- English only. Speed was measured on a server GPU only.
License
Apache-2.0, the same as the base model, Qwen/Qwen3-1.7B. This model is a modified version of Qwen3-1.7B: it was fine-tuned as described above.
Copyright 2026 Vivek Parikh.