exploring-mcp-tool-quality
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, and is gated behind the mcp-analytics flag — no hand-written SQL needed.