Techniques

Building AI Agents with Tool Use

Jay Banlasan

Jay Banlasan

The AI Systems Guy

tl;dr

Give AI the ability to call external tools and APIs so it can take real actions, not just generate text.

An AI that can only generate text is useful. An AI that can also search databases, call APIs, send emails, and update spreadsheets is powerful. That is the difference between a chatbot and an agent.

Building ai agents with tool use means giving the AI access to external capabilities it can invoke on its own when the task requires it.

What Tool Use Means

Tool use (also called function calling) lets an AI model recognize when it needs external data or actions and call a predefined function to get them.

Instead of guessing your current ad spend, the agent calls your Meta API and gets the real number. Instead of telling you to update a CRM record, the agent updates it directly. Instead of summarizing what an email should say, the agent sends it.

The AI decides when to use which tool based on the conversation and task at hand.

Designing Your Tool Set

Start with the tools your agent needs for its specific job. A marketing operations agent might need:

Each tool is a function with a clear name, description, and parameters. The AI reads the description to understand when to use each one.

Building With Claude

Claude's tool use API lets you define tools as JSON schemas. You describe what each tool does and what parameters it accepts. When Claude determines it needs a tool, it returns a structured request instead of text. Your code executes the function and returns the result. Claude then continues with the real data.

The flow: User asks question. Claude decides it needs data. Claude calls get_campaign_data. Your code fetches the data. Claude receives the data and generates an answer grounded in reality.

Safety Considerations

Not every tool should be callable without approval. Categorize your tools:

Read-only tools. Fetching data, running queries, checking status. These are safe for autonomous use.

Write tools with guardrails. Sending messages, updating records. These should log every action and have validation rules (no budget changes over 20%, no emails to external contacts).

Restricted tools. Deleting data, processing payments, modifying permissions. These require human confirmation before execution.

Build the approval layer into your agent's workflow. When it wants to call a restricted tool, it pauses and asks for confirmation.

The Agent Loop

A well-designed agent follows this loop:

  1. Receive task
  2. Plan approach (which tools needed in what order)
  3. Execute tool calls
  4. Check results against expectations
  5. Adjust plan if needed
  6. Return final answer or completed action

The plan-execute-check loop means the agent can handle multi-step tasks that require reasoning between steps. This is what separates agents from simple automation.

Start Simple

Build a one-tool agent first. Give it read access to one data source. Get comfortable with the pattern. Then add tools incrementally. An agent with two well-designed tools beats one with ten poorly designed ones.

Build These Systems

Ready to implement? These step-by-step tutorials show you exactly how:

Want this built for your business?

Get a free assessment of where AI operations can replace overhead in your company.

Get Your Free Assessment

Related posts