Sub topic 3
Choosing clear, consistent tool names
This chapter assumes you can read JSON and short Python examples, and that you have called an LLM API with tools at least once. The name is the first thing the model reads about a tool. It also appears in the model's output when the model calls the tool, so it has to be easy to read, easy to tell apart from other names, and valid for the provider.
Why the name matters
The model sees the name, the description, and the input schema together. It uses all three to decide which tool to call. A good name does part of that work before the model reads the description. A vague name makes the description carry all of it.
Compare the two tool definitions from this tutorial:
search_orderssays what it acts on and what it does.do_order_thingsays almost nothing. The model must infer the behavior from a one-line description.
Rules for good names
- Use a verb and a noun. Write
get_order,search_orders,cancel_order. The verb tells the model what happens. The noun tells it what is affected. - Choose verbs that mark the difference between tools. Use
getfor lookup by ID,searchfor lookup by filters,create,update, anddeletefor changes. Keep the meaning of each verb the same across all your tools. - Pick one naming style and keep it. If one tool is
get_order, do not name anotherfetchCustomer. Mixed styles make the set look like it came from different systems, and they make it harder to guess a name. - Use one word per concept. Do not mix
customer,client, anduserfor the same thing. Use the same word in names, descriptions, and parameters. - Avoid vague words. Words like
handle,process,manage,data, andthingfit almost any action. - Follow provider limits. Most providers allow letters, digits, underscores, and hyphens, with a length limit (often 64 characters). Check your provider's rules. Spaces and most punctuation are rejected.
Names in a set
A name is read next to the other names. The model compares them. Look at your whole list at once.
tools = [
"get_order",
"search_orders",
"cancel_order",
"get_customer",
"search_customers",
]The pattern is predictable: get_ takes an ID and returns one item, search_ takes filters and returns a list. A model that has seen get_order can guess how get_customer behaves.
Compare an inconsistent set:
tools = [
"orderLookup",
"find_orders_by_status",
"CancelOrd",
"customer",
"listClients",
]Here the styles differ, customer has no verb, and customer and Clients name the same thing differently. Two of these could plausibly do the same job, and the model cannot tell.
Common mistakes
- Names that are only different in a letter or suffix, such as
get_orderandget_orders. - Abbreviations the model may not read correctly, such as
ordorcust. - Names that describe the implementation (
call_orders_api_v2) instead of the capability. - Prefixes that repeat on every tool and add no information.
Exercise
A tool set contains Orders, fetch_customer_info, and handleCancel. Rewrite the three names so they follow a consistent verb-and-noun style, and say which rule each change applies.
Show answer
search_orders (or get_order, depending on behavior) applies the verb-and-noun rule, since Orders has no verb. get_customer applies the one-word-per-concept and no-vague-words rules, since info adds nothing. cancel_order applies the verb-and-noun rule and avoids the vague verb handle. All three also use the same lowercase snake_case style.