C.W.K.
Stream
Lesson 05 of 10 · published

Multi-Tool Orchestration

~20 min · tools, agents, orchestration

Level 0Apprentice
0 XP0/100 lessons0/14 achievements
0/120 XP to next level120 XP to go0% complete

Many tools, one decision per turn

When you expose ten tools, the model has to choose one (or a parallel set) per turn. The prompt now bears the cognitive load of routing: which tool fits which intent, in which order, with which guardrails. This is where many agents fall apart — too many tools, too thin descriptions.

Patterns that survive

  • Group tools by domain — separate router prompt picks domain, then a domain-specific agent has only the relevant tools.
  • Parallel tool calls — providers now allow returning multiple tool calls in one turn. Use for read operations that don't depend on each other.
  • Sequential dependency hints — say in the prompt 'before calling X, call Y to get the customer_id.' The model honors explicit ordering.
  • Tool budget — cap the number of tool calls per request. Loops happen; budgets are how you bound them.

Anti-patterns

  • 30+ tools in one agent — the model degrades.
  • Two tools with overlapping responsibility — the model picks at random.
  • No guidance on order — model picks one, fails, doesn't try the other.

Code

Tool budget enforcement·python
MAX_TOOL_CALLS = 8

calls = 0
while calls < MAX_TOOL_CALLS:
    resp = client.messages.create(model=..., tools=tools, messages=msgs)
    if resp.stop_reason == "end_turn":
        break
    if resp.stop_reason == "tool_use":
        calls += 1
        tool_results = run_tools(resp.content)
        msgs += [{"role": "assistant", "content": resp.content},
                  {"role": "user", "content": tool_results}]
else:
    raise RuntimeError("tool budget exhausted")

External links

Exercise

Take an agent with 8+ tools. Group them by domain into two router-fed sub-agents with smaller tool sets. Compare correct-tool selection rate.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.