: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(logs): expose pattern mining as an MCP tool (#68924)
Jon McCallum858792cc0569
diff --git a/products/logs/mcp/prompts/logs-patterns.md b/products/logs/mcp/prompts/logs-patterns.mdnew file mode 100644index 000000000000..ed8b6c0b8a13--- /dev/null+++ b/products/logs/mcp/prompts/logs-patterns.md@@ -0,0 +1,95 @@+Mine recurring log templates ("patterns") from the logs matching a filter set, ordered by frequency. Each pattern is a message template with the variable parts masked — e.g. `Connected to <ip> in <num>ms` — plus occurrence estimates, severity mix, the services it appears in, and a ready-made predicate for fetching its matching lines.++This is the fastest way to understand what a log stream is _saying_ without reading raw rows: one call summarizes millions of lines into at most 200 templates.++All parameters must be nested inside a `query` object.++# When to use++- To triage an unfamiliar or noisy stream: mine the last hour, scan the top templates by `estimated_count`, and look for anything with a non-zero error share in `severity_counts`.+- To find what's new or dominant during an incident window: mine with `severityLevels: ["error", "fatal"]` and a `dateRange` covering the incident.+- As the entry point of a drill-down loop: mine → pick a suspicious pattern → filter logs to exactly its lines using `match_regex` (see below) → read the raw rows with `query-logs`.+- To quantify repetition before proposing log sampling or cleanup: `volume_share_pct` tells you how much of the stream one template accounts for.++## Pick the right tool++- Raw log lines matching a filter → `query-logs`.+- A single number (how many logs match) → `logs-count`; per-time-bucket counts → `logs-count-ranges`.+- Distribution of a dimension (which services emit the errors?) → `logs-facet-values-create`.+- Use **this** tool to summarize message _content_ — what distinct things the logs say and how often.++# Reading the response++- `pattern` — the mined template. Masked tokens: `<uuid>`, `<ip>`, `<hex>`, `<num>`, and `<*>` for any word position that varied.+- `estimated_count` / `estimated_error_count` — occurrences extrapolated to the full window. When `sampled` is false these are exact.+- `severity_counts` — sampled occurrences per severity. A template split across `info` and `error` often means the same code path logging both outcomes.+- `services` — up to 4 service names the pattern was seen in.+- `match_regex` — a regex over raw log bodies that matches this pattern's lines, pre-validated against the pattern's own sampled lines. Null when no trustworthy regex could be compiled.+- `match_literal` — longest literal run of the template, a plain-text fallback when `match_regex` is null.++Mining samples the window (`sampled: true` when it did): counts are estimates, and rare patterns (below roughly 1 in `scanned_count` of the volume) may be missing entirely. Narrow the `dateRange` or filters to mine a finer-grained sample.++## Pivoting to a pattern's raw lines++To fetch the lines behind a pattern, call `query-logs` with a message filter in `filterGroup`:++- If `match_regex` is set: `{ "key": "message", "value": "<match_regex>", "operator": "regex", "type": "log" }`+- Else if `match_literal` is set: `{ "key": "message", "value": "<match_literal>", "operator": "icontains", "type": "log" }`++Also pass the pattern's `services` as `serviceNames` and (when every entry is one of trace/debug/info/warn/error/fatal) the keys of `severity_counts` as `severityLevels` — both make the query dramatically cheaper.++# Parameters++## query.dateRange++Date range to mine. Defaults to the last hour (`-1h`).++- `date_from`: ISO 8601 timestamp or relative format: `-1h`, `-6h`, `-1d`, `-7d`.+- `date_to`: Same format. Omit or null for "now".++## query.severityLevels++Mine only these severities: `trace`, `debug`, `info`, `warn`, `error`, `fatal`. Omit to include all levels.++## query.serviceNames++Restrict mining to these services. Recommended once you know the target service — it prunes the scan and spends the whole sample budget on one service's templates.++## query.searchTerm++Full-text search over log bodies applied before mining. Useful to mine only the sub-stream around a keyword (e.g. `timeout`).++## query.filterGroup++Property filters applied before mining. Same format as `query-logs` filters.++# Examples++## What is this stream saying? (last hour, everything)++```json+{ "query": { "dateRange": { "date_from": "-1h" } } }+```++## Dominant error templates during an incident++```json+{+ "query": {+ "severityLevels": ["error", "fatal"],+ "dateRange": { "date_from": "2024-01-15T09:00:00Z", "date_to": "2024-01-15T11:00:00Z" }+ }+}+```++## Mine one service's logs around a keyword++```json+{+ "query": {+ "serviceNames": ["checkout"],+ "searchTerm": "payment",+ "dateRange": { "date_from": "-6h" }+ }+}+```diff --git a/products/logs/mcp/tools.yaml b/products/logs/mcp/tools.yamlindex e510807554a7..9fac8c9e00cf 100644--- a/products/logs/mcp/tools.yaml+++ b/products/logs/mcp/tools.yaml@@ -358,9 +358,25 @@ tools:logs-has-logs-retrieve:operation: logs_has_logs_retrieveenabled: false- logs-patterns-create:+ logs-patterns:operation: logs_patterns_create- enabled: false+ enabled: true+ scopes:+ - logs:read+ annotations:+ readOnly: true+ destructive: false+ idempotent: true+ title: Mine log patterns+ description_file: ./prompts/logs-patterns.md+ feature_flag: logs-patterns-view+ response:+ exclude:+ - patterns.*.examples+ - patterns.*.sparkline+ - patterns.*.count+ - patterns.*.error_count+ - sparkline_bucketslogs-sampling-rules-create:operation: logs_sampling_rules_createenabled: falsediff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.jsonindex bd8d449956c5..5c37ab320f2e 100644--- a/services/mcp/schema/generated-tool-definitions.json+++ b/services/mcp/schema/generated-tool-definitions.json@@ -5445,6 +5445,21 @@"readOnlyHint": true}},+ "logs-patterns": {+ "description": "Mine recurring log templates (\"patterns\") from the logs matching a filter set, ordered by frequency. Each pattern is a message template with the variable parts masked — e.g. `Connected to <ip> in <num>ms` — plus occurrence estimates, severity mix, the services it appears in, and a ready-made predicate for fetching its matching lines.\n\nThis is the fastest way to understand what a log stream is _saying_ without reading raw rows: one call summarizes millions of lines into at most 200 templates.\n\nAll parameters must be nested inside a `query` object.\n\n# When to use\n\n- To triage an unfamiliar or noisy stream: mine the last hour, scan the top templates by `estimated_count`, and look for anything with a non-zero error share in `severity_counts`.\n- To find what's new or dominant during an incident window: mine with `severityLevels: [\"error\", \"fatal\"]` and a `dateRange` covering the incident.\n- As the entry point of a drill-down loop: mine → pick a suspicious pattern → filter logs to exactly its lines using `match_regex` (see below) → read the raw rows with `query-logs`.\n- To quantify repetition before proposing log sampling or cleanup: `volume_share_pct` tells you how much of the stream one template accounts for.\n\n## Pick the right tool\n\n- Raw log lines matching a filter → `query-logs`.\n- A single number (how many logs match) → `logs-count`; per-time-bucket counts → `logs-count-ranges`.\n- Distribution of a dimension (which services emit the errors?) → `logs-facet-values-create`.\n- Use **this** tool to summarize message _content_ — what distinct things the logs say and how often.\n\n# Reading the response\n\n- `pattern` — the mined template. Masked tokens: `<uuid>`, `<ip>`, `<hex>`, `<num>`, and `<*>` for any word position that varied.\n- `estimated_count` / `estimated_error_count` — occurrences extrapolated to the full window. When `sampled` is false these are exact.\n- `severity_counts` — sampled occurrences per severity. A template split across `info` and `error` often means the same code path logging both outcomes.\n- `services` — up to 4 service names the pattern was seen in.\n- `match_regex` — a regex over raw log bodies that matches this pattern's lines, pre-validated against the pattern's own sampled lines. Null when no trustworthy regex could be compiled.\n- `match_literal` — longest literal run of the template, a plain-text fallback when `match_regex` is null.\n\nMining samples the window (`sampled: true` when it did): counts are estimates, and rare patterns (below roughly 1 in `scanned_count` of the volume) may be missing entirely. Narrow the `dateRange` or filters to mine a finer-grained sample.\n\n## Pivoting to a pattern's raw lines\n\nTo fetch the lines behind a pattern, call `query-logs` with a message filter in `filterGroup`:\n\n- If `match_regex` is set: `{ \"key\": \"message\", \"value\": \"<match_regex>\", \"operator\": \"regex\", \"type\": \"log\" }`\n- Else if `match_literal` is set: `{ \"key\": \"message\", \"value\": \"<match_literal>\", \"operator\": \"icontains\", \"type\": \"log\" }`\n\nAlso pass the pattern's `services` as `serviceNames` and (when every entry is one of trace/debug/info/warn/error/fatal) the keys of `severity_counts` as `severityLevels` — both make the query dramatically cheaper.\n\n# Parameters\n\n## query.dateRange\n\nDate range to mine. Defaults to the last hour (`-1h`).\n\n- `date_from`: ISO 8601 timestamp or relative format: `-1h`, `-6h`, `-1d`, `-7d`.\n- `date_to`: Same format. Omit or null for \"now\".\n\n## query.severityLevels\n\nMine only these severities: `trace`, `debug`, `info`, `warn`, `error`, `fatal`. Omit to include all levels.\n\n## query.serviceNames\n\nRestrict mining to these services. Recommended once you know the target service — it prunes the scan and spends the whole sample budget on one service's templates.\n\n## query.searchTerm\n\nFull-text search over log bodies applied before mining. Useful to mine only the sub-stream around a keyword (e.g. `timeout`).\n\n## query.filterGroup\n\nProperty filters applied before mining. Same format as `query-logs` filters.\n\n# Examples\n\n## What is this stream saying? (last hour, everything)\n\n```json\n{ \"query\": { \"dateRange\": { \"date_from\": \"-1h\" } } }\n```\n\n## Dominant error templates during an incident\n\n```json\n{\n \"query\": {\n \"severityLevels\": [\"error\", \"fatal\"],\n \"dateRange\": { \"date_from\": \"2024-01-15T09:00:00Z\", \"date_to\": \"2024-01-15T11:00:00Z\" }\n }\n}\n```\n\n## Mine one service's logs around a keyword\n\n```json\n{\n \"query\": {\n \"serviceNames\": [\"checkout\"],\n \"searchTerm\": \"payment\",\n \"dateRange\": { \"date_from\": \"-6h\" }\n }\n}\n```",+ "category": "Logs",+ "feature": "logs",+ "summary": "Mine log patterns",+ "title": "Mine log patterns",+ "required_scopes": ["logs:read"],+ "annotations": {+ "destructiveHint": false,+ "idempotentHint": true,+ "openWorldHint": true,+ "readOnlyHint": true+ },+ "feature_flag": "logs-patterns-view"+ },"logs-services-create": {"description": "Return the top-25 services by log volume in the window, each with log_count, error_count, and error_rate, plus a per-service sparkline. Use this as the entry point when triaging which services are worth alerting on — high volume × non-zero error_rate is the natural alert candidate. Far cheaper than walking attribute-values + per-service counts.","category": "Logs",diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.jsonindex 48721bfa3652..ecf7955c6322 100644--- a/services/mcp/schema/tool-definitions-all.json+++ b/services/mcp/schema/tool-definitions-all.json@@ -5881,6 +5881,21 @@"readOnlyHint": true}},+ "logs-patterns": {+ "description": "Mine recurring log templates (\"patterns\") from the logs matching a filter set, ordered by frequency. Each pattern is a message template with the variable parts masked — e.g. `Connected to <ip> in <num>ms` — plus occurrence estimates, severity mix, the services it appears in, and a ready-made predicate for fetching its matching lines.\n\nThis is the fastest way to understand what a log stream is _saying_ without reading raw rows: one call summarizes millions of lines into at most 200 templates.\n\nAll parameters must be nested inside a `query` object.\n\n# When to use\n\n- To triage an unfamiliar or noisy stream: mine the last hour, scan the top templates by `estimated_count`, and look for anything with a non-zero error share in `severity_counts`.\n- To find what's new or dominant during an incident window: mine with `severityLevels: [\"error\", \"fatal\"]` and a `dateRange` covering the incident.\n- As the entry point of a drill-down loop: mine → pick a suspicious pattern → filter logs to exactly its lines using `match_regex` (see below) → read the raw rows with `query-logs`.\n- To quantify repetition before proposing log sampling or cleanup: `volume_share_pct` tells you how much of the stream one template accounts for.\n\n## Pick the right tool\n\n- Raw log lines matching a filter → `query-logs`.\n- A single number (how many logs match) → `logs-count`; per-time-bucket counts → `logs-count-ranges`.\n- Distribution of a dimension (which services emit the errors?) → `logs-facet-values-create`.\n- Use **this** tool to summarize message _content_ — what distinct things the logs say and how often.\n\n# Reading the response\n\n- `pattern` — the mined template. Masked tokens: `<uuid>`, `<ip>`, `<hex>`, `<num>`, and `<*>` for any word position that varied.\n- `estimated_count` / `estimated_error_count` — occurrences extrapolated to the full window. When `sampled` is false these are exact.\n- `severity_counts` — sampled occurrences per severity. A template split across `info` and `error` often means the same code path logging both outcomes.\n- `services` — up to 4 service names the pattern was seen in.\n- `match_regex` — a regex over raw log bodies that matches this pattern's lines, pre-validated against the pattern's own sampled lines. Null when no trustworthy regex could be compiled.\n- `match_literal` — longest literal run of the template, a plain-text fallback when `match_regex` is null.\n\nMining samples the window (`sampled: true` when it did): counts are estimates, and rare patterns (below roughly 1 in `scanned_count` of the volume) may be missing entirely. Narrow the `dateRange` or filters to mine a finer-grained sample.\n\n## Pivoting to a pattern's raw lines\n\nTo fetch the lines behind a pattern, call `query-logs` with a message filter in `filterGroup`:\n\n- If `match_regex` is set: `{ \"key\": \"message\", \"value\": \"<match_regex>\", \"operator\": \"regex\", \"type\": \"log\" }`\n- Else if `match_literal` is set: `{ \"key\": \"message\", \"value\": \"<match_literal>\", \"operator\": \"icontains\", \"type\": \"log\" }`\n\nAlso pass the pattern's `services` as `serviceNames` and (when every entry is one of trace/debug/info/warn/error/fatal) the keys of `severity_counts` as `severityLevels` — both make the query dramatically cheaper.\n\n# Parameters\n\n## query.dateRange\n\nDate range to mine. Defaults to the last hour (`-1h`).\n\n- `date_from`: ISO 8601 timestamp or relative format: `-1h`, `-6h`, `-1d`, `-7d`.\n- `date_to`: Same format. Omit or null for \"now\".\n\n## query.severityLevels\n\nMine only these severities: `trace`, `debug`, `info`, `warn`, `error`, `fatal`. Omit to include all levels.\n\n## query.serviceNames\n\nRestrict mining to these services. Recommended once you know the target service — it prunes the scan and spends the whole sample budget on one service's templates.\n\n## query.searchTerm\n\nFull-text search over log bodies applied before mining. Useful to mine only the sub-stream around a keyword (e.g. `timeout`).\n\n## query.filterGroup\n\nProperty filters applied before mining. Same format as `query-logs` filters.\n\n# Examples\n\n## What is this stream saying? (last hour, everything)\n\n```json\n{ \"query\": { \"dateRange\": { \"date_from\": \"-1h\" } } }\n```\n\n## Dominant error templates during an incident\n\n```json\n{\n \"query\": {\n \"severityLevels\": [\"error\", \"fatal\"],\n \"dateRange\": { \"date_from\": \"2024-01-15T09:00:00Z\", \"date_to\": \"2024-01-15T11:00:00Z\" }\n }\n}\n```\n\n## Mine one service's logs around a keyword\n\n```json\n{\n \"query\": {\n \"serviceNames\": [\"checkout\"],\n \"searchTerm\": \"payment\",\n \"dateRange\": { \"date_from\": \"-6h\" }\n }\n}\n```",+ "category": "Logs",+ "feature": "logs",+ "summary": "Mine log patterns",+ "title": "Mine log patterns",+ "required_scopes": ["logs:read"],+ "annotations": {+ "destructiveHint": false,+ "idempotentHint": true,+ "openWorldHint": true,+ "readOnlyHint": true+ },+ "feature_flag": "logs-patterns-view"+ },"logs-services-create": {"description": "Return the top-25 services by log volume in the window, each with log_count, error_count, and error_rate, plus a per-service sparkline. Use this as the entry point when triaging which services are worth alerting on — high volume × non-zero error_rate is the natural alert candidate. Far cheaper than walking attribute-values + per-service counts.","category": "Logs",diff --git a/services/mcp/src/generated/logs/api.ts b/services/mcp/src/generated/logs/api.tsindex 18aeb61222f8..5677eee0e1de 100644--- a/services/mcp/src/generated/logs/api.ts+++ b/services/mcp/src/generated/logs/api.ts@@ -3,7 +3,7 @@* MCP service uses these Zod schemas for generated tool handlers.* To regenerate: hogli build:openapi*- * PostHog API - MCP 17 enabled ops+ * PostHog API - MCP 18 enabled ops* OpenAPI spec version: 1.0.0*/import * as zod from 'zod'@@ -3995,6 +3995,96 @@ export const LogsFacetValuesCreateBody = /* @__PURE__ */ zod.object({.describe('The facet values query to execute.'),})+export const LogsPatternsCreateParams = /* @__PURE__ */ zod.object({+ project_id: zod+ .string()+ .describe(+ "Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/."+ ),+})++export const LogsPatternsCreateBody = /* @__PURE__ */ zod.object({+ query: zod+ .object({+ dateRange: zod+ .object({+ date_from: zod+ .string()+ .nullish()+ .describe(+ 'Start of the date range. Accepts ISO 8601 timestamps or relative formats: -7d, -1h, -1mStart, etc.'+ ),+ date_to: zod+ .string()+ .nullish()+ .describe('End of the date range. Same format as date_from. Omit or null for "now".'),+ })+ .optional()+ .describe('Date range to mine patterns from. Defaults to last hour.'),+ severityLevels: zod+ .array(+ zod+ .enum(['trace', 'debug', 'info', 'warn', 'error', 'fatal'])+ .describe(+ '* `trace` - trace\n* `debug` - debug\n* `info` - info\n* `warn` - warn\n* `error` - error\n* `fatal` - fatal'+ )+ )+ .optional()+ .describe('Filter by log severity levels before mining.'),+ serviceNames: zod.array(zod.string()).optional().describe('Restrict mining to these service names.'),+ searchTerm: zod.string().optional().describe('Full-text search term to filter log bodies before mining.'),+ filterGroup: zod+ .array(+ zod.object({+ key: zod+ .string()+ .describe(+ 'Attribute key. For type "log", use "message". For "log_attribute"/"log_resource_attribute", use the attribute key (e.g. "k8s.container.name").'+ ),+ type: zod+ .enum(['log', 'log_attribute', 'log_resource_attribute'])+ .describe(+ '* `log` - log\n* `log_attribute` - log_attribute\n* `log_resource_attribute` - log_resource_attribute'+ )+ .describe(+ '"log" filters the log body/message. "log_attribute" filters log-level attributes. "log_resource_attribute" filters resource-level attributes.\n\n* `log` - log\n* `log_attribute` - log_attribute\n* `log_resource_attribute` - log_resource_attribute'+ ),+ operator: zod+ .enum([+ 'exact',+ 'is_not',+ 'icontains',+ 'not_icontains',+ 'regex',+ 'not_regex',+ 'gt',+ 'lt',+ 'is_date_exact',+ 'is_date_before',+ 'is_date_after',+ 'is_set',+ 'is_not_set',+ ])+ .describe(+ '* `exact` - exact\n* `is_not` - is_not\n* `icontains` - icontains\n* `not_icontains` - not_icontains\n* `regex` - regex\n* `not_regex` - not_regex\n* `gt` - gt\n* `lt` - lt\n* `is_date_exact` - is_date_exact\n* `is_date_before` - is_date_before\n* `is_date_after` - is_date_after\n* `is_set` - is_set\n* `is_not_set` - is_not_set'+ )+ .describe(+ 'Comparison operator.\n\n* `exact` - exact\n* `is_not` - is_not\n* `icontains` - icontains\n* `not_icontains` - not_icontains\n* `regex` - regex\n* `not_regex` - not_regex\n* `gt` - gt\n* `lt` - lt\n* `is_date_exact` - is_date_exact\n* `is_date_before` - is_date_before\n* `is_date_after` - is_date_after\n* `is_set` - is_set\n* `is_not_set` - is_not_set'+ ),+ value: zod+ .unknown()+ .optional()+ .describe(+ 'Value to compare against. String, number, or array of strings. Omit for is_set/is_not_set operators.'+ ),+ })+ )+ .optional()+ .describe('Property filters applied before mining. Same shape as the query-logs endpoint.'),+ })+ .describe('The patterns query to execute.'),+})+export const LogsQueryCreateParams = /* @__PURE__ */ zod.object({project_id: zod.string()diff --git a/services/mcp/src/tools/generated/logs.ts b/services/mcp/src/tools/generated/logs.tsindex 2654413f4c56..4b4d0b56ea61 100644--- a/services/mcp/src/tools/generated/logs.ts+++ b/services/mcp/src/tools/generated/logs.ts@@ -20,12 +20,13 @@ import {LogsCountCreateBody,LogsCountRangesCreateBody,LogsFacetValuesCreateBody,+ LogsPatternsCreateBody,LogsQueryCreateBody,LogsServicesCreateBody,LogsSparklineCreateBody,LogsValuesRetrieveQueryParams,} from '@/generated/logs/api'-import { withPostHogUrl, pickResponseFields, type WithPostHogUrl } from '@/tools/tool-utils'+import { withPostHogUrl, pickResponseFields, omitResponseFields, type WithPostHogUrl } from '@/tools/tool-utils'import type { Context, ToolBase, ZodObjectAny } from '@/tools/types'const LogsAlertsCreateSchema = LogsAlertsCreateBody@@ -526,6 +527,33 @@ const logsFacetValuesCreate = (): ToolBase<typeof LogsFacetValuesCreateSchema, S},})+const LogsPatternsSchema = LogsPatternsCreateBody++const logsPatterns = (): ToolBase<typeof LogsPatternsSchema, Schemas._LogsPatternsResponse> => ({+ name: 'logs-patterns',+ schema: LogsPatternsSchema,+ handler: async (context: Context, params: z.infer<typeof LogsPatternsSchema>) => {+ const projectId = await context.stateManager.getProjectId()+ const body: Record<string, unknown> = {}+ if (params.query !== undefined) {+ body['query'] = params.query+ }+ const result = await context.api.request<Schemas._LogsPatternsResponse>({+ method: 'POST',+ path: `/api/projects/${encodeURIComponent(String(projectId))}/logs/patterns/`,+ body,+ })+ const filtered = omitResponseFields(result, [+ 'patterns.*.examples',+ 'patterns.*.sparkline',+ 'patterns.*.count',+ 'patterns.*.error_count',+ 'sparkline_buckets',+ ]) as typeof result+ return filtered+ },+})+const LogsServicesCreateSchema = LogsServicesCreateBodyconst logsServicesCreate = (): ToolBase<typeof LogsServicesCreateSchema, Schemas._LogsServicesResponse> => ({@@ -604,6 +632,7 @@ export const GENERATED_TOOLS: Record<string, () => ToolBase<ZodObjectAny>> = {'logs-count': logsCount,'logs-count-ranges': logsCountRanges,'logs-facet-values-create': logsFacetValuesCreate,+ 'logs-patterns': logsPatterns,'logs-services-create': logsServicesCreate,'logs-sparkline-query': logsSparklineQuery,'query-logs': queryLogs,diff --git a/services/mcp/tests/unit/tool-filtering.test.ts b/services/mcp/tests/unit/tool-filtering.test.tsindex 24026ef49369..d3b4db4c5fab 100644--- a/services/mcp/tests/unit/tool-filtering.test.ts+++ b/services/mcp/tests/unit/tool-filtering.test.ts@@ -758,6 +758,7 @@ describe('Tool Filtering - Feature Flags', () => {expect.arrayContaining(['agent-platform','logs-alerting',+ 'logs-patterns-view','replay-video-based-summarization','tracing','visual-review',@@ -778,7 +779,7 @@ describe('Tool Filtering - Feature Flags', () => {'endpoints-ai-materialization-fix',]))- expect(flags).toHaveLength(20)+ expect(flags).toHaveLength(21)})// Exercise the real predicate (toolPassesFlagGate) over hand-rolled entries