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

Back to catalog / Agent tools

Use semantic retrieval to select tools from a large library

Embed tool descriptions locally and retrieve relevant capabilities for the current task through one narrow search tool.

Goal

Avoid loading hundreds of tool definitions into the model context at once.

Steps

  1. Prepare tool name, description, parameter JSON, and permission labels; index a readable representation. [tool-search]
  2. Follow the notebook with SentenceTransformer("all-MiniLM-L6-v2") for local embeddings and semantic top-k lookup. [tool-search]
  3. Pass candidates only to a permission-controlled executor; measure Precision@k and missed tools on a labeled set. [tool-search]

How to verify

Even with a large catalog, context contains only search and a few candidates; low-confidence results do not execute.

Troubleshooting

If semantic search misses exact tools, add name/keyword lookup or raise top-k, then remeasure precision.

Permissions

Prerequisites

Permissions

Limitations

The notebook’s embedding model runs locally; tool discovery grants no permission and is not an authorization boundary.

Pinned upstream source

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

Repository
anthropics/anthropic-cookbook
File path
tool_use/tool_search_with_embeddings.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

When to use a Skill or MCP

Related resources