Why Multi-Tool AI Agents Become Inconsistent (and How to Evaluate Them)
What actually breaks when a conversational AI assistant grows from 5 tools to 50+, why cross-tool logic drift looks like LLM hallucination, and how to build an evaluation harness that catches inconsistencies before users do.
Introduction: The 5-Tool Illusion vs. 50-Tool Reality
In my previous articles on building AI agents with Llama 3 and multi-agent orchestration with Google ADK, our agents worked with two to four tools. At that scale, everything feels clean and predictable. You write a short tool docstring, pass the schemas to the model, test five or six prompts, and ship it.
Now imagine scaling that exact same pattern to a real enterprise chat system with 51 tools.
Consider a SaaS Customer Success and Revenue Operations (RevOps) intelligence assistant. Account managers and regional leads open the chat interface and ask natural, open-ended questions like:
- "How are my enterprise accounts doing this quarter?"
- "Which renewals in my territory are at risk right now?"
- "Compare active usage against billed ARR for my top ten accounts."
Behind that single chat box sits a large tool ecosystem: CRM account lookups, usage telemetry queries, billing ledger totals, support escalation logs, renewal pipelines, and NPS summaries.
And that is where things started getting weird. Users noticed that asking the same question with slightly different wording, or even running the same prompt twice, could produce different tool calls, slightly different numbers, or conflicting explanations. On the surface, everyone blames the LLM ("the AI is hallucinating again").
In reality, after digging into traces and running systematic experiments on a production-scale multi-tool chat system, I learned that inconsistency rarely comes from a single bug. It comes from a combination of large tool-count routing drift, hidden discrepancies between tools, and the absence of a proper evaluation harness.
In this article, I will share what I observed, the fixes that actually moved the needle, how to structure an evaluation setup for multi-tool agents, and what we are looking at next to scale past static prompts.
Finding 1: Why LLMs Struggle with Large Tool Counts
When you hand an LLM 50+ tool schemas in every single turn, you are asking it to perform fine-grained semantic routing across a crowded namespace before it even starts reasoning about the answer.
At 5 tools, descriptions are distinct. At 51 tools, overlaps are inevitable. For example, in a RevOps assistant you almost certainly end up with tools like:
get_account_health(account_id, window)get_portfolio_summary(owner_id, quarter)get_renewal_risk(territory_id, horizon_days)get_usage_trends(account_id, metric)
Ask the model: "How are my enterprise accounts doing?" Should it call
get_portfolio_summary, loop overget_account_health, or checkget_renewal_risk?
Without explicit boundaries, all three look plausible. On Monday the model picks get_portfolio_summary. On Tuesday, with a slight rephrase ("Give me a status check on my enterprise accounts"), it picks get_renewal_risk. Even worse, loading 50+ JSON schemas burns thousands of input tokens on every turn, diluting attention across the rest of the system prompt.
What Worked: Explicit Tool Boundaries and Routing Rules
Our first major finding was straightforward: LLMs do not perform reliably with large tool counts if you rely on generic tool docstrings alone. You have to remove ambiguity at both the schema level and the system-prompt level.
Instead of vague one-line descriptions, each overlapping tool needs explicit "Use when" and "Do NOT use when" clauses, paired with deterministic routing rules in the system prompt:
TOOL_ROUTING_INSTRUCTIONS = """
Tool Selection Rules:
1. Portfolio Overview vs. Single Account:
- Use `get_portfolio_summary` when the user asks about multiple accounts,
"my accounts", or territory-wide health without naming a specific account.
- Use `get_account_health` ONLY when a single account name or ID is specified.
- Do NOT call `get_renewal_risk` for general health checks unless the user
explicitly asks about churn, risk, or upcoming renewals.
2. Ambiguous Scopes:
- If a metric name maps to both live product telemetry and financial billing,
prefer `get_account_arr_summary` for revenue questions and `get_usage_trends`
for adoption questions.
- If the request is still ambiguous across two tools, ask one brief
clarifying question instead of guessing.
"""
Tightening tool descriptions and encoding explicit priority rules immediately cut down erratic tool hops. However, while inspecting failed traces, we uncovered a second, much subtler source of inconsistency.
Finding 2: Cross-Tool Logic Drift (When the LLM Is Not the Bug)
What if the model picked the right tools, passed the right arguments, and read the tool outputs accurately, yet the final answer is still inconsistent?
This was the biggest eye-opener during our experiments. Suppose an account lead asks two questions in the same session:
- "What is the total ARR for my enterprise accounts?" -> Calls
get_account_arr_summary-> Returns $420,000. - "Break down my renewal pipeline by account for this quarter." -> Calls
get_territory_renewal_pipeline-> Sums to $485,000.
Wait a minute. Why did those two numbers disagree by $65,000?
When we inspected the underlying implementations of those two tools, the LLM had done nothing wrong:
get_account_arr_summaryqueried the billing ledger over a rolling 90-day window and excluded pending upsell quotes (include_pending=False).get_territory_renewal_pipelinequeried the CRM forecast over the calendar quarter and included pending expansion quotes (include_pending=True).
Because both tools lived behind clean conversational abstractions, the user saw one chat assistant giving two conflicting answers.
Fixing Logic Drift and Handling Unavoidable Discrepancies
Once we spotted this pattern, we split our remediation into two clear rules:
- Align shared business logic first. Whenever two tools represent the same domain concept (e.g., active accounts, quarter boundaries, ARR definition, timezone defaults, or excluded test accounts), their filters, date windows, and null-handling rules must be unified at the tool/backend layer. There should never be silent drift between tools.
- Encode unavoidable discrepancies explicitly in the system prompt. In real enterprise systems, some differences cannot simply be erased. For example, the finance billing ledger and the CRM sales forecast legitimately differ due to recognition timing or pending approvals. In those cases, if the AI does not know why they differ, it will either silently pick one or try to rationalize the gap. Instead, we document those exact exceptions in the system prompt (and tool return metadata) so the assistant proactively tells the user why the figures differ whenever both sources appear.
Here is what an explicit exception rule looks like in practice:
That single change turned confusing "wrong numbers" into transparent, trustworthy answers.
Building an Evaluation Setup for Multi-Tool Agents
Once a chat system has 50+ tools and cross-tool edge cases, manual testing ("trying five prompts in the UI after a deploy") breaks down completely. Fixing one tool description can silently break routing on ten unrelated queries.
To catch regressions systematically, you need an evaluation setup built specifically for multi-tool trajectories, metric parity, and run-to-run consistency.
1. Designing a Representative Golden Dataset
A useful eval suite for a multi-tool assistant cannot just be 20 happy-path prompts. It needs five distinct test categories:
- Single-Tool Lookups: Clear queries that must hit one exact canonical tool with valid arguments.
- Multi-Tool Chains: Complex questions requiring sequential or parallel tool calls (e.g., resolve territory ID -> fetch accounts -> fetch escalations).
- Paraphrase Consistency Pairs: Two or three different natural phrasings of the same underlying question that must converge on the same tool trajectory and equivalent numeric conclusions.
- Discrepancy & Exception Traps: Prompts that intentionally trigger tools with known scope differences (billing vs. CRM forecast) to verify the agent discloses the caveat accurately.
- Out-of-Scope / Ambiguous Queries: Prompts where the right behavior is asking a clarifying question or declining rather than forcing a bad tool call.
2. Two-Layer Grading: Deterministic Checks + LLM Judges
Relying purely on an LLM judge is slow and noisy; relying purely on exact string matching is too brittle for natural language. Splitting grading into two layers solves both:
- Layer 1: Deterministic Assertions (Fast, Zero Ambiguity):
- Tool Recall & Precision: Did the agent call the required tools without wandering into irrelevant ones?
- Argument Validity: Did dates, IDs, and enum filters match expected schemas?
- Cross-Tool Parity Checks: Do numbers reported in the final response actually match numbers returned in the raw tool JSON payloads?
- Cost & Latency Budgets: Token count and total wall-clock latency stay within acceptable bounds.
- Layer 2: LLM-as-a-Judge Rubrics (Semantic Quality):
- Groundedness: Every claim and metric in the final answer is supported by tool outputs (zero fabricated numbers).
- Exception Disclosure Compliance: When a known discrepancy case runs, did the assistant clearly explain the scope difference to the user?
3. Measuring Real Consistency: pass@k vs. pass^k
One trap I see often in agent evaluation is running each test case once (k=1) and celebrating a 90% pass rate. In a 50-tool chat system, a flaky routing decision might pass 3 out of 5 times and fail 2 out of 5 times. To a user, that feels broken.
When evaluating reliability across k independent trials per test case, two metrics tell very different stories:
\text{pass@}k = 1 - (1 - p)^{k}\text{pass}^{k} = p^{k}Here, p is the single-trial success probability of a task:
pass@kmeasures capability: "Did the agent get it right at least once in k attempts?" Great for coding benchmarks, misleading for production chat.pass^kmeasures consistency: "Did the agent succeed on ALL k attempts?" If a query has p = 0.85 per run,pass@5looks like 99.99%, whereaspass^5drops to 0.85^5 \approx 44.4\%.
Tracking pass^k (for k=3 or k=5) immediately exposes prompt fragility and overlapping tool ambiguity.
4. Putting It Together in Python
Below is a lightweight, self-contained evaluation harness structure illustrating how to combine trajectory scoring, cross-tool parity checks, and pass^k consistency tracking:
from dataclasses import dataclass, field
from typing import Any, Callable
@dataclass
class EvalCase:
case_id: str
query: str
expected_tools: set[str]
forbidden_tools: set[str] = field(default_factory=set)
must_disclose_terms: list[str] = field(default_factory=list)
paraphrase_group: str | None = None
@dataclass
class TrialResult:
called_tools: list[str]
tool_outputs: dict[str, Any]
final_response: str
judge_grounded: bool
judge_disclosed_exception: bool
def score_trial(case: EvalCase, trial: TrialResult) -> dict[str, Any]:
"""Score a single agent trial with deterministic + judge checks."""
called_set = set(trial.called_tools)
# 1. Deterministic tool trajectory checks
missing_tools = case.expected_tools - called_set
hit_forbidden = case.forbidden_tools & called_set
trajectory_ok = not missing_tools and not hit_forbidden
# 2. Deterministic exception-term check (lightweight pre-filter before LLM judge)
response_lower = trial.final_response.lower()
terms_ok = all(term.lower() in response_lower for term in case.must_disclose_terms)
# 3. Combined pass decision
passed = (
trajectory_ok
and terms_ok
and trial.judge_grounded
and (not case.must_disclose_terms or trial.judge_disclosed_exception)
)
return {
"passed": passed,
"trajectory_ok": trajectory_ok,
"missing_tools": sorted(missing_tools),
"hit_forbidden": sorted(hit_forbidden),
"terms_ok": terms_ok,
}
def evaluate_consistency(
cases: list[EvalCase],
run_agent: Callable[[str], TrialResult],
k: int = 5,
) -> dict[str, Any]:
"""Run each eval case k times and compute pass@k vs. pass^k."""
results = []
for case in cases:
trials = [score_trial(case, run_agent(case.query)) for _ in range(k)]
pass_flags = [t["passed"] for t in trials]
results.append({
"case_id": case.case_id,
"paraphrase_group": case.paraphrase_group,
"pass_rate": sum(pass_flags) / k,
"pass_at_k": any(pass_flags),
"pass_hat_k": all(pass_flags), # pass^k: must pass every trial
"failures": [t for t in trials if not t["passed"]],
})
total = len(results)
return {
"k": k,
"mean_pass_at_k": sum(r["pass_at_k"] for r in results) / total,
"mean_pass_hat_k": sum(r["pass_hat_k"] for r in results) / total,
"cases": results,
}
In practice, you also add a cross-case check grouped by paraphrase_group: if two paraphrases of the same intent select different tools or diverge numerically beyond a tolerance threshold, the CI gate flags it immediately.
What Comes Next: Scaling Past Static Prompts
Prompt engineering, stricter tool descriptions, and explicit exception disclosures got us far, and our evaluation setup now catches regressions early. Still, stuffing 50+ schemas into a static system prompt has a ceiling. As more teams add new tools, prompt size grows, latency climbs, and routing instructions become harder to maintain by hand.
Based on what we learned, here are the architectural steps we are prioritizing next:
1. Dedicated Tool Discovery Engine
Instead of injecting all 51 tool definitions into every turn, the next step is introducing a dedicated Tool Discovery Engine. When a user submits a query, a lightweight retrieval layer searches an indexed tool registry (matching tool descriptions, parameter schemas, and curated example queries using hybrid semantic + keyword search) and injects only the top-k candidate tools (say, 5 to 8 schemas) into the agent's context window. Fewer tools per turn means lower token cost, faster inference, and dramatically less routing confusion.
2. Automated Tool Contract & Metric-Parity Tests in CI
Do not wait for chat users to discover that one team changed a date window or filter flag on an endpoint. Any shared business entity (ARR, active accounts, quarter boundaries) should have automated backend parity assertions in CI whenever overlapping tool implementations change.
3. Hierarchical Routing / Domain Sub-Agents
Once tool domains separate cleanly (Billing & ARR, Product Telemetry, Support Escalations, Renewal Forecasting), a lightweight router can delegate to domain-specific sub-agents, each owning a tight set of 8–12 cohesive tools rather than one monolithic 50-tool generalist.
4. Production Trace-to-Eval Flywheel
Every time a user hits a confusing discrepancy, gives negative feedback, or triggers a fallback path in production, sanitize and promote that trace into the golden eval dataset. Over time, your evaluation suite becomes an exact map of real user expectations.
Conclusion
Scaling an AI chat assistant from a 4-tool demo to a 50+ tool system teaches a humbling lesson: most "AI inconsistency" bugs are actually systems-engineering, data-contract, and evaluation problems.
- LLMs degrade when forced to disambiguate dozens of overlapping tool schemas at once, so explicit boundaries and routing rules matter.
- Aligning business logic across tools eliminates silent contradictions; when legitimate domain discrepancies remain, explicit exception rules in the system prompt turn confusion into clear explanations.
- Measuring
pass^kalongside deterministic trajectory/parity checks and LLM judges prevents flaky routing from sneaking into production.
There are real trade-offs to keep in mind here. Multi-trial pass^k evaluations multiply API token costs, LLM judges can drift across model updates unless pinned and calibrated against human-labeled samples, and building a full tool discovery engine is unnecessary overhead if your assistant only has five tools. Start with clean schemas, aligned tool logic, and a small deterministic eval suite, then scale the architecture as your tool count demands it.
All images, unless otherwise noted, are by the author.
References
- Anthropic: Demystifying Evals for AI Agents
- Sierra: tau-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domains
- Building AI Agent With Llama 3
- Building a Multi-Agent Application to Interact with Google Products
Thanks for reading! Have thoughts or questions? Connect with me on LinkedIn.