← Table of Contents · Page 140 of 868
WHAT TOOLS ARE
Part 5 of 8
EXAMPLES
Example 1: A simple, well-defined schema.
A get_stock_price tool takes a single input called ticker, a string such as "AAPL," and returns a single number named price.
The input schema says ticker is required and must be one to five capital letters.
The output schema says price is a number and currency is a text such as "USD," which stands for United States dollars.
If the agent mistakenly sends the ticker as "apple inc," the harness's validation rejects it before any call happens, and the error message tells the agent what format is expected.
Example 2: Tool calling in practice.
The model wants to send a weekly report.
It does not send anything itself.
It outputs the structured request with the tool name send_email, the recipient [email protected], the subject "Report," and a body.
The harness receives that, checks that the email tool is allowed for this agent, checks that the recipient is on an approved domain, records the request in the audit log, and only then runs the code that sends the message.
It then returns a confirmation, such as "sent at 10:42," to the model as an observation.
Example 3: Read-only versus action.
A search_database tool can only look things up, so the harness lets it run without asking anyone.
A delete_record tool changes data permanently.
For delete_record the harness requires a permission check, shows a human the exact record to be removed, and records the approval and the result in an audit log.
The agent can search a hundred times without worry, but it cannot delete even once without the extra steps.
Example 4: A stable output schema.
A weather tool promises three fields every time: temperature, condition, and location.
Behind the scenes the harness might call Provider A today and Provider B next month.
Each provider returns data in its own messy format, but a small adapter converts both into the same three fields.
The agent never notices the change, and its reasoning keeps working because the output schema stayed fixed.
Advertisement
Read Aloud:
0:00 / 0:00