🛠️ ツールDesign
AIエージェントが効果的に活用できるツール
📺 まず動画で見る(YouTube)
▶ 【衝撃】最強のAIエージェント「Claude Code」の最新機能・使い方・プログラミングをAIで効率化する超実践術を解説! ↗
※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。
📜 元の英語説明(参考)
Build tools that agents can use effectively, including architectural reduction patterns. Use when creating new tools for agent systems, debugging tool-related failures or misuse, or optimizing existing tool sets for better agent performance.
🇯🇵 日本人クリエイター向け解説
AIエージェントが効果的に活用できるツール
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o tool-design.zip https://jpskill.com/download/3617.zip && unzip -o tool-design.zip && rm tool-design.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/3617.zip -OutFile "$d\tool-design.zip"; Expand-Archive "$d\tool-design.zip" -DestinationPath $d -Force; ri "$d\tool-design.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
tool-design.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
tool-designフォルダができる - 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-17
- 取得日時
- 2026-05-17
- 同梱ファイル
- 1
💬 こう話しかけるだけ — サンプルプロンプト
- › Tool Design を使って、最小構成のサンプルコードを示して
- › Tool Design の主な使い方と注意点を教えて
- › Tool Design を既存プロジェクトに組み込む方法を教えて
これをClaude Code に貼るだけで、このSkillが自動発動します。
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
[スキル名] ツール設計
このスキルを使用するタイミング
エージェントが効果的に使用できるツールを構築します。これには、アーキテクチャの削減パターンも含まれます。
エージェントが効果的に使用できるツール(アーキテクチャの削減パターンを含む)を構築する際に、このスキルを使用してください。
エージェントのためのツール設計
ツールは、エージェントが世界と対話するための主要なメカニズムです。ツールは、決定論的システムと非決定論的エージェント間の契約を定義します。開発者向けに設計された従来のソフトウェアAPIとは異なり、ツールAPIは、意図を推論し、パラメータ値を推測し、自然言語リクエストから呼び出しを生成する言語モデル向けに設計する必要があります。不適切なツール設計は、どんなプロンプトエンジニアリングでも修正できない失敗モードを生み出します。効果的なツール設計は、エージェントがツールをどのように認識し、使用するかを考慮した特定の原則に従います。
使用するタイミング
以下の状況でこのスキルをアクティブ化してください。
- エージェントシステム用の新しいツールを作成する場合
- ツール関連の障害や誤用をデバッグする場合
- エージェントのパフォーマンス向上のために既存のツールセットを最適化する場合
- ツールAPIをゼロから設計する場合
- エージェント統合のためにサードパーティツールを評価する場合
- コードベース全体でツールの慣例を標準化する場合
コアコンセプト
ツールは、決定論的システムと非決定論的エージェント間の契約です。統合の原則は、人間エンジニアが特定の状況でどのツールを使用すべきかを明確に判断できない場合、エージェントがそれよりも優れた判断をすることは期待できないと述べています。効果的なツール記述は、エージェントの行動を形成するプロンプトエンジニアリングです。
主な原則には、何をするか、いつ使うか、何を返すかを明確に説明する記述、完全性とトークン効率のバランスをとる応答形式、回復を可能にするエラーメッセージ、認知負荷を軽減する一貫した慣例が含まれます。
詳細なトピック
ツールとエージェントのインターフェース
契約としてのツール ツールは、決定論的システムと非決定論的エージェント間の契約です。人間がAPIを呼び出すとき、彼らは契約を理解し、適切なリクエストを行います。エージェントは、記述から契約を推測し、期待される形式に一致する呼び出しを生成する必要があります。
この根本的な違いにより、API設計の再考が必要です。契約は曖昧であってはならず、例は期待されるパターンを示す必要があり、エラーメッセージは修正を導く必要があります。ツール定義におけるすべての曖昧さは、潜在的な失敗モードとなります。
プロンプトとしてのツール記述 ツール記述はエージェントのコンテキストにロードされ、集合的に行動を誘導します。記述は単なるドキュメントではなく、エージェントがツールの使用についてどのように推論するかを形成するプロンプトエンジニアリングです。
「データベースを検索する」のような不適切な記述と不可解なパラメータ名は、エージェントに推測を強います。最適化された記述には、使用コンテキスト、例、およびデフォルトが含まれます。記述は、ツールが何をするか、いつ使用するか、そして何を生み出すかを答えます。
名前空間と組織 ツールコレクションが増えるにつれて、組織化が重要になります。名前空間は、関連するツールを共通のプレフィックスの下にグループ化し、エージェントが適切なタイミングで適切なツールを選択するのに役立ちます。
名前空間は、機能間に明確な境界を作成します。エージェントがデータベース情報を必要とするときは、データベースの名前空間にルーティングします。ウェブ検索が必要なときは、ウェブの名前空間にルーティングします。
統合の原則
単一の包括的なツール 統合の原則は、人間エンジニアが特定の状況でどのツールを使用すべきかを明確に判断できない場合、エージェントがそれよりも優れた判断をすることは期待できないと述べています。これにより、複数の狭いツールよりも単一の包括的なツールが好まれます。
list_users、list_events、create_event を実装する代わりに、空き状況を見つけてスケジュールする schedule_event を実装します。包括的なツールは、エージェントが複数の呼び出しを連鎖させる必要なく、ワークフロー全体を内部で処理します。
統合が機能する理由 エージェントは限られたコンテキストと注意力しか持っていません。コレクション内の各ツールは、ツール選択フェーズで注意を競い合います。各ツールは、コンテキスト予算を消費する記述トークンを追加します。機能の重複は、どのツールを使用すべきかについて曖昧さを生み出します。
統合は、冗長な記述を排除することでトークン消費を削減します。各ワークフローを1つのツールでカバーすることで曖昧さを排除します。効果的なツールセットを縮小することで、ツール選択の複雑さを軽減します。
統合しない場合 統合が常に正しいわけではありません。根本的に異なる動作を持つツールは分離したままにするべきです。異なるコンテキストで使用されるツールは分離することでメリットがあります。独立して呼び出される可能性のあるツールは、人為的にバンドルするべきではありません。
アーキテクチャの削減
統合の原則を論理的な極限まで推し進めると、アーキテクチャの削減、つまり、ほとんどの特殊なツールをプリミティブで汎用的な機能に置き換えることにつながります。本番環境での証拠は、このアプローチが洗練されたマルチツールアーキテクチャよりも優れたパフォーマンスを発揮することを示しています。
ファイルシステムエージェントパターン
データ探索、スキーマ検索、クエリ検証のためのカスタムツールを構築する代わりに、単一のコマンド実行ツールを介して直接ファイルシステムアクセスを提供します。エージェントは、標準のUnixユーティリティ(grep、cat、find、ls)を使用して、システムを探索、理解、操作します。
これが機能する理由は次のとおりです。
- ファイルシステムは、モデルが深く理解している実績のある抽象化です。
- 標準ツールは、予測可能で十分に文書化された動作をします。
- エージェントは、事前に定義されたワークフローに制約されることなく、プリミティブを柔軟に連鎖させることができます。
- ファイル内の優れたドキュメントは、要約ツールの必要性を置き換えます。
削減が複雑さを上回る場合 削減は次の場合に機能します。
- データ層が十分に文書化され、一貫した構造になっている場合
- モデルが複雑さをナビゲートするのに十分な推論能力を持っている場合
- 特殊なツールがモデルを有効にするのではなく、制約していた場合
- スキャフォールディングの維持に、成果の改善よりも多くの時間を費やしている場合
削減は次の場合に失敗します。
- 基盤となるデータが乱雑で、一貫性がなく、または十分に文書化されていない場合
- ドメインがモデルに欠けている専門知識を必要とする場合
-
(原文がここで切り詰められています)
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
When to Use This Skill
Build tools that agents can use effectively, including architectural reduction patterns
Use this skill when working with build tools that agents can use effectively, including architectural reduction patterns.
Tool Design for Agents
Tools are the primary mechanism through which agents interact with the world. They define the contract between deterministic systems and non-deterministic agents. Unlike traditional software APIs designed for developers, tool APIs must be designed for language models that reason about intent, infer parameter values, and generate calls from natural language requests. Poor tool design creates failure modes that no amount of prompt engineering can fix. Effective tool design follows specific principles that account for how agents perceive and use tools.
When to Use
Activate this skill when:
- Creating new tools for agent systems
- Debugging tool-related failures or misuse
- Optimizing existing tool sets for better agent performance
- Designing tool APIs from scratch
- Evaluating third-party tools for agent integration
- Standardizing tool conventions across a codebase
Core Concepts
Tools are contracts between deterministic systems and non-deterministic agents. The consolidation principle states that if a human engineer cannot definitively say which tool should be used in a given situation, an agent cannot be expected to do better. Effective tool descriptions are prompt engineering that shapes agent behavior.
Key principles include: clear descriptions that answer what, when, and what returns; response formats that balance completeness and token efficiency; error messages that enable recovery; and consistent conventions that reduce cognitive load.
Detailed Topics
The Tool-Agent Interface
Tools as Contracts Tools are contracts between deterministic systems and non-deterministic agents. When humans call APIs, they understand the contract and make appropriate requests. Agents must infer the contract from descriptions and generate calls that match expected formats.
This fundamental difference requires rethinking API design. The contract must be unambiguous, examples must illustrate expected patterns, and error messages must guide correction. Every ambiguity in tool definitions becomes a potential failure mode.
Tool Description as Prompt Tool descriptions are loaded into agent context and collectively steer behavior. The descriptions are not just documentation—they are prompt engineering that shapes how agents reason about tool use.
Poor descriptions like "Search the database" with cryptic parameter names force agents to guess. Optimized descriptions include usage context, examples, and defaults. The description answers: what the tool does, when to use it, and what it produces.
Namespacing and Organization As tool collections grow, organization becomes critical. Namespacing groups related tools under common prefixes, helping agents select appropriate tools at the right time.
Namespacing creates clear boundaries between functionality. When an agent needs database information, it routes to the database namespace. When it needs web search, it routes to web namespace.
The Consolidation Principle
Single Comprehensive Tools The consolidation principle states that if a human engineer cannot definitively say which tool should be used in a given situation, an agent cannot be expected to do better. This leads to a preference for single comprehensive tools over multiple narrow tools.
Instead of implementing list_users, list_events, and create_event, implement schedule_event that finds availability and schedules. The comprehensive tool handles the full workflow internally rather than requiring agents to chain multiple calls.
Why Consolidation Works Agents have limited context and attention. Each tool in the collection competes for attention in the tool selection phase. Each tool adds description tokens that consume context budget. Overlapping functionality creates ambiguity about which tool to use.
Consolidation reduces token consumption by eliminating redundant descriptions. It eliminates ambiguity by having one tool cover each workflow. It reduces tool selection complexity by shrinking the effective tool set.
When Not to Consolidate Consolidation is not universally correct. Tools with fundamentally different behaviors should remain separate. Tools used in different contexts benefit from separation. Tools that might be called independently should not be artificially bundled.
Architectural Reduction
The consolidation principle, taken to its logical extreme, leads to architectural reduction: removing most specialized tools in favor of primitive, general-purpose capabilities. Production evidence shows this approach can outperform sophisticated multi-tool architectures.
The File System Agent Pattern Instead of building custom tools for data exploration, schema lookup, and query validation, provide direct file system access through a single command execution tool. The agent uses standard Unix utilities (grep, cat, find, ls) to explore, understand, and operate on your system.
This works because:
- File systems are a proven abstraction that models understand deeply
- Standard tools have predictable, well-documented behavior
- The agent can chain primitives flexibly rather than being constrained to predefined workflows
- Good documentation in files replaces the need for summarization tools
When Reduction Outperforms Complexity Reduction works when:
- Your data layer is well-documented and consistently structured
- The model has sufficient reasoning capability to navigate complexity
- Your specialized tools were constraining rather than enabling the model
- You're spending more time maintaining scaffolding than improving outcomes
Reduction fails when:
- Your underlying data is messy, inconsistent, or poorly documented
- The domain requires specialized knowledge the model lacks
- Safety constraints require limiting what the agent can do
- Operations are truly complex and benefit from structured workflows
Stop Constraining Reasoning A common anti-pattern is building tools to "protect" the model from complexity. Pre-filtering context, constraining options, wrapping interactions in validation logic. These guardrails often become liabilities as models improve.
The question to ask: are your tools enabling new capabilities, or are they constraining reasoning the model could handle on its own?
Build for Future Models Models improve faster than tooling can keep up. An architecture optimized for today's model may be over-constrained for tomorrow's. Build minimal architectures that can benefit from model improvements rather than sophisticated architectures that lock in current limitations.
See Architectural Reduction Case Study for production evidence.
Tool Description Engineering
Description Structure Effective tool descriptions answer four questions:
What does the tool do? Clear, specific description of functionality. Avoid vague language like "helps with" or "can be used for." State exactly what the tool accomplishes.
When should it be used? Specific triggers and contexts. Include both direct triggers ("User asks about pricing") and indirect signals ("Need current market rates").
What inputs does it accept? Parameter descriptions with types, constraints, and defaults. Explain what each parameter controls.
What does it return? Output format and structure. Include examples of successful responses and error conditions.
Default Parameter Selection Defaults should reflect common use cases. They reduce agent burden by eliminating unnecessary parameter specification. They prevent errors from omitted parameters.
Response Format Optimization
Tool response size significantly impacts context usage. Implementing response format options gives agents control over verbosity.
Concise format returns essential fields only, appropriate for confirmation or basic information. Detailed format returns complete objects with all fields, appropriate when full context is needed for decisions.
Include guidance in tool descriptions about when to use each format. Agents learn to select appropriate formats based on task requirements.
Error Message Design
Error messages serve two audiences: developers debugging issues and agents recovering from failures. For agents, error messages must be actionable. They must tell the agent what went wrong and how to correct it.
Design error messages that enable recovery. For retryable errors, include retry guidance. For input errors, include corrected format. For missing data, include what's needed.
Tool Definition Schema
Use a consistent schema across all tools. Establish naming conventions: verb-noun pattern for tool names, consistent parameter names across tools, consistent return field names.
Tool Collection Design
Research shows tool description overlap causes model confusion. More tools do not always lead to better outcomes. A reasonable guideline is 10-20 tools for most applications. If more are needed, use namespacing to create logical groupings.
Implement mechanisms to help agents select the right tool: tool grouping, example-based selection, and hierarchy with umbrella tools that route to specialized sub-tools.
MCP Tool Naming Requirements
When using MCP (Model Context Protocol) tools, always use fully qualified tool names to avoid "tool not found" errors.
Format: ServerName:tool_name
# Correct: Fully qualified names
"Use the BigQuery:bigquery_schema tool to retrieve table schemas."
"Use the GitHub:create_issue tool to create issues."
# Incorrect: Unqualified names
"Use the bigquery_schema tool..." # May fail with multiple servers
Without the server prefix, agents may fail to locate tools, especially when multiple MCP servers are available. Establish naming conventions that include server context in all tool references.
Using Agents to Optimize Tools
Claude can optimize its own tools. When given a tool and observed failure modes, it diagnoses issues and suggests improvements. Production testing shows this approach achieves 40% reduction in task completion time by helping future agents avoid mistakes.
The Tool-Testing Agent Pattern:
def optimize_tool_description(tool_spec, failure_examples):
"""
Use an agent to analyze tool failures and improve descriptions.
Process:
1. Agent attempts to use tool across diverse tasks
2. Collect failure modes and friction points
3. Agent analyzes failures and proposes improvements
4. Test improved descriptions against same tasks
"""
prompt = f"""
Analyze this tool specification and the observed failures.
Tool: {tool_spec}
Failures observed:
{failure_examples}
Identify:
1. Why agents are failing with this tool
2. What information is missing from the description
3. What ambiguities cause incorrect usage
Propose an improved tool description that addresses these issues.
"""
return get_agent_response(prompt)
This creates a feedback loop: agents using tools generate failure data, which agents then use to improve tool descriptions, which reduces future failures.
Testing Tool Design
Evaluate tool designs against criteria: unambiguity, completeness, recoverability, efficiency, and consistency. Test tools by presenting representative agent requests and evaluating the resulting tool calls.
Practical Guidance
Anti-Patterns to Avoid
Vague descriptions: "Search the database for customer information" leaves too many questions unanswered.
Cryptic parameter names: Parameters named x, val, or param1 force agents to guess meaning.
Missing error handling: Tools that fail with generic errors provide no recovery guidance.
Inconsistent naming: Using id in some tools, identifier in others, and customer_id in some creates confusion.
Tool Selection Framework
When designing tool collections:
- Identify distinct workflows agents must accomplish
- Group related actions into comprehensive tools
- Ensure each tool has a clear, unambiguous purpose
- Document error cases and recovery paths
- Test with actual agent interactions
Examples
Example 1: Well-Designed Tool
def get_customer(customer_id: str, format: str = "concise"):
"""
Retrieve customer information by ID.
Use when:
- User asks about specific customer details
- Need customer context for decision-making
- Verifying customer identity
Args:
customer_id: Format "CUST-######" (e.g., "CUST-000001")
format: "concise" for key fields, "detailed" for complete record
Returns:
Customer object with requested fields
Errors:
NOT_FOUND: Customer ID not found
INVALID_FORMAT: ID must match CUST-###### pattern
"""
Example 2: Poor Tool Design
This example demonstrates several tool design anti-patterns:
def search(query):
"""Search the database."""
pass
Problems with this design:
- Vague name: "search" is ambiguous - search what, for what purpose?
- Missing parameters: What database? What format should query take?
- No return description: What does this function return? A list? A string? Error handling?
- No usage context: When should an agent use this versus other tools?
- No error handling: What happens if the database is unavailable?
Failure modes:
- Agents may call this tool when they should use a more specific tool
- Agents cannot determine correct query format
- Agents cannot interpret results
- Agents cannot recover from failures
Guidelines
- Write descriptions that answer what, when, and what returns
- Use consolidation to reduce ambiguity
- Implement response format options for token efficiency
- Design error messages for agent recovery
- Establish and follow consistent naming conventions
- Limit tool count and use namespacing for organization
- Test tool designs with actual agent interactions
- Iterate based on observed failure modes
- Question whether each tool enables or constrains the model
- Prefer primitive, general-purpose tools over specialized wrappers
- Invest in documentation quality over tooling sophistication
- Build minimal architectures that benefit from model improvements
Integration
This skill connects to:
- context-fundamentals - How tools interact with context
- multi-agent-patterns - Specialized tools per agent
- evaluation - Evaluating tool effectiveness
References
Internal references:
- Best Practices Reference - Detailed tool design guidelines
- Architectural Reduction Case Study - Production evidence for tool minimalism
Related skills in this collection:
- context-fundamentals - Tool context interactions
- evaluation - Tool testing patterns
External resources:
- MCP (Model Context Protocol) documentation
- Framework tool conventions
- API design best practices for agents
- Vercel d0 agent architecture case study
Skill Metadata
Created: 2025-12-20 Last Updated: 2025-12-23 Author: Agent Skills for Context Engineering Contributors Version: 1.1.0
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.