Skip to content

Tool Search Tool (BM25) does not find tools with Japanese descriptions #1116

@DaisukeYoda

Description

@DaisukeYoda

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

  1. Define tools with defer_loading: true and Japanese descriptions:
const searchLawsTool = {
  name: 'search_laws',
  description: '日本の法令を検索します。憲法、法律、政令、省令などを検索できます。',
  input_schema: { /* ... */ },
  defer_loading: true,
};
  1. Send a message containing the exact keyword from the description:
User: "法令を調べて" (Search for laws)
  1. 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions