Advertisements

A shopper wants to know whether a returned parcel has reached the warehouse. The assistant has an order lookup, a return lookup and several dozen other tools, most of which have no role in answering that question. Sending Claude every specification uses part of the conversation budget before the assistant knows which functions it needs. Ado Kukic's new walkthrough describes an alternative in Anthropic's Messages API: an available search tool lets Claude retrieve the relevant definitions as the conversation develops. [1] [2]

A fictional retailer provides a useful test case. Its desk checks outbound orders daily but looks up receipts at the returns warehouse only occasionally. Kukic's example uses an existing API feature, so the developer can defer the warehouse lookup without rewriting the function itself. The test can use a shopper's ordinary wording: “I posted those shoes back last week. Have you got them yet?” That question gives the assistant no internal service name to rely on when finding the right record. [1] [2]

Advertisements

Decide what stays on the desk

The developer can begin with an inventory of the functions available to the order assistant. Recent requests show how often each function was needed, while its description and argument definitions show how much space it occupies. A frequently used order-status lookup is a reasonable candidate to remain visible. The receiving warehouse's return lookup may suit deferred loading. A long schema does not automatically make a function a good candidate for deferral, particularly if most conversations depend on it.

Anthropic suggests keeping roughly three to five frequently used tools available immediately. It identifies growing catalogs, declining selection accuracy and definitions consuming more than ten thousand tokens as reasons to try search. Those suggestions provide starting points for measurement. A desk with a handful of short definitions and a predictable question on every turn may see little benefit. Its assistant would otherwise spend another step discovering a function it could already have selected. [2]

Ordinary tool definitions still belong in the complete tools array sent to the Messages API. The request also includes the built-in search tool, with defer_loading set to true on each function that should be discovered later. The search tool itself stays available from the start. Deferral controls which definitions initially reach the model; the service still needs the catalog to retrieve a definition when required. A function removed from the request altogether will be unavailable when a shopper finally asks a question that needs it. [2]

Advertisements

Write the description a customer would need

Kukic points to the BM25 variant, identified as tool_search_tool_bm25_20251119, for plain-language searches. Anthropic also documents a regex variant for pattern matching. Both can search tool names, descriptions, argument names and argument descriptions. The fictional retailer might call its internal return service RMA. A catalog entry described only as an RMA status lookup gives the search less to work with when a shopper asks if the warehouse received the shoes they sent back. [1] [2]

The description should explain that the operation reads a warehouse receipt for an existing return, identify the required reference and state what the lookup can report. The outbound parcel lookup needs an equally clear description of its own purpose. Each entry should use the customer terms relevant to that operation. Repeating “order, package, returns, shipping” across every description would make the functions harder to distinguish during search. A common prefix can still organize related functions within a large catalog without making their descriptions interchangeable. [2] [3]

The setup is slightly different for a catalog exposed through Anthropic’s MCP connector. There the documentation places the deferral setting on the MCP toolset. A default can apply to the server’s tools, with per-tool configuration where needed. Someone copying an example for direct function definitions into a connector integration should check which object owns the setting. In either case, the practical test is whether the first request exposes the small working set the developer intended. [2]

Follow one return inquiry across two turns

The first test can supply a sample return reference and ask whether the warehouse received the package. With that specialized function deferred, Claude can request a match from the search service. The API returns tool references and expands the matches into definitions, with up to five matches returned by default. A matching definition makes the function available to the model. The application must still check which function Claude actually selects and whether its arguments correspond to the customer's request. [2]

The next turn should preserve the assistant's response content intact. Anthropic’s example carries the server search and its results forward, then adds the application tool result in a user message and sends the same catalog again. The application supplies the result of its own lookup. The server has already answered its own search call. Sending an application result for that call’s identifier will cause the API to reject the request. For a test, the return service can supply a known receipt from a fixture, so a changing shipment status will not confuse the comparison. Preserving the references also lets Claude use a discovered tool on a later turn without necessarily searching for it again. [2]

A follow-up tests whether the assistant can change direction. A shopper who asked about a warehouse receipt might next ask where the replacement parcel is, requiring an outbound shipping record. The developer should inspect the selection on both turns, since a correct first answer can conceal a mistaken second choice. An empty search does not necessarily indicate an outage: the documentation identifies an empty reference list as a valid result. The search terms and catalog descriptions deserve a check before the developer concludes that the service failed. [2]

Compare the same questions before and after

A small set of representative questions can compare the original and deferred configurations. The set should include routine order inquiries, rare return lookups, ambiguous requests and a task the desk cannot fulfill. For each, the record should capture the selected function, agreement with the test record, the number of searches and input usage. Anthropic counts loaded definitions as input tokens, so a low starting count can overstate the savings when a conversation eventually requires much of the catalog. [2]

Transcripts of a routine shipment inquiry and a rare return should accompany the averages. A warehouse question routed to outbound shipping calls for a closer look at how the descriptions distinguish returned packages. A routine lookup that triggers a search almost every time may belong back in the initial set. The developer can rerun the same examples after making that change, recording elapsed time alongside tokens. When both configurations return the correct warehouse receipt, their measured cost and response time provide a basis for deciding whether to keep the definition deferred.

Sources

[1] Ado Kukic’s tool search walkthrough

[2] Anthropic developer documentation for tool search

[3] Anthropic on defining tools

[4] Official embed of the original announcement

Advertisements

Have a correction or a useful perspective?
Get in touch with the publication.