-
Notifications
You must be signed in to change notification settings - Fork 437
Open
Description
Description
When using the Tool Search Tool (tool_search_tool_bm25_20251119) with tools that have Japanese descriptions, the BM25 search fails to find relevant tools even with exact keyword matches.
Environment
- Beta:
advanced-tool-use-2025-11-20 - Model:
claude-sonnet-4-5-20250929 - SDK:
@anthropic-ai/sdk(TypeScript)
Steps to Reproduce
- Define tools with
defer_loading: trueand Japanese descriptions:
const searchLawsTool = {
name: 'search_laws',
description: '日本の法令を検索します。憲法、法律、政令、省令などを検索できます。',
input_schema: { /* ... */ },
defer_loading: true,
};- Send a message containing the exact keyword from the description:
User: "法令を調べて" (Search for laws)
- The Tool Search Tool fails to find
search_laws, even though "法令" appears in the description.
Expected Behavior
The BM25 search should find search_laws since the query "法令" exactly matches the description "日本の法令を検索します".
Actual Behavior
The tool is not found. Claude responds that no relevant tools were found.
Workaround
Setting defer_loading: false for all tools makes them visible without search, but this defeats the purpose of the Tool Search Tool.
Hypothesis
BM25 may not properly tokenize Japanese text (no word boundaries like spaces in English), causing the search to fail.
Additional Context
- Tools with
defer_loading: false(always visible) work correctly - The same tools work fine when all set to
defer_loading: false - This appears to be a CJK (Chinese/Japanese/Korean) language tokenization issue
Metadata
Metadata
Assignees
Labels
No labels