claude-advanced-tool-use
1万以上のツール連携、トークン消費の最適化、本番環境でのツールシステム構築など、高度なツール利用を、検索やプログラム呼び出しを駆使して実現するSkill。
📜 元の英語説明(参考)
Advanced tool use patterns including tool search, programmatic calling, and production orchestration. Use when scaling to 10,000+ tools, optimizing token usage, or implementing production tool systems.
🇯🇵 日本人クリエイター向け解説
1万以上のツール連携、トークン消費の最適化、本番環境でのツールシステム構築など、高度なツール利用を、検索やプログラム呼び出しを駆使して実現するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o claude-advanced-tool-use.zip https://jpskill.com/download/9392.zip && unzip -o claude-advanced-tool-use.zip && rm claude-advanced-tool-use.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/9392.zip -OutFile "$d\claude-advanced-tool-use.zip"; Expand-Archive "$d\claude-advanced-tool-use.zip" -DestinationPath $d -Force; ri "$d\claude-advanced-tool-use.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
claude-advanced-tool-use.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
claude-advanced-tool-useフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
Claude 高度なツール利用
概要
高度なツール利用は、本番システムの明確なボトルネックに対処する3つの補完的な機能を提供します。これらの機能は、個別に利用することも、組み合わせることで37〜85%の効率向上を実現することもできます。
3つの機能
1. ツール検索 (85-95%のコンテキスト節約)
- 必要に応じてツールを動的に発見し、ロードします
- コンテキストの肥大化なしに10,000以上のツールにスケールします
- 2つのバリアント: 正規表現パターンマッチングまたは BM25 自然言語クエリ
- 遅延ロードにより、ツールの定義は必要になるまでコンテキストから除外されます
2. プログラムによるツール呼び出し (37%のトークン削減)
- Claude は、サンドボックス化されたコンテナ内でツールを呼び出す Python コードを記述します
- 中間結果はコンテキストウィンドウから除外されます
- 複雑なワークフローで19回以上の不要な推論パスを排除します
- データ集約、フィルタリング、およびマルチステップオーケストレーションに最適です
3. ツール利用例 (72% → 90% の精度)
- 具体的な使用例は、曖昧な JSON スキーマを明確にします
- パラメータ処理の精度を向上させます
- API の規約をスキーマで表現できない場合に表現します
- オプションのパラメータに関するハルシネーションを削減します
重要な洞察: 最大のボトルネックから始め、必要に応じて補完的な機能を追加します。全てを一度に行う必要はありません。
機能比較マトリックス
| 機能 | トークン節約 | 最適な用途 | 複雑さ | ベータヘッダー |
|---|---|---|---|---|
| ツール検索 | 85-95% | 大規模なツールセット (10個以上のツール) | 低 | advanced-tool-use-2025-11-20 |
| プログラムによる呼び出し | 37% | マルチステップワークフロー (3つ以上の依存する呼び出し) | 中 | advanced-tool-use-2025-11-20 |
| ツール利用例 | 精度 (72%→90%) | 複雑なパラメータ、オプションのフィールド | 低 | N/A |
どのような時に使うか
ツール検索:
- システムに10個以上のツールがある場合
- ツールの定義が合計で10Kトークンを超える場合
- 大規模なセットでツールの選択精度が低下する場合
- MCP サーバー (サーバー全体で200個以上のツール) を使用している場合
- ツールライブラリが時間とともに増加する場合
プログラムによる呼び出し:
- 3つ以上の依存するツール呼び出しを含むワークフロー
- 要約のみが必要な大規模なデータセットの処理
- 複数のアイテムにわたるバッチ処理
- 中間結果に基づく条件付きロジック
- 複数のデータソースを組み合わせる集約タスク
ツール利用例:
- JSON スキーマがオプションのパラメータをいつ使用するかをキャプチャしない場合
- API の規約を明確にする必要がある場合
- パラメータ処理の精度が80%未満の場合
- 複雑なツール入力に関するハルシネーションを削減する場合
本番パターン:
- スケーラブルなエージェントシステムの構築
- セキュリティを優先したツールオーケストレーションの実装
- 本番環境でのトークンコストの最適化
- 複数のツールを効率的に連携させる
クイックスタート: 遅延ロードによるツール検索
Python の例:
import anthropic
client = anthropic.Anthropic()
tools = [
# 常にロード: ツール検索自体
{
"type": "tool_search_tool_regex_20251119",
"name": "tool_search_tool_regex"
},
# 常にロード: 頻繁に使用されるツール (合計3〜5個)
{
"name": "get_user_info",
"description": "ID でユーザー情報を取得",
"input_schema": {
"type": "object",
"properties": {
"user_id": {"type": "string"}
}
}
},
# 遅延: 必要に応じてロードされる特殊なツール
{
"name": "get_weather",
"description": "場所の現在の天候を取得",
"input_schema": {
"type": "object",
"properties": {
"location": {"type": "string"}
}
},
"defer_loading": True
},
{
"name": "get_forecast",
"description": "場所と日数の天気予報を取得",
"input_schema": {
"type": "object",
"properties": {
"location": {"type": "string"},
"days": {"type": "integer"}
}
},
"defer_loading": True
}
]
response = client.beta.messages.create(
model="claude-sonnet-4-5-20250929",
betas=["advanced-tool-use-2025-11-20"],
max_tokens=2048,
messages=[{
"role": "user",
"content": "サンフランシスコの天気はどうですか?"
}],
tools=tools
)
print(response.content[0].text)
何が起こるか:
- Claude はリクエストを分析し、天気ツールが必要であると判断します
- パターン
"weather"でtool_search_tool_regexを使用します - API は、一致するツールを指す
tool_referenceブロックを返します - ツールの定義が自動的に展開されます
- Claude は適切なパラメータで
get_weatherを呼び出します - 発見されたツールのみがコンテキストにロードされます (85% の節約)
複合効果
これらの機能を戦略的に組み合わせると、効率の向上が倍増します。
例: 大規模な MCP システム
- MCP サーバー経由で200以上のツール
- ツール検索: コンテキストを85%削減 (10Kトークン → 1.5Kトークン)
- プログラムによる呼び出し: ワークフローのトークンを37%削減
- ツール利用例: 精度を72%から90%に向上
- 複合的な影響: ~90%のトークン削減 + 18%の精度向上
実装戦略:
- 定義が10Kトークンを超える場合は、ツール検索から開始します
- マルチステップワークフローには、プログラムによる呼び出しを追加します
- 複雑なパラメータを持つツールには、例を含めます
- 各ステップで効率の向上を測定します
- ボトルネック分析に基づいて反復処理を行います
本番アーキテクチャパターン
本番コードベース分析より (Source):
1. プランナー + エグゼキューター
- 計画の会話と実行を分離します
- プランナーは何をすべきかを決定し、エグゼキューターは焦点を絞ったコンテキストで実行します
- 再計画のオーバーヘッドを削減します
2. プレビューしてからフェッチ
- 最初に ID/サマリーを返します
- 必要に応じて完全なドキュメントをフェッチします
- コンテキストをリーンに保ちます
3. ガード + アクト
- 実行前にパラメータを検証します
- アクション可能なエラーによるサーバー側の検証
- セキュリティを優先したアプローチ
4. 出力を要約する
- 続行する前にツールの結果を圧縮します
- プログラムによる呼び出しとうまく連携します
- 要約のみがコンテキストウィンドウに入ります
詳細については、references/production-patterns.md を参照してください
(原文はここで切り詰められています)
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Claude Advanced Tool Use
Overview
Advanced tool use provides three complementary features that address distinct bottlenecks in production systems. These features can be used independently or combined for compounding efficiency gains of 37-85%.
The Three Features
1. Tool Search (85-95% context savings)
- Dynamically discover and load tools on-demand
- Scale to 10,000+ tools without context bloat
- Two variants: Regex pattern matching or BM25 natural language queries
- Deferred loading keeps tool definitions out of context until needed
2. Programmatic Tool Calling (37% token reduction)
- Claude writes Python code that calls your tools within a sandboxed container
- Intermediate results stay out of context window
- Eliminates 19+ unnecessary inference passes on complex workflows
- Ideal for data aggregation, filtering, and multi-step orchestration
3. Tool Use Examples (72% → 90% accuracy)
- Concrete usage examples clarify ambiguous JSON schemas
- Improve parameter handling accuracy
- Express API conventions schemas cannot capture
- Reduce hallucination on optional parameters
Key Insight: Start with your biggest bottleneck, then add complementary features as needed. Not all-or-nothing.
Feature Comparison Matrix
| Feature | Token Savings | Best For | Complexity | Beta Header |
|---|---|---|---|---|
| Tool Search | 85-95% | Large tool sets (10+ tools) | Low | advanced-tool-use-2025-11-20 |
| Programmatic Calling | 37% | Multi-step workflows (3+ dependent calls) | Medium | advanced-tool-use-2025-11-20 |
| Tool Examples | Accuracy (72%→90%) | Complex parameters, optional fields | Low | N/A |
When to Use
Tool Search:
- You have 10+ tools in your system
- Tool definitions exceed 10K tokens combined
- Tool selection accuracy degrades with large sets
- Using MCP servers (200+ tools across servers)
- Tool library grows over time
Programmatic Calling:
- Workflows with 3+ dependent tool calls
- Processing large datasets where only summaries needed
- Batch operations across multiple items
- Conditional logic based on intermediate results
- Aggregation tasks combining multiple data sources
Tool Use Examples:
- JSON schemas don't capture when to use optional parameters
- API conventions need clarification
- Parameter handling accuracy below 80%
- Reducing hallucination on complex tool inputs
Production Patterns:
- Building scalable agentic systems
- Implementing security-first tool orchestration
- Optimizing token costs in production
- Coordinating multiple tools efficiently
Quick Start: Tool Search with Deferred Loading
Python Example:
import anthropic
client = anthropic.Anthropic()
tools = [
# Always-loaded: tool search itself
{
"type": "tool_search_tool_regex_20251119",
"name": "tool_search_tool_regex"
},
# Always-loaded: frequently used tools (3-5 total)
{
"name": "get_user_info",
"description": "Get user information by ID",
"input_schema": {
"type": "object",
"properties": {
"user_id": {"type": "string"}
}
}
},
# Deferred: specialized tools loaded on-demand
{
"name": "get_weather",
"description": "Get current weather for a location",
"input_schema": {
"type": "object",
"properties": {
"location": {"type": "string"}
}
},
"defer_loading": True
},
{
"name": "get_forecast",
"description": "Get weather forecast for a location and days ahead",
"input_schema": {
"type": "object",
"properties": {
"location": {"type": "string"},
"days": {"type": "integer"}
}
},
"defer_loading": True
}
]
response = client.beta.messages.create(
model="claude-sonnet-4-5-20250929",
betas=["advanced-tool-use-2025-11-20"],
max_tokens=2048,
messages=[{
"role": "user",
"content": "What's the weather in San Francisco?"
}],
tools=tools
)
print(response.content[0].text)
What Happens:
- Claude analyzes request and determines weather tools are needed
- Uses tool_search_tool_regex with pattern
"weather" - API returns
tool_referenceblocks pointing to matching tools - Tool definitions automatically expanded
- Claude invokes
get_weatherwith appropriate parameters - Only discovered tools loaded into context (85% savings)
The Compound Effect
When combined strategically, these features multiply efficiency gains:
Example: Large MCP System
- 200+ tools via MCP servers
- Tool Search: Reduces context by 85% (10K tokens → 1.5K tokens)
- Programmatic Calling: Reduces workflow tokens by 37%
- Tool Examples: Improves accuracy from 72% to 90%
- Combined Impact: ~90% token reduction + 18% accuracy improvement
Implementation Strategy:
- Start with tool search if definitions exceed 10K tokens
- Add programmatic calling for multi-step workflows
- Include examples for tools with complex parameters
- Measure efficiency gains at each step
- Iterate based on bottleneck analysis
Production Architecture Patterns
From production codebase analysis (Source):
1. Planner + Executor
- Separate planning conversation from execution
- Planner decides what to do, executor does it with focused context
- Reduces re-planning overhead
2. Preview Then Fetch
- Return IDs/summaries first
- Fetch full documents on-demand
- Keeps context lean
3. Guard + Act
- Validate parameters before execution
- Server-side validation with actionable errors
- Security-first approach
4. Summarize Outputs
- Compress tool results before continuing
- Works well with programmatic calling
- Only summary enters context window
See references/production-patterns.md for complete implementation templates.
Performance Optimization
Identifying Your Bottleneck:
- Tool definitions > 10K tokens → Enable tool search
- Large intermediate datasets → Use programmatic calling
- Parameter confusion → Provide tool examples
- Multiple tool calls → Consider programmatic orchestration
Optimization Checklist:
- [ ] Tool descriptions under 200 characters
- [ ] Semantic keywords in descriptions
- [ ] 3-5 most-used tools always loaded
- [ ] Clear tool naming (e.g.,
search_customer_ordersnotquery_db) - [ ] Tool index cached in-session
- [ ] Ranked results returned
- [ ] Server-side validation enabled
- [ ] Tool results memoized where appropriate
- [ ] Security best practices implemented
- [ ] Observability logging with trace IDs
Integration with Context Management
Tool search and programmatic calling work seamlessly with context editing:
Tool Result Clearing (from claude-context-management):
- Server-side strategy removes older tool results chronologically
- Preserves recent N tool uses
- Can exclude specific tools (e.g., web_search)
- Works with deferred loading
Programmatic Calling (keeps results out of context):
- Tool results from code execution don't enter context window
- Only final outputs returned to Claude
- Natural synergy: fewer results + more efficient orchestration
Combined Example:
response = client.beta.messages.create(
model="claude-opus-4-5-20251101",
betas=["advanced-tool-use-2025-11-20", "context-management-2025-06-27"],
tools=tools_with_deferred_loading,
context_management={
"edits": [{
"type": "clear_tool_uses_20250919",
"trigger": {"type": "input_tokens", "value": 100000},
"keep": {"type": "tool_uses", "value": 3}
}]
},
messages=messages
)
Related Skills
- anthropic-expert: Basic tool use fundamentals, MCP integration, code execution tool
- claude-context-management: Server-side tool result clearing, token optimization
- claude-cost-optimization: Efficiency tracking, ROI measurement for tool optimizations
- claude-opus-4-5-guide: Model capabilities, effort parameter impact on tool use
References
For detailed implementation patterns, see:
references/tool-search-patterns.md: Complete tool search guide (regex + BM25 variants, deferred loading, MCP integration, 10K+ tool scalability)references/programmatic-tool-calling.md: Sandboxed execution patterns, allowed_callers parameter, token efficiency mechanisms, ideal use casesreferences/production-patterns.md: Architecture patterns from production codebases, security best practices, error handling, observabilityreferences/performance-optimization.md: Optimization strategies, caching patterns, latency reduction, efficiency metrics