Engineering

A field guide to tool calling

Schemas, retries and the errors worth surfacing to users. A practical guide to designing tools that models call correctly the first time, drawn from a year of production traces.

Isometric line drawing of a stack of CMS collection items feeding a grid of cards and a detail page, with one card highlighted in blue

Most agent failures we see are not reasoning failures. They are tool failures: a missing field, a vague description, an error the model cannot read. After a year of production traces, these are the patterns that make tools work the first time.

Name tools like verbs

Models choose tools by name before they read descriptions. refund_order beats orders_tool, and search_customers beats customer_api. Keep each tool to one job and split anything that needs a mode flag.

Make schemas strict

Use enums instead of free text wherever you can, mark required fields as required and give every field an example. Strict schemas cut malformed calls in our traces by 70 percent.

Return errors a model can act on

An error that says order not found, check the order number format, which looks like ORD-12345 leads to a correct retry. A stack trace leads to an apology to the customer. Write errors for the model, and log the stack trace for yourself.

Surface only what users need

Users do not need to see a retry or a timeout that resolved itself. They do need to know when an action failed and what happens next. Decide which errors reach the conversation and keep the rest in the trace.

Good tools make average models look smart. Bad tools make the best models look careless.

More from the blog

Notes on keeping a personal library that stays useful.

Notes from the team on agents, evals and the work of shipping AI products people trust.

Get new posts by email.

One short email when we publish something new.

No spam. Unsubscribe in one click.

Start your personal context library.

A personal context library for Mac, iPhone and iPad. Local first, private by default.

Product

Download

iPhone and iPad

Browser extension

Company

Story

Support

Press kit

Legal

Privacy

Terms

Imprint

Shelfmark

© 2026 Shelfmark Software

Privacy

Terms

Cookies

Remix project

Create a free website with Framer, the website builder loved by startups, designers and agencies.