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.

feat(customer-analytics): make account custom-property values discoverable (#67456)

Arthur Moreira de Deus4ea526bd498d
diff --git a/posthog/hogql/database/schema/account_aggregates.py b/posthog/hogql/database/schema/account_aggregates.py
index d9ae88799a06..ff2334da4d01 100644
--- a/posthog/hogql/database/schema/account_aggregates.py
+++ b/posthog/hogql/database/schema/account_aggregates.py
@@ -242,7 +242,12 @@ class _AccountCustomPropertiesTable(LazyTable):
),
"values": StringJSONDatabaseField(
name="values",
- description="JSON object of active custom property values keyed by definition id, coalesced to strings.",
+ description=(
+ "JSON object of active custom property values keyed by custom property definition id, "
+ "coalesced to strings. Read one property with "
+ "accounts.custom_properties.values.`<definition_id>` (backtick-quote the id). "
+ "Get definition ids and names from system.custom_property_definitions."
+ ),
),
}
diff --git a/products/customer_analytics/mcp/tools.yaml b/products/customer_analytics/mcp/tools.yaml
index a9d1d2433ef6..58204f2b3d7f 100644
--- a/products/customer_analytics/mcp/tools.yaml
+++ b/products/customer_analytics/mcp/tools.yaml
@@ -269,6 +269,10 @@ tools:
percent, date, datetime, boolean), and `is_big_number` flag. Definitions are team-scoped and shared across
all accounts; the value a specific account holds for a definition is managed separately via the account
custom property value tools. Use `custom-property-definitions-retrieve` to fetch a single definition by id.
+ To list or filter accounts by a custom property value in bulk, take a definition `id` from this tool and
+ query it via HogQL against `system.accounts`, selecting ``custom_properties.values.`<definition_id>` ``
+ (backtick-quote the id) and filtering it `IS NOT NULL`. The per-account value tools return one account at a
+ time; this HogQL path scales to all accounts.
feature_flag: customer-analytics-csp
custom-property-definitions-partial-update:
operation: custom_property_definitions_partial_update
diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.json
index 7b4308a5a929..1c34df2f25e1 100644
--- a/services/mcp/schema/generated-tool-definitions.json
+++ b/services/mcp/schema/generated-tool-definitions.json
@@ -1776,7 +1776,7 @@
"feature_flag": "customer-analytics-csp"
},
"custom-property-definitions-list": {
- "description": "List Customer Analytics custom property definitions for the project. A definition is the shape of a custom account attribute — its `name`, optional `description`, `display_type` (one of text, number, currency, percent, date, datetime, boolean), and `is_big_number` flag. Definitions are team-scoped and shared across all accounts; the value a specific account holds for a definition is managed separately via the account custom property value tools. Use `custom-property-definitions-retrieve` to fetch a single definition by id.",
+ "description": "List Customer Analytics custom property definitions for the project. A definition is the shape of a custom account attribute — its `name`, optional `description`, `display_type` (one of text, number, currency, percent, date, datetime, boolean), and `is_big_number` flag. Definitions are team-scoped and shared across all accounts; the value a specific account holds for a definition is managed separately via the account custom property value tools. Use `custom-property-definitions-retrieve` to fetch a single definition by id. To list or filter accounts by a custom property value in bulk, take a definition `id` from this tool and query it via HogQL against `system.accounts`, selecting ``custom_properties.values.`<definition_id>` `` (backtick-quote the id) and filtering it `IS NOT NULL`. The per-account value tools return one account at a time; this HogQL path scales to all accounts.",
"category": "Customer analytics",
"feature": "customer_analytics",
"summary": "List custom property definitions",
diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.json
index 4725e395e588..9f3e4b065006 100644
--- a/services/mcp/schema/tool-definitions-all.json
+++ b/services/mcp/schema/tool-definitions-all.json
@@ -1806,7 +1806,7 @@
"feature_flag": "customer-analytics-csp"
},
"custom-property-definitions-list": {
- "description": "List Customer Analytics custom property definitions for the project. A definition is the shape of a custom account attribute — its `name`, optional `description`, `display_type` (one of text, number, currency, percent, date, datetime, boolean), and `is_big_number` flag. Definitions are team-scoped and shared across all accounts; the value a specific account holds for a definition is managed separately via the account custom property value tools. Use `custom-property-definitions-retrieve` to fetch a single definition by id.",
+ "description": "List Customer Analytics custom property definitions for the project. A definition is the shape of a custom account attribute — its `name`, optional `description`, `display_type` (one of text, number, currency, percent, date, datetime, boolean), and `is_big_number` flag. Definitions are team-scoped and shared across all accounts; the value a specific account holds for a definition is managed separately via the account custom property value tools. Use `custom-property-definitions-retrieve` to fetch a single definition by id. To list or filter accounts by a custom property value in bulk, take a definition `id` from this tool and query it via HogQL against `system.accounts`, selecting ``custom_properties.values.`<definition_id>` `` (backtick-quote the id) and filtering it `IS NOT NULL`. The per-account value tools return one account at a time; this HogQL path scales to all accounts.",
"category": "Customer analytics",
"feature": "customer_analytics",
"summary": "List custom property definitions",