hermosodocs

posthog_query

Ask PostHog a question in HogQL read-only

Area: PRODUCT ANALYTICS: PostHog · Mixpanel · Amplitude · Ad campaign management. Generated from the running MCP server, like the rest of the tool reference.

Description

ASK POSTHOG A QUESTION IN HogQL — their SQL dialect over the `events`, `persons` and `sessions` tables. Use it for per-user funnels, retention and custom breakdowns, e.g. `SELECT properties.$current_url, count() FROM events WHERE event = '$pageview' AND timestamp > now() - INTERVAL 7 DAY GROUP BY 1 ORDER BY 2 DESC`. IT IS NOT AN EXPORTER AND MUST NEVER BE LOOPED — PostHog's own policy, verbatim: "Third-party connectors must use batch exports, not /query. Connectors built on /query are not supported and will be rate-limited or rejected." Ask ONE bounded question. Do not paginate it, do not schedule it, and do not call it repeatedly to assemble a whole table; if the user genuinely needs bulk data, tell them to set up a PostHog batch export. Every query is capped at 1000 rows, and OFFSET is refused outright because PostHog returns HTTP 400 for it on API keys — use keyset pagination on `timestamp` (events) or `id` (persons) if a second page is truly needed. Read-only, 0 credits.

Parameters

ParameterTypeDescription
queryrequiredstringa HogQL (ClickHouse-flavoured SQL) query — one bounded question, never a page of an export
limitnumberrow cap, 1–1000 (default 1000). A LIMIT already in the query is honoured and clamped to the same ceiling

Example call

Every required parameter is shown, filled from the schema where it gives a value and otherwise with a placeholder naming the type. Replace the placeholders with real values. The same call works on the MCP server, the CLI and POST https://app.hermoso.ai/v1/tools/posthog_query.

MCP (tools/call)

{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"posthog_query","arguments":{"query":"<string>"}}}

CLI

hermoso call posthog_query --json '{"query":"<string>"}'

Credits

Credits are spent only on two things: running an AI model (image, video, voice, text, planning, post-production) and Ad Spy research. See Credits & costs.

All 759 Ad campaign management tools · tools.json