: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
fix(signals): stop scouts fetching built-in skills with skill-get (#91107)
Chris Volzer9e01a215bf52
diff --git a/products/signals/backend/scout_harness/prompt.py b/products/signals/backend/scout_harness/prompt.pyindex afeb2fa2d75a..c46bb83f8708 100644--- a/products/signals/backend/scout_harness/prompt.py+++ b/products/signals/backend/scout_harness/prompt.py@@ -1109,6 +1109,8 @@ Pin to v{skill.version} explicitly, since the run row, your tool resolution, andThe body tells you what to investigate, in what order, with what hypotheses. Pull files on demand with `skill-file-get` only when the body references them. Don't start investigating before you've read it.+`skill-get` and `skill-file-get` read this team's skills store: your bound scout and the companion skills seeded next to it. PostHog's built-in skills, such as `querying-posthog-data`, are not rows in that store. They are installed in this sandbox as local skills. When your skill body or a tool description tells you to read one of them, use the local copy: pick it from your available skills, or read its `SKILL.md` from the installed skills directory. A 404 from `skill-get` for a built-in skill is expected, not a gap: do not retry it and do not report it through `agent-feedback`.+# Then: orient on this projectOnce you've read your skill, call:diff --git a/services/mcp/src/templates/sections/examples.md b/services/mcp/src/templates/sections/examples.mdindex 050cb88cb114..70161e813233 100644--- a/services/mcp/src/templates/sections/examples.md+++ b/services/mcp/src/templates/sections/examples.md@@ -1,6 +1,6 @@### Examples-Before writing any queries, read the PostHog's skill `querying-posthog-data` to see if there are any relevant query examples and follow them.+Before writing any queries, read the `querying-posthog-data` skill when it is installed in your environment, and follow any relevant query examples. It is a built-in PostHog skill, not a team skill in the skills store, so do not fetch it with `skill-get`. When it is not installed, the `execute-sql` tool description carries the same core guidance.#### Creating an insight with segmentationdiff --git a/services/mcp/src/tools/exec.ts b/services/mcp/src/tools/exec.tsindex a8a826fc8f30..e19566889a31 100644--- a/services/mcp/src/tools/exec.ts+++ b/services/mcp/src/tools/exec.ts@@ -5,12 +5,11 @@ import { markExecPayload, buildToolResultPayload, estimateResponseTokens } fromimport { isPostHogCodeConsumer } from '@/lib/client-detection'import { ExecCommandError, findRecoverableApiError, PostHogApiError, ToolInputValidationError } from '@/lib/errors'import { estimateTokens } from '@/lib/estimate-tokens'+import { GATEWAY_TOOL_SEPARATOR, isGatewayToolName } from '@/lib/gateway-tools'import { formatResponse } from '@/lib/response'import type { ExecHelpCatalog } from './exec-help'import { TOKEN_CHAR_LIMIT, listAvailablePaths, resolveSchemaPath, summarizeSchema } from './schema-utils'-import { GATEWAY_TOOL_SEPARATOR, isGatewayToolName } from '@/lib/gateway-tools'-import { isRegexPattern, searchToolsRanked, searchToolsRegex } from './tool-search'import type { ScopeGatedTool } from './toolDefinitions'import {@@ -314,10 +313,10 @@ export function createExecInnerToolCallResolver(const DEPRECATED_TOOL_REDIRECTS: Record<string, (allTools: Tool<ZodObjectAny>[]) => string> = {// Removed in favor of SQL-based schema discovery via `system.information_schema.*`.'read-data-warehouse-schema': () =>- 'Tool "read-data-warehouse-schema" was removed in favor of SQL-based schema discovery. Use "execute-sql" against `system.information_schema.*` (`tables`, `columns`, `relationships`, `data_types`) — it scales to large catalogs and supports filtering/search (e.g. `WHERE description ILIKE \'%...%\'`). Consult the `querying-posthog-data` skill for patterns.',+ 'Tool "read-data-warehouse-schema" was removed in favor of SQL-based schema discovery. Use "execute-sql" against `system.information_schema.*` (`tables`, `columns`, `relationships`, `data_types`) — it scales to large catalogs and supports filtering/search (e.g. `WHERE description ILIKE \'%...%\'`). Consult the `querying-posthog-data` skill (a built-in local skill, when installed) for patterns.','entity-search': (allTools) => {const base =- 'Tool "entity-search" was removed. Use "execute-sql" to search PostHog data via HogQL. Consult the `querying-posthog-data` skill for system-table patterns (system.insights, system.dashboards, system.cohorts, ...).'+ 'Tool "entity-search" was removed. Use "execute-sql" to search PostHog data via HogQL. Consult the `querying-posthog-data` skill (a built-in local skill, when installed) for system-table patterns (system.insights, system.dashboards, system.cohorts, ...).'const hasCatalog = allTools.some((t) => t.name === 'data-catalog-metric-run')return hasCatalog? `${base} For governed business metrics, search \`system.information_schema.metrics\` instead of \`system.insights\`.`@@ -330,7 +329,7 @@ const DEPRECATED_TOOL_REDIRECTS: Record<string, (allTools: Tool<ZodObjectAny>[])'property-definitions': () =>'Tool "property-definitions" was removed. Use "read-data-schema" with the appropriate kind: "event_properties", "entity_properties", or "action_properties" — see its info schema for required fields.','query-generate-hogql-from-question': () =>- 'Tool "query-generate-hogql-from-question" was removed. Write the HogQL yourself and run it via "execute-sql". Consult the `querying-posthog-data` skill for HogQL patterns.',+ 'Tool "query-generate-hogql-from-question" was removed. Write the HogQL yourself and run it via "execute-sql". Consult the `querying-posthog-data` skill (a built-in local skill, when installed) for HogQL patterns.','query-run': (allTools) => {const queryTools = allTools.filter((t) => t.name.startsWith('query-'))diff --git a/services/mcp/tests/unit/__snapshots__/instructions/exec-command-reference-full.txt b/services/mcp/tests/unit/__snapshots__/instructions/exec-command-reference-full.txtindex cdc3b5e63f1e..c81f5e37ae0b 100644--- a/services/mcp/tests/unit/__snapshots__/instructions/exec-command-reference-full.txt+++ b/services/mcp/tests/unit/__snapshots__/instructions/exec-command-reference-full.txt@@ -298,7 +298,7 @@ Submitting feedback is **not** a way to end your turn or skip work. It's a side### Examples-Before writing any queries, read the PostHog's skill `querying-posthog-data` to see if there are any relevant query examples and follow them.+Before writing any queries, read the `querying-posthog-data` skill when it is installed in your environment, and follow any relevant query examples. It is a built-in PostHog skill, not a team skill in the skills store, so do not fetch it with `skill-get`. When it is not installed, the `execute-sql` tool description carries the same core guidance.#### Creating an insight with segmentationdiff --git a/services/mcp/tests/unit/__snapshots__/instructions/tools-instructions.txt b/services/mcp/tests/unit/__snapshots__/instructions/tools-instructions.txtindex 6d5d31c843f9..631db8daa88c 100644--- a/services/mcp/tests/unit/__snapshots__/instructions/tools-instructions.txt+++ b/services/mcp/tests/unit/__snapshots__/instructions/tools-instructions.txt@@ -185,7 +185,7 @@ Submitting feedback is **not** a way to end your turn or skip work. It's a side### Examples-Before writing any queries, read the PostHog's skill `querying-posthog-data` to see if there are any relevant query examples and follow them.+Before writing any queries, read the `querying-posthog-data` skill when it is installed in your environment, and follow any relevant query examples. It is a built-in PostHog skill, not a team skill in the skills store, so do not fetch it with `skill-get`. When it is not installed, the `execute-sql` tool description carries the same core guidance.#### Creating an insight with segmentation