exploring-mcp-tool-quality
できること
このスキルは、MCPサーバーのツールの品質を報告します。エラー率、応答速度、各ツールが到達したユーザー数やセッション数を含みます。MCPサーバーを運用し、どのツールを直す必要があるかを知りたいチーム向けです。
使う場面
- ✓エラー率が最も高いMCPツールを知りたいとき。
- ✓最も遅いMCPツールを見つけたいとき。
- ✓特定の1つのツールの品質の要約がほしいとき。
スキルのリンク
https://github.com/PostHog/posthog/blob/master/products/mcp_analytics/skills/exploring-mcp-tool-quality/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“どのMCPツールが最も頻繁に失敗していますか?最も遅いツールはどれですか?”
毎週5つの新しいスキル。1分で読めます。
仕組み
期間にわたって、各ツールの呼び出し数、エラー、応答時間、ユーザー、セッションを報告する型付きのツールを実行します。また、日ごとの傾向と、最も多いエラーメッセージも示します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Exploring MCP tool quality
Any MCP server instrumented with PostHog's MCP analytics SDK emits a
$mcp_tool_call event on the shared events table every time an agent invokes a
tool. There is no dedicated ClickHouse table — every field lives as a
$mcp_* property on events, and every tool-quality metric (error rate, latency
percentiles, reach) is an aggregation over this one event. This is the data
behind the MCP analytics dashboard and tool-quality screens.
Governed metric first
For any MCP failure-rate headline, call posthog:metric-list before a typed tool or SQL recipe and look for mcp_tool_call_fail_pct. If it is approved and not drifted, run it with posthog:data-catalog-metric-run and use that result as the canonical headline. When the user also asks which tools drive failures, run the headline first, then use the workflows below for the breakdown and label that breakdown noncanonical. If no governed metric matches, state that the catalog has no match and label the derived rate noncanonical.
For a single tool, prefer the typed tools — posthog:query-mcp-tool-stats (calls,
errors, p50/p95, users, sessions, intents), posthog:query-mcp-tool-failures (top error
messages by harness), and posthog:query-mcp-tool-daily-stats (day-by-day trend). Each
takes a toolName + dateRange, runs the same query runner as the tool-detail
UI — no hand-written SQL needed.
HogQL via posthog:execute-sql is the path for cross-tool questions — the
"which tool errors most" ranking below has no typed tool, so rank with SQL, then
drill into the worst tool with posthog:query-mcp-tool-stats and
posthog:query-mcp-tool-failures. The full
property schema and the established query recipes live in the shared MCP data
reference:
products/posthog_ai/skills/querying-posthog-data/references/models-mcp.md.
That reference is the single source of truth for the $mcp_* schema and the
effective-tool-name idiom used below — this skill inlines only the noncanonical
"which tool errors most" breakdown for convenience; pull the matrix, latency, and
harness recipes from the reference rather than re-deriving them. Read it before
writing queries.
The two rules that matter most
Always use the effective tool name. New-SDK events wrap the real tool in a single-exec call, so grouping on raw
$mcp_tool_namecollapses everything under the wrapper. Use:coalesce(nullIf(toString(properties.$mcp_exec_tool_call_name), ''), toString(properties.$mcp_tool_name))Always read
$mcp_is_errorviatoBool(...)and cast$mcp_duration_msviatoFloat(...). The properties are strings.
Always set a time range — these queries scan events otherwise.
Workflow: which tool has the highest error rate (noncanonical breakdown)
For the "which tool errors most" breakdown, rank tools by error
rate, but guard against small-sample noise with a HAVING floor on call volume:
posthog:execute-sql
SELECT
coalesce(nullIf(toString(properties.$mcp_exec_tool_call_name), ''), toString(properties.$mcp_tool_name)) AS tool,
count() AS total_calls,
countIf(toBool(properties.$mcp_is_error)) AS errors,
round(countIf(toBool(properties.$mcp_is_error)) * 100.0 / count(), 1) AS error_rate_pct
FROM events
WHERE event = '$mcp_tool_call'
AND coalesce(nullIf(toString(properties.$mcp_exec_tool_call_name), ''), toString(properties.$mcp_tool_name)) != ''
AND timestamp >= now() - INTERVAL 30 DAY
GROUP BY tool
HAVING total_calls >= 20
ORDER BY error_rate_pct DESC, total_calls DESC
LIMIT 20
Report both rate and volume — a 100% error rate over 3 calls is rarely the
real story; a 12% rate over 50,000 calls is. Offer to pull the top
$mcp_error_message values for the worst tool (see below).
Workflow: tool-quality matrix
One row per tool with error rate, latency percentiles, and reach — mirrors the tool-quality screen. The ready-to-run query is in models-mcp.md under "Tool-quality matrix".
Workflow: why is a tool failing
For one tool's top failure buckets (grouped by harness), call
posthog:query-mcp-tool-failures with the toolName — it's the typed equivalent of the
query below. Failures come from the same source as the error rate: errored
$mcp_tool_call events ($mcp_is_error), scoped by the effective tool name. Fai
よくある質問
どの数字を報告しますか?
各ツールの呼び出し数、エラー、応答時間の中央値と95パーセンタイル、ユーザー数、セッション数を報告します。
失敗率は公式の数字ですか?
PostHogに失敗の承認済みの指標がある場合は、スキルはまずそれを使います。それ以外の内訳は、非公式であることを明記します。
データはどこから来ますか?
各MCPツールの呼び出しはイベントとして記録され、すべての品質の数字はそれらのイベントから計算されます。
詳細
作者による元の説明
Investigate the quality of PostHog MCP tool calls — error rates, latency, reach, and which tools are failing or slow. Use when the user asks "which MCP tool has the highest error rate?", "what's the slowest tool?", "which tools fail most often?", "how reliable is tool X?", wants a tool-quality matrix, or pastes an MCP analytics tool-quality / dashboard URL and asks what it shows.
repo: PostHog/posthog
人気
- GitHubのスター
- 41k
- ランキング
- #6892
- ライセンス
- —
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
depot-ci
41kエージェントが、GitHub Actionsの代替であるDepot CIのワークフローを設定し実行できるよう支援します。既存のワークフローの移行や、実行ログの確認も含みます。
depot-container-builds
41kエージェントが、Depotのリモート・ビルダーでDockerイメージを作れるよう支援します。マルチプラットフォームのイメージ、レジストリへのプッシュ、ビルド失敗の修正を含みます。
depot-github-runners
41kエージェントが、GitHub Actionsのジョブを Depot が管理するランナーに移し、ランナーのサイズとラベルを選び、ランナー設定の問題を解決できるよう支援します。
editing-agents-md
41kエージェントが、AGENTS.mdとCLAUDE.mdのどちらにルールを書くべきかを判断し、ファイルを膨らませずに守られやすい形で書けるよう支援します。
似ているスキル
mcporter
394kHTTPまたはstdioでMCPサーバーとそのツールを一覧表示、呼び出し、確認し、サインイン設定を管理するようエージェントを支援します。
fastmcp
260kPythonで、AIアシスタントがAPI、データベース、ファイルをツールとして利用できるMCPサーバーを作成、テスト、デプロイするのを支援します。
mcp-oauth-remote-gateway
260kHermesがサーバー上で動いている場合に、リモートのMCPサーバーのOAuthサインインを手動で完了させ、トークンを保存します。