Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(mcp): golden-question eval tasks for the data catalog (#69544)

Thiago Salvatore76c6c5ef0c16
diff --git a/services/mcp/evals/benchmark/schema.ts b/services/mcp/evals/benchmark/schema.ts
index 65001fc70cb8..dc918aec9d98 100644
--- a/services/mcp/evals/benchmark/schema.ts
+++ b/services/mcp/evals/benchmark/schema.ts
@@ -26,6 +26,7 @@ export const TASK_CATEGORIES = [
'project',
'mcp-analytics',
'metrics',
+ 'data-catalog',
] as const
export const BenchmarkProbeSchema = z.object({
@@ -71,3 +72,13 @@ export function loadBenchmark(path: string = DEFAULT_BENCHMARK_PATH): BenchmarkF
export function referencedTools(task: BenchmarkTask): string[] {
return [...new Set([...task.expected_tools, ...task.acceptable_tools, ...(task.probe ? [task.probe.tool] : [])])]
}
+
+/**
+ * Tools that MUST be advertised for a task to be runnable: the expected path
+ * plus any deterministic probe tool. `acceptable_tools` are optional
+ * alternatives — often feature-gated — so a missing one is not a benchmark
+ * failure and is deliberately excluded here.
+ */
+export function requiredTools(task: BenchmarkTask): string[] {
+ return [...new Set([...task.expected_tools, ...(task.probe ? [task.probe.tool] : [])])]
+}
diff --git a/services/mcp/evals/benchmark/tasks.yaml b/services/mcp/evals/benchmark/tasks.yaml
index deb3588a65d6..dbcac1446f52 100644
--- a/services/mcp/evals/benchmark/tasks.yaml
+++ b/services/mcp/evals/benchmark/tasks.yaml
@@ -277,3 +277,57 @@ tasks:
expected_tools: [metric-names-list, query-metrics]
acceptable_tools: [execute-sql]
success_criteria: 'Resolves the exact metric name first (names match exactly), then queries a rate over the last 24h — does not guess the metric name.'
+
+ # --- data-catalog -----------------------------------------------------------------------
+ # MCP-surface probe/agent tasks over the catalog. The end-to-end "does the agent trust the
+ # catalog" behavioral suite (seeded approved/proposed/drifted/empty arms, scorers + LLM judge)
+ # lives in products/data_catalog/evals/ (eval_governed_metrics, eval_semantic_discovery).
+ - id: data-catalog-use-canonical-mrr
+ category: data-catalog
+ intent: 'What was our MRR last month?'
+ expected_tools: [execute-sql]
+ acceptable_tools: [data-catalog-metric-run]
+ success_criteria: >
+ Checks system.information_schema.metrics for an approved, non-drifted MRR metric before
+ deriving the number. If one exists, runs it and cites it as the canonical definition; never
+ presents a proposed or drifted metric as canonical.
+ probe:
+ tool: execute-sql
+ args:
+ query: "SELECT name, status, is_drifted, definition_kind FROM system.information_schema.metrics WHERE name ILIKE '%mrr%' OR description ILIKE '%recurring revenue%'"
+
+ - id: data-catalog-check-before-deriving
+ category: data-catalog
+ intent: "What's our activation rate?"
+ expected_tools: [execute-sql]
+ success_criteria: >
+ Looks in the catalog (system.information_schema.metrics) for a canonical activation metric
+ before deriving one from scratch, and reports whether an approved one exists.
+ probe:
+ tool: execute-sql
+ args:
+ query: "SELECT name, status, is_drifted FROM system.information_schema.metrics WHERE name ILIKE '%activation%' OR description ILIKE '%activation%'"
+
+ - id: data-catalog-prefer-certified-source
+ category: data-catalog
+ intent: 'Which table should I use to report revenue?'
+ expected_tools: [execute-sql]
+ success_criteria: >
+ Uses the certification column on system.information_schema.tables to prefer a certified
+ revenue source and avoid deprecated ones, rather than picking an arbitrary similar table.
+ probe:
+ tool: execute-sql
+ args:
+ query: 'SELECT table_name, certification, description FROM system.information_schema.tables WHERE certification IS NOT NULL'
+
+ - id: data-catalog-never-cite-proposed
+ category: data-catalog
+ intent: 'Is there an official definition of churn I should use?'
+ expected_tools: [execute-sql]
+ success_criteria: >
+ Reports whether an approved (not proposed or drifted) churn metric exists in the catalog, and
+ does not present a proposed metric as if it were official.
+ probe:
+ tool: execute-sql
+ args:
+ query: "SELECT name, status, is_drifted FROM system.information_schema.metrics WHERE name ILIKE '%churn%' OR description ILIKE '%churn%'"
diff --git a/services/mcp/evals/runner/probe.ts b/services/mcp/evals/runner/probe.ts
index 6805a057697a..561b79318165 100644
--- a/services/mcp/evals/runner/probe.ts
+++ b/services/mcp/evals/runner/probe.ts
@@ -1,13 +1,15 @@
/**
* Deterministic probe runner — no LLM. Connects to a LIVE MCP server,
- * verifies every tool the benchmark references is advertised, executes each
- * task's read-only probe call, and prints/writes a score summary.
+ * verifies every required tool (the expected path + probe tool) is advertised,
+ * executes each task's read-only probe call, and prints/writes a score summary.
+ * Acceptable tools are optional alternatives (often feature-gated), so a missing
+ * one is not a failure.
*
* Usage:
* LIVE_MCP_URL=http://localhost:9876 LIVE_MCP_TOKEN=phx_... \
* pnpm exec tsx evals/runner/probe.ts [--out score.json]
*
- * Exit code is non-zero when any referenced tool is missing or any probe
+ * Exit code is non-zero when any required tool is missing or any probe
* fails, so the campaign (or CI) can gate on it directly.
*/
@@ -17,7 +19,7 @@ import { ErrorCode, McpError } from '@modelcontextprotocol/sdk/types.js'
import { writeFileSync } from 'node:fs'
import process from 'node:process'
-import { loadBenchmark, referencedTools, type BenchmarkTask } from '../benchmark/schema'
+import { loadBenchmark, referencedTools, requiredTools, type BenchmarkTask } from '../benchmark/schema'
import { formatSummary, summarize, type ProbeResult, type ToolMiss } from './results'
interface AdvertisedTool {
@@ -102,7 +104,7 @@ async function main(): Promise<void> {
)
const toolMisses: ToolMiss[] = benchmark.tasks.flatMap((task) =>
- referencedTools(task)
+ requiredTools(task)
.filter((tool) => !advertised.has(tool))
.map((tool) => ({ task_id: task.id, tool }))
)