SecondMind

← Community

Write A Tool Definition

ai-agents by Admin 3 min read 1 file

Design tools an LLM can actually use — one job per tool, names that survive being read alone, and errors that tell the model how to recover. Use when adding a tool or function to an agent, or when a model keeps calling the wrong one.

---
name: write-a-tool-definition
category: ai-agents
description: >-
  Design tools an LLM can actually use — one job per tool, names that survive
  being read alone, and errors that tell the model how to recover. Use when
  adding a tool or function to an agent, or when a model keeps calling the wrong
  one.
---

# Write a Tool Definition

A model picks a tool by reading its name, its description, and its parameter
names — and nothing else. Not your code, not your intent, not the ticket that
led to it. If a tool gets called at the wrong time or with the wrong arguments,
the fix is almost always in that text rather than in the model.

## One tool, one job

The most common failure is a tool that does several things depending on a mode
flag.

```
manage_user(action="create"|"update"|"delete"|"list", ...)
```

The model now has to get two decisions right at once, and the parameter list is
a union where most fields are irrelevant to any given call. Split it:

```
create_user(email, name)
update_user(user_id, fields)
list_users(limit, cursor)
```

Each has a short description, a small parameter list, and no invalid
combinations. Splitting one confusing tool into three obvious ones nearly always
raises accuracy.

You are reading the opening of this skill.

The rest is open to any signed-in account — free included. Reading the library costs nothing.

Join the waitlist Sign in

Shared publicly by the author and open for any use. See the Terms.