jpskill.com
🛠️ 開発・MCP コミュニティ

building-agent-tools

Guide for creating effective tools for AI agents. Use when building MCP tools, agent APIs, or any tool interface that agents will consume. Focuses on token efficiency, meaningful context, and proper namespacing.

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o building-agent-tools.zip https://jpskill.com/download/17664.zip && unzip -o building-agent-tools.zip && rm building-agent-tools.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/17664.zip -OutFile "$d\building-agent-tools.zip"; Expand-Archive "$d\building-agent-tools.zip" -DestinationPath $d -Force; ri "$d\building-agent-tools.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して building-agent-tools.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → building-agent-tools フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

AIエージェントのためのツール構築

ワークフロー

  1. 目的の定義

    • エージェントがこのツールで何を達成する必要があるかを特定します
    • 既存のツールを統合できるかどうかを判断します
    • エージェントが利用するためのツールのインターフェースを計画します
  2. インターフェースの設計

    • 説明的で名前空間化されたツール名を選択します
    • 明確な型と説明を持つパラメータを定義します
    • 最大限のシグナルと最小限のトークン数で出力形式を設計します
  3. 実装

    • トークン効率を念頭に置いて構築します
    • ページネーション、フィルタリング、適切なデフォルトを追加します
    • 生のIDではなく、セマンティックな識別子を返します
  4. 検証

    • 実際のエージェントのワークフローでテストします
    • トークン消費パターンを確認します
    • エラーメッセージがエージェントを解決策に導くことを検証します

設計原則

ツールの統合

  • ツールの数が多いほど良い結果につながるわけではありません
  • 関連する操作を単一のツールに結合します
  • 例:可用性を確認し、イベントを作成する schedule_event
  • 複数の呼び出しを必要とする単純な CRUD スタイルのツールは避けてください

名前空間

  • 関連するツールにはサービス名をプレフィックスとして付けます:asana_projects_searchasana_users_search
  • ドメインごとにグループ化して、エージェントが機能を区別できるようにします
  • ツールファミリー全体で一貫した命名パターンを使用します

意味のあるコンテキスト

  • 生のデータダンプではなく、高シグナル情報を返します
  • 判読不能な UUID を人間が読める識別子に解決します
  • 柔軟性のために response_format パラメータ(簡潔/詳細)を含めます
  • エージェントが次のステップに必要な関連メタデータを表示します

トークン効率

  • 適切なデフォルトでページネーションを実装します
  • 不要なデータを減らすためにフィルタリングパラメータを追加します
  • 大きなレスポンスをインテリジェントに切り捨てます
  • 冗長な散文よりも構造化された出力を優先します

ツールの説明

  • 明確で明示的な説明に多大な投資をします
  • ツールが何をするか、いつ使用するか、何を返すかを説明します
  • パラメータの制約と有効な値を含めます
  • 小さな説明の改善が大きなパフォーマンス向上につながります

アンチパターン

  • 統合された操作の代わりに、多くの細分化されたツールを作成する
  • エージェントが解釈できない生のIDを返す
  • 潜在的に大きな結果セットでページネーションを省略する
  • エージェントを推測させる曖昧なツールの説明
  • エージェントの回復を助けないエラーメッセージ
  • 一般的なワークフローでエージェントに複数の呼び出しを要求する

MCP 固有のパターン

ツールの登録

  • ツールスキーマで説明的な namedescription を使用します
  • パラメータの JSON Schema で inputSchema を定義します
  • 必須パラメータとオプションパラメータを明示的にマークします

レスポンス形式

  • 予測可能な解析のために構造化された JSON を返します
  • 成功/エラーインジケータを含めます
  • 実行可能なエラーメッセージを提供します
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Building Tools for AI Agents

Workflow

  1. Define Purpose

    • Identify what agents need to accomplish with this tool
    • Determine if existing tools can be consolidated
    • Plan the tool's interface for agent consumption
  2. Design Interface

    • Choose descriptive, namespaced tool names
    • Define parameters with clear types and descriptions
    • Design output format for maximum signal, minimum tokens
  3. Implement

    • Build with token efficiency in mind
    • Add pagination, filtering, sensible defaults
    • Return semantic identifiers, not raw IDs
  4. Validate

    • Test with real agent workflows
    • Check token consumption patterns
    • Verify error messages guide agents toward solutions

Design Principles

Tool Consolidation

  • More tools don't lead to better outcomes
  • Combine related operations into single tools
  • Example: schedule_event that checks availability AND creates event
  • Avoid simple CRUD-style tools that require multiple calls

Namespacing

  • Prefix related tools with service name: asana_projects_search, asana_users_search
  • Group by domain to help agents distinguish functionality
  • Use consistent naming patterns across tool families

Meaningful Context

  • Return high-signal information, not raw data dumps
  • Resolve cryptic UUIDs to human-readable identifiers
  • Include response_format parameter (concise/detailed) for flexibility
  • Surface relevant metadata agents need for next steps

Token Efficiency

  • Implement pagination with sensible defaults
  • Add filtering parameters to reduce unnecessary data
  • Truncate large responses intelligently
  • Prefer structured output over verbose prose

Tool Descriptions

  • Invest heavily in clear, explicit descriptions
  • Describe what the tool does, when to use it, and what it returns
  • Include parameter constraints and valid values
  • Small description improvements yield large performance gains

Anti-Patterns

  • Creating many granular tools instead of consolidated operations
  • Returning raw IDs that agents can't interpret
  • Omitting pagination on potentially large result sets
  • Vague tool descriptions that leave agents guessing
  • Error messages that don't help agents recover
  • Requiring agents to make multiple calls for common workflows

MCP-Specific Patterns

Tool Registration

  • Use descriptive name and description in tool schema
  • Define inputSchema with JSON Schema for parameters
  • Mark required vs optional parameters explicitly

Response Format

  • Return structured JSON for predictable parsing
  • Include success/error indicators
  • Provide actionable error messages