Concepts

Tool Use Patterns

Design strategies and patterns for AI agents to select, invoke, and combine external tools effectively to complete complex tasks.

seed#tool-use#ai-agents#patterns#mcp#function-calling#orchestration

What it is

Tool use patterns define how AI agents select, invoke, and combine external tools to solve tasks. While function calling is the technical mechanism, tool use patterns are the higher-level strategies that determine when and how to use them.

Main patterns

Single tool

The agent identifies the correct tool and invokes it once:

"What time is it in Tokyo?" → get_time(timezone="Asia/Tokyo")

Parallel calls

The agent invokes multiple tools simultaneously when they're independent:

"Compare the weather in Madrid and London"
→ get_weather("Madrid") + get_weather("London") [in parallel]

Chained calls

One tool's result feeds the next:

"Find the latest commit and show me the changes"
→ get_latest_commit() → get_diff(commit_sha)

Conditional selection

The agent decides which tool to use based on context:

"Search for information about X"
→ If X is code: search_code()
→ If X is documentation: search_docs()
→ If X is general: web_search()

Error recovery

The agent handles failures and seeks alternatives:

search_api() → Error 429 → wait(30s) → retry()
or
search_api() → Error → fallback_search()

Design principles

  • Precise descriptions: each tool's description quality determines whether the agent selects it correctly
  • Appropriate granularity: tools neither too broad nor too specific
  • Idempotency: prefer tools that can be re-executed without side effects
  • Clear boundaries: define what each tool can and cannot do
  • Feedback loops: the agent should be able to interpret results and adjust its strategy

Relationship with MCP

The Model Context Protocol standardizes how tools are discovered and described, making these patterns portable across different systems and models.

Why it matters

Tool use patterns define how LLMs interact with the outside world. Understanding when to use function calling vs MCP, how to design effective tool schemas, and how to handle tool errors is essential for building reliable agents.

References

Concepts