Skip to content
LinkedInX

What Is Tool Use

Target audience: Those who want an AI agent to call external functions, those struggling with inconsistent quality in tool definitions
Prerequisites: Basic understanding of Harness Engineering

A tool is a function an AI agent can call to connect with the outside world and actually act. An LLM alone cannot read or write files, call external APIs, or execute code. Tools are the bridge that connects that gap to a real execution environment.

Types of Tools

Tool categoryExamples
Information retrievalWeb search, database queries
Computer operationsCode execution, file read/write
BrowsingViewing and scraping web pages
External servicesSending email, calendar operations, GitHub operations
This table scrolls horizontally. Keyboard users can focus the table and use the left and right arrow keys.

MCP is increasingly used as a standardized way to connect multiple tools to external systems.

Elements of a Good Tool Definition

Handing a tool to an AI requires more than a function signature — the AI needs enough information to judge when and how to use it.

ElementDescription
NameA concise identifier for what the tool does
DescriptionWhat it does, and when it should be used
Input parametersTypes, required fields, and constraints
Output formatThe shape of the result the AI receives
Usage conditionsWhen it’s appropriate to use, and when it isn’t
This table scrolls horizontally. Keyboard users can focus the table and use the left and right arrow keys.
Tool name: search_docs
Description: Full-text search over internal documents. Use when the user asks to "look up" or "find information about" something.
Input: query (search keywords, required), max_results (result count, optional, default 5)
Output: A list of title, URL, and excerpt
Usage conditions: Do not include documents containing confidential information in the search scope

A vague description makes it easy for the AI to misjudge which tool to use and when. When multiple tools have overlapping roles, drawing a clear boundary between them matters.

Principles to Follow

1. Grant Least Privilege

Give a tool only the permissions the task actually requires. A file-search tool doesn’t need write access. The “least privilege” principle from harness engineering applies directly to tool design as well.

2. Return Structured Errors

Tools can fail — external API outages, rate limits, expired authentication. Returning structured error information helps the AI judge whether to retry, try a different approach, or check with a human.

3. Handle Destructive Operations Carefully

Tools that perform irreversible operations — deleting files, sending email, writing to production — should include confirmation steps or approval flows.

Pages in This Section

PageContent
Tool Selection Failures and FixesWhy an AI picks the wrong tool, and how to fix it
Execution Permissions and ApprovalLeast-privilege design and where approval belongs
Tool Error HandlingError message design and retry policy
This table scrolls horizontally. Keyboard users can focus the table and use the left and right arrow keys.

Summary

  • Tools are how an AI agent connects with the outside world and actually acts
  • Clear names, descriptions, input parameters, and usage conditions help the AI choose the right tool
  • The principle of least privilege and structured error handling are key safety measures in tool design
  • MCP is an increasingly common standardized way to connect tools
Quiz