📊create-chart
- プラグイン
- amplitude
- ソース
- GitHub で見る ↗
説明
Amplitudeのチャートを自然言語の説明から作成します。イベントの選択、フィルター、グルーピング、可視化の種類の選択などを処理します。 次のような場合に使用: 何を計測したいかは分かっているが、手動でチャートを構築するのが煩わしい場合。
原文を表示
Creates Amplitude charts from natural language descriptions, handling event selection, filters, groupings, and visualization choices. Use when you know what you want to measure but prefer not to build the chart manually.
ユースケース
- ✓Amplitudeのチャートを自然言語から作成するとき
- ✓イベント選択やフィルター設定を自動化したいとき
- ✓グルーピングや可視化の種類を指定するとき
- ✓手動でのチャート構築を短縮したいとき
本文(日本語訳)
Amplitude チャートの作成
自然言語からチャートを作成します。イベントの探索、チャート定義の構築、結果の検証を行います。
最初に計画を立てる(重要)
ツールを呼び出す前に、リクエストを分解して整理します。
1. チャートの構成要素を特定する:
- チャートの種類とメトリクス(何を計測するか)
- 時間範囲(指定がない場合のデフォルト: 直近30日)
- 主要イベント(カウント対象のアクション)
- セグメント条件(ユーザーフィルター / グループ)
- フィルター、グルーピング、ブレークダウン
- ファネルのステップ(コンバージョン分析の場合)
2. イベント検索の計画を立てる:
- 異なるイベントの概念ごとに1回ずつ検索する
- 複数の概念を1回の検索にまとめない
- 例: 「purchase(購入)」と「signup(登録)」は別々に検索する
3. 並列ツール呼び出しを計画する:
- コンテキストの取得、イベントの検索、コホートの検索は同時に実行できる
- 定義を構築する前に結果を待つ
イベントの探索(重要: 探索を最優先に)
重要: 絞り込む前に広くネットを張る
ユーザーのリクエストが曖昧だったり、複数のイベントに該当し得る場合:
- まず広く検索し、関連する選択肢を探す
- 関連する結果を確認し、関連イベント・カスタムイベント・メタイベントを探す
- 選択肢をユーザーに提示するか、選択理由を説明する
- 探索せずに単一のイベントだけが正解だと思い込まない
イベントの検索:
Amplitude:search で entity_types=['EVENT', 'CUSTOM_EVENT'] を指定
- 1回に1つの概念だけ検索する
- まず広い検索ワードを使う(例: 「AI」だけを検索し、「AI chat」に絞り込まない)
- ✓ 良い例: 「user completes purchase(ユーザーが購入を完了する)」
- ✗ 悪い例: 「signup or purchase events(登録または購入イベント)」
情報を収集したうえで判断し、説明を加える:
- 広く検索してすべての選択肢を把握する
- 結果を確認し、最も網羅的かつ正確なアプローチを特定する
- 最善の判断を下す(単一イベントより集約済みのカスタムイベントを優先する)
- 必ず説明を加える: 「X、Y、Z という選択肢が見つかりました。[理由] のため [X] を選択しました。この選択は [スコープ] を含む / 除外します。」
- 選択が誤りであればユーザーが修正できる
判断基準:
- 関連するアクティビティを集約したカスタムイベントを優先する(例: 「[2026] Activation Metric [AI events only]」)
- 集約イベントが存在しない場合は、主要なインタラクションイベントを選択する
- 対象の製品領域において「アクティブユーザー」が通常何を意味するかを考慮する
- ユーザーが範囲を指定しない限り、デフォルトで広いスコープを選択する
具体例:
- ❌ 悪い例: ユーザーが「週間AIユーザー数」を尋ねる → 探索も説明もせず、即座に「ai-chat: send message」を選択する
- ✅ 良い例: ユーザーが「週間AIユーザー数」を尋ねる → 「AI」を検索し、Ask AI・Agents・Visibility・カスタム集約イベントを発見する。回答: 「Ask AI、Agents、Visibility にまたがる AI アクティビティが見つかりました。すべての AI 製品インタラクションを含む '[2026] Activation Metric [AI events only]' カスタムイベントを使用します。これにより、全機能にわたる AI ユーザーの合計数を把握できます。特定の AI 製品に絞りたい場合はお知らせください。」
使用前に確認する:
- 対象イベントを使用している既存のチャートを検索する
- イベントに実際のデータ量があることを確認する(ゼロや古いデータでないか)
- 関連するアクティビティを集約したカスタムイベントを探す
- 結果がゼロの場合は代替イベントを検索する
プロパティの取得:
Amplitude:get_event_properties で正確なプロパティ名と値を取得
コホートの検索:
Amplitude:search で entity_types=['COHORT'] を指定
Amplitude:get_cohorts で完全な定義を取得
チャートタイプの選択
| チャートタイプ | 次のような場合に使用 |
|---|---|
eventsSegmentation |
時系列でのイベント数・ユーザー数のカウント、トレンド分析、比較、KPI、ディストリビューション、プロパティ分析 |
funnels |
既知のシーケンスを伴う複数ステップのコンバージョン分析、ドロップオフ分析、特定イベント間の所要時間、コンバージョンまでの時間計測 |
retention |
ユーザーの再来訪行動、コホートリテンション曲線、チャーン分析 |
dataTableV2 |
表形式の比較、ランキング、多次元ブレークダウン |
customerJourney |
パス探索、ユーザーが辿る未知のパスの発見、コンバージョン済みユーザーとドロップオフユーザーのパス比較 |
sessions |
セッション時間、セッション頻度、ユーザーあたりの滞在時間、セッション長のディストリビューション |
クイックリファレンス
eventsSegmentation — 最も汎用性が高い。次の用途に使用:
uniquesメトリクスを使ったユーザー数のカウント(DAU、WAU、MAU)- イベント合計数、プロパティの平均値・合計値
- パーセンタイル、ディストリビューション、フォーミュラ
- ローリングウィンドウを使った時系列データ
集計スコープ(eventsSegmentation):
PROPSUM(A)/metric: "sums"= すべてのイベントにわたるグローバルな合計metric: "frequency"= ユーザーあたりのイベント数のディストリビューション(1回・2回・3回行ったユーザーがそれぞれ何人か)- 「ユーザーあたりのプロパティ合計のディストリビューション」を求める場合: Amplitude はこれを直接サポートしていません。イベント数のディストリビューションには
metric: "frequency"を使用するか、user_id でグルーピングして PROPSUM を使った dataTableV2 でエクスポートして外部で分析してください。
funnels — あらかじめ定義されたステップによるコンバージョン分析。次の用途に使用:
- 想定されるシーケンスが分かっている場合のステップごとのコンバージョン率
- 順序ありまたは順序なしのシーケンス
- コンバージョンまでの所要時間(イベント間の中央値)
- 除外イベント、コンバージョンウィンドウ
- 重複イベント: 任意の順序で複数のイベントを実行したユーザーを見つけるには、「any order(任意の順序)」でファネルを設定し、コンバージョンウィンドウをチャートの日付範囲に合わせる
- 注意: ユーザーが実際に辿るパスを探索したい場合は、
customerJourneyを使用する
retention — 再来訪行動の分析。次の用途に使用:
- N日リテンションまたはローリングリテンション曲線
- コホート分析(新規ユーザー vs 既存ユーザー)
- 開始イベント → 再来訪イベントのパターン
dataTableV2 — 表形式データ。次の用途に使用:
- ディメンション別のブレークダウン(国、プラットフォームなど)
- 表形式での複数メトリクス比較
customerJourney — パス探索と発見。次の用途に使用:
- ユーザーが実際に辿るパスの把握(ファネルの想定パスとは異なる場合)
- 特定のイベントから始まる・終わる、または2つのイベント間のパスの分析
- コンバージョン済みユーザーとドロップオフユーザーのパスの並べて比較
- 予期しないナビゲーションパターンや摩擦ポイントの発見
- パスの頻度、類似度、平均完了時間の探索
- 理想的なカスタマージャーニーと実際のユーザー行動とのギャップの把握
sessions — セッションベースのエンゲージメント指標。次の用途に使用:
- セッション時間の分析(平均長、滞在時間、ディストリビューション)
- セッション頻度(ユーザーあたりの平均セッション数、総セッション数)
- ユーザーあたりの滞在時間の推移
- セッション内のイベント数(セッションあたりの平均イベント数)
- ユーザーセグメント間のセッション行動の比較
特殊なメトリクス:
- ユーザー数:
metric: "uniques" - イベント数:
metric: "totals" - プロパティ合計:
group_byにプロパティを指定してmetric: "sums" - 比率 / パーセンテージ: サイズの異なるグループを比較する場合に使用
メタイベント:
_active: 任意のアクティブイベント(DAU、MAU)_new: 新規ユーザー(初回イベント)_any_revenue_event: 収益イベント
チャート定義の構造
コアパラメータ(全チャートタイプ共通):
{
"name": "わかりやすいチャートタイトル",
"projectId": "12345",
"definition": {
"app": "12345",
"type": "eventsSegmentation",
"params": {
"range": "Last 30 Days",
"events": [{
"event_type": "Purchase Completed",
"filters": [],
"group_by": []
}],
"metric": "uniques",
"countGroup": "User",
"interval": 1,
"segments": [{"conditions": []}]
}
}
}
主要パラメータ:
countGroup: "User"(ユニークユーザー数)または "Event"(イベント発生回数)interval: 1(日次)、7(週次)、30(月次)segments: ユーザーフィルター / グループ(空配列 = 全ユーザー)
イベントフィルター(インライン OR ロジック):
"filters": [{
"group_type": "User",
"subprop_key": "country",
"subprop_op": "is",
"subprop_type": "event",
"subprop_value": ["United States", "Canada"]
}]
ユーザーセグメント(条件は AND ロジック):
"segments": [{
"name": "Active Users",
"conditions": [{
"type": "property",
"group_type": "User",
"prop_type": "user",
"prop": "plan",
"op": "is",
"values": ["Pro", "Enterprise"]
}]
}]
コホートセグメント: コホートを検索してIDを取得し、以下のように指定します:
"segments": [{
"name": "My Cohort",
"conditions": [{
"type": "cohort",
"group_type": "User",
"cohort_id": "abc123",
"op": "is_in"
}]
}]
ワークフロー: チャートの作成
1. コンテキストを取得する:
Amplitude:get_context(projectId の取得に使用)
2. イベントを探索する(まず広く検索する):
Amplitude:search で各概念を個別に検索
- 最初は広い検索ワードを使う
- 関連イベント、カスタムイベント、コホートをすべて探す
- 選択する前にすべての結果を確認する
3. 評価して判断する:
- 発見したすべてのイベントとカスタムイベントを確認する
- 情報に基づいた判断を下す(集約イベントを優先する)
- 発見した内容と選択理由を明確に説明できるよう準備する
4. 類似チャートを探す(参考例として):
Amplitude:search で entity_types=['CHART
原文(English)を表示
Create Amplitude Chart
Create charts from natural language by discovering events, building chart definitions, and verifying results.
Planning First (Critical)
Before any tool calls, decompose the request:
1. Identify chart components:
- Chart type and metric (what's being measured)
- Time range (default: Last 30 Days if not specified)
- Primary event (the action being counted)
- Segment conditions (user filters/groups)
- Filters, groupings, breakdowns
- Funnel steps (if conversion analysis)
2. Plan event searches:
- ONE search per distinct event concept
- Never combine multiple concepts in one search
- Example: "purchase" and "signup" need separate searches
3. Plan parallel tool calls:
- Get context, search events, find cohorts can run together
- Wait for results before building definition
Event Discovery (Critical: Discovery First)
IMPORTANT: Cast a wide net before narrowing down
When the user's request is ambiguous or could map to multiple events:
- Search BROADLY first to discover relevant options
- Review relevant results - look for related events, custom events, meta events
- Present options to user OR explain your selection rationale
- Try not to assume a single event is the only answer without exploration
Search for events:
Amplitude:search with entity_types=['EVENT', 'CUSTOM_EVENT']
- Search ONE concept at a time
- Use broad search terms first (e.g., "AI" not just "AI chat")
- ✓ Good: "user completes purchase"
- ✗ Bad: "signup or purchase events"
Make informed decisions, then explain:
- Search broadly to discover all options
- Review results and identify the most comprehensive/accurate approach
- Make your best judgment call (prefer aggregated custom events over single events)
- Always explain: "I found X, Y, Z options. I chose [X] because [reason]. This includes/excludes [scope]."
- User can correct if your assumption was wrong
Decision criteria:
- Prefer custom events that aggregate related activity (e.g., "[2026] Activation Metric [AI events only]")
- If no aggregated event exists, choose the primary interaction event
- Consider what "active user" typically means for that product area
- Default to broader scope unless user specifies narrow focus
Examples:
- ❌ BAD: User asks "weekly AI users" → immediately pick "ai-chat: send message" without exploring, no explanation
- ✅ GOOD: User asks "weekly AI users" → search "AI", find Ask AI, Agents, Visibility, custom aggregated event. Respond: "I found AI activity across Ask AI, Agents, and Visibility. I'm using the '[2026] Activation Metric [AI events only]' custom event which includes all AI product interactions. This gives you total AI users across all features. Let me know if you want to focus on a specific AI product instead."
Verify before use:
- Get existing charts using the event via search
- Check event has actual volume (not zero/stale)
- Look for custom events that aggregate related activity
- If zero results, search for alternatives
Get properties:
Amplitude:get_event_properties for exact property names/values
Find cohorts:
Amplitude:search with entity_types=['COHORT']
Amplitude:get_cohorts to get full definitions
Chart Type Selection
| Chart Type | Use When |
|---|---|
eventsSegmentation |
Counting events/users over time, trends, comparisons, KPIs, distributions, property analytics |
funnels |
Multi-step conversion analysis with a known sequence, drop-off analysis, time between specific events, time-to-convert metrics |
retention |
User return behavior, cohort retention curves, churn analysis |
dataTableV2 |
Tabular comparisons, rankings, multi-dimensional breakdowns |
customerJourney |
Path exploration, discovering unknown paths users take, comparing converted vs dropped-off paths |
sessions |
Session duration, session frequency, time spent per user, session length distributions |
Quick Reference
eventsSegmentation - Most versatile. Use for:
- User counts (DAU, WAU, MAU) with
uniquesmetric - Event totals, averages, sums of properties
- Percentiles, distributions, formulas
- Time series with rolling windows
Aggregation Scope (eventsSegmentation):
PROPSUM(A)/metric: "sums"= Global sum across ALL eventsmetric: "frequency"= Distribution of per-user event counts (how many users did it 1x, 2x, 3x)- For "distribution of property sum per user": Amplitude does not support this directly. Use
metric: "frequency"for event count distributions, or use dataTableV2 grouped by user_id with PROPSUM, then export for external analysis.
funnels - Conversion analysis with predefined steps. Use for:
- Step-by-step conversion rates when you know the expected sequence
- Ordered or unordered sequences
- Time-to-convert (median time between events)
- Exclusion events, conversion windows
- Overlapping events: To find users who performed multiple events (in any order), use a funnel with "any order" and set the conversion window to match the chart date range
- Note: If you want to discover what paths users take, use
customerJourneyinstead
retention - Return behavior. Use for:
- N-day or rolling retention curves
- Cohort analysis (new vs returning users)
- Start event → Return event patterns
dataTableV2 - Tabular data. Use for:
- Breakdowns by dimensions (country, platform, etc.)
- Multi-metric comparisons in table format
customerJourney - Path exploration and discovery. Use for:
- Understanding the actual paths users take (vs. expected paths in funnels)
- Analyzing paths starting with, ending with, or between two specific events
- Comparing converted vs dropped-off user paths side by side
- Discovering unexpected navigation patterns or friction points
- Exploring path frequency, similarity, or average time to complete
- Bridging the gap between ideal customer journeys and actual user behavior
sessions - Session-based engagement metrics. Use for:
- Session duration analysis (average length, time spent, distributions)
- Session frequency (average sessions per user, total sessions)
- Time spent per user over time
- Events performed within sessions (average events per session)
- Comparing session behavior across user segments
Special metrics:
- User counts:
metric: "uniques" - Event counts:
metric: "totals" - Property sums:
metric: "sums"with property ingroup_by - Rates/percentages: Use when comparing groups of different sizes
Meta events:
_active: Any active event (DAU, MAU)_new: New users (first-time event)_any_revenue_event: Revenue events
Chart Definition Structure
Core parameters (all chart types):
{
"name": "Descriptive Chart Title",
"projectId": "12345",
"definition": {
"app": "12345",
"type": "eventsSegmentation",
"params": {
"range": "Last 30 Days",
"events": [{
"event_type": "Purchase Completed",
"filters": [],
"group_by": []
}],
"metric": "uniques",
"countGroup": "User",
"interval": 1,
"segments": [{"conditions": []}]
}
}
}
Key parameters:
countGroup: "User" (unique users) or "Event" (event occurrences)interval: 1 (daily), 7 (weekly), 30 (monthly)segments: User filters/groups (empty array = all users)
Event filters (inline OR logic):
"filters": [{
"group_type": "User",
"subprop_key": "country",
"subprop_op": "is",
"subprop_type": "event",
"subprop_value": ["United States", "Canada"]
}]
User segments (conditions AND logic):
"segments": [{
"name": "Active Users",
"conditions": [{
"type": "property",
"group_type": "User",
"prop_type": "user",
"prop": "plan",
"op": "is",
"values": ["Pro", "Enterprise"]
}]
}]
Cohort segments: Search for cohort, get ID, then:
"segments": [{
"name": "My Cohort",
"conditions": [{
"type": "cohort",
"group_type": "User",
"cohort_id": "abc123",
"op": "is_in"
}]
}]
Workflow: Create Chart
- Get context:
Amplitude:get_context (for projectId)
- Discover events (BROAD search first):
Amplitude:search for each distinct concept
- Use broad search terms initially
- Look for all related events, custom events, cohorts
- Review ALL results before selecting
- Evaluate and decide:
- Review all discovered events and custom events
- Make informed decision (prefer aggregated events)
- Prepare clear explanation of what you found and your choice
- Find similar charts (see examples):
Amplitude:search entity_types=['CHART'] query="similar concept"
Amplitude:get_charts to see definition structure
- Get properties if needed:
Amplitude:get_event_properties
- Build definition using discovered names
- Explain event selection rationale in response
- Create chart:
Amplitude:query_dataset with full definition
-
Verify results - check data makes sense
-
Save chart:
Amplitude:save_chart_edits with editId from query_dataset
Error Handling
If query_dataset fails:
- Read error message carefully
- Common issues: incorrect event names, invalid filters, wrong parameter types
- Fix definition and retry
- Verify events exist via search first
If zero results:
- Check filters aren't too restrictive
- Verify event has data (search for charts using it)
- Try broader time range
- Check segment conditions
Best Practices
Naming:
- Include metric + time context: "Weekly Active Users Last 90 Days"
- Not: "WAU" or "Users"
Time ranges:
- Default to "Last 30 Days"
- Use inclusive ranges for specific periods
- State interpreted range explicitly
Verification:
- Always verify event exists before using
- Check similar charts to understand event usage
- Confirm properties with get_event_properties
Comparisons:
- Use segments for comparing user groups on same chart
- Use rates/percentages for different-sized groups
Always include:
- Chart URL in response
- What the chart shows
- Key insights from initial data
- Methodology used
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。