Agent Wealth HubFree public resources
中文 EN العربية

Back to catalog / Agent workflows

Load large tool catalogs only when needed

Reduce prompt overhead by starting with a tool-description lookup and loading only the selected tool definitions.

Goal

Reduce prompt overhead by starting with a tool-description lookup and loading only the selected tool definitions.

Steps

  1. Start each request with a describe_tool lookup and a compact list of available tool names. [source04]
  2. When selected, return a tool_reference and append that definition with defer_loading=True to the active tool list. [source04]
  3. Keep a per-request loaded_tools set and test that a second lookup does not duplicate definitions or alter unrelated tools. [source04]

How to verify

Request the same deferred tool twice; confirm its definition appears once in the active request and unrelated tool schemas remain byte-for-byte unchanged.

Troubleshooting

If the prompt grows with duplicate definitions, deduplicate by stable tool name in the per-request loaded_tools set and reset that set for the next request.

Permissions

Prerequisites

Permissions

Limitations

Model output may be incomplete or wrong; API and beta behavior can change, so verify against the pinned source and current service behavior.

Pinned upstream source

https://github.com/anthropics/anthropic-cookbook/blob/9c1e493ddd2b82df399d2a61b9c806c539e18be6/tool_use/tool_search_alternate_approaches.ipynb

Repository
anthropics/anthropic-cookbook
File path
tool_use/tool_search_alternate_approaches.ipynb
Pinned commit
9c1e493ddd2b82df399d2a61b9c806c539e18be6
Source checked
2026-10-14 · Reviewed against the pinned upstream source

Repository metrics

These values describe the upstream repository, not popularity or likes for an individual skill or playbook.

Stars
Not collected
Forks
Not collected
Observed at
Not collected

No metrics snapshot is available yet.

License: MIT

Main topic

Take a coding Agent change from context to verification

Related resources