Module 7: Tools & APIsLesson 5 of 5

Exercise: Tool vs Agent

Exercise: Tool vs Agent

Practice deciding when to use tools vs agent reasoning.

Quiz: Tool or Agent?

For each task, decide: Tool, Agent, or Both?

1. "What's the capital of France?"

  • Tool
  • Agent
  • Both
<details> <summary>Answer</summary> **Agent** — This is static knowledge the LLM knows. </details>

2. "What's the current price of Tesla stock?"

  • Tool
  • Agent
  • Both
<details> <summary>Answer</summary> **Tool** — Current data requires web search or API. </details>

3. "Create a Python script that sorts a list"

  • Tool
  • Agent
  • Both
<details> <summary>Answer</summary> **Both** — Agent writes the code, Tool (Write) saves it. </details>

4. "What's 847 × 293?"

  • Tool
  • Agent
  • Both
<details> <summary>Answer</summary> **Agent** — LLMs can do basic math (though tool is more reliable for complex math). </details>

5. "Check if my website is up"

  • Tool
  • Agent
  • Both
<details> <summary>Answer</summary> **Tool** — Requires actual HTTP request (web_fetch or exec curl). </details>

6. "Summarize this PDF about climate change"

  • Tool
  • Agent
  • Both
<details> <summary>Answer</summary> **Both** — Tool reads the PDF, Agent summarizes content. </details>

7. "What should I name my startup?"

  • Tool
  • Agent
  • Both
<details> <summary>Answer</summary> **Agent** — Creative task, no external data needed. </details>

8. "Send a Slack message to the team"

  • Tool
  • Agent
  • Both
<details> <summary>Answer</summary> **Both** — Agent composes message, Tool (message/API) sends it. </details>

Practical Exercise

Try these with your agent:

  1. Pure Tool Task:

    "What's the current weather in London?"

    Verify: Agent uses web_search or weather tool

  2. Pure Agent Task:

    "Write a haiku about programming"

    Verify: Agent generates without tools

  3. Combined Task:

    "Find the top news story today and save a summary to news.md"

    Verify: Agent searches, synthesizes, and writes file

Module Summary

You've learned:

  • ✅ What tools are and why they matter
  • ✅ The rule: Precision → Tool, Thinking → Agent
  • ✅ Common failure patterns and how to avoid them
  • ✅ Browser, file, and API tool usage
  • ✅ How to combine tools effectively

Key Insight: Tools extend capability but require judgment. Know when to reach for a tool vs when to let the agent think.

Next: Debugging when things go wrong.