[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-posthog-exploring-mcp-sessions":3,"mdc-q116d5-key":49,"related-repo-posthog-exploring-mcp-sessions":1640,"related-org-posthog-exploring-mcp-sessions":1738},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":44,"sourceUrl":47,"mdContent":48},"exploring-mcp-sessions","investigate PostHog MCP sessions","Investigate individual PostHog MCP sessions — the sequence of tool calls a single agent made in one run, what it was trying to do, and where it went wrong. Use when the user asks \"what did this MCP session do?\", \"show me the tool calls for session X\", \"what was the agent's goal?\", \"which sessions had errors?\", \"who is connecting to my MCP?\", or pastes an MCP analytics sessions URL.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"posthog","PostHog","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fposthog.png",[12,16,17,20],{"name":13,"slug":14,"type":15},"Observability","observability","tag",{"name":9,"slug":8,"type":15},{"name":18,"slug":19,"type":15},"MCP","mcp",{"name":21,"slug":22,"type":15},"Debugging","debugging",35568,"https:\u002F\u002Fgithub.com\u002FPostHog\u002Fposthog","2026-07-18T05:10:56.432634",null,2977,[29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"ab-testing","ai-analytics","analytics","cdp","data-warehouse","experiments","feature-flags","javascript","product-analytics","python","react","session-replay","surveys","typescript","web-analytics",{"repoUrl":24,"stars":23,"forks":27,"topics":45,"description":46},[29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"🦔 PostHog is an all-in-one developer platform for building successful products. We offer product analytics, web analytics, session replay, error tracking, feature flags, experimentation, surveys, data warehouse, a CDP, and an AI product assistant to help debug your code, ship features faster, and keep all your usage and customer data in one stack.","https:\u002F\u002Fgithub.com\u002FPostHog\u002Fposthog\u002Ftree\u002FHEAD\u002Fproducts\u002Fmcp_analytics\u002Fskills\u002Fexploring-mcp-sessions","---\nname: exploring-mcp-sessions\ndescription: >\n  Investigate individual PostHog MCP sessions — the sequence of tool calls a\n  single agent made in one run, what it was trying to do, and where it went\n  wrong. Use when the user asks \"what did this MCP session do?\", \"show me the\n  tool calls for session X\", \"what was the agent's goal?\", \"which sessions had\n  errors?\", \"who is connecting to my MCP?\", or pastes an MCP analytics sessions\n  URL.\n---\n\n# Exploring MCP sessions\n\nAn MCP session is one agent run: the set of `$mcp_tool_call` events sharing a\n`$session_id`, ordered by `timestamp`.\n\nListing sessions, reading a session's tool calls, and summarising its goal each\nhave a **typed tool** — reach for those first. Drop to HogQL only for the three\nthings the typed tools genuinely can't do (see\n[When to drop to SQL](#when-to-drop-to-sql)). The full `$mcp_*` property schema\nand query recipes live in the shared reference:\n[`models-mcp.md`](..\u002F..\u002F..\u002Fposthog_ai\u002Fskills\u002Fquerying-posthog-data\u002Freferences\u002Fmodels-mcp.md).\n\n## Tools\n\n| Tool                                             | Purpose                                                    |\n| ------------------------------------------------ | ---------------------------------------------------------- |\n| `posthog:mcp-analytics-sessions-list`            | List sessions — one row per session, newest first          |\n| `posthog:mcp-analytics-sessions-tool-calls`      | One session's tool calls, chronological                    |\n| `posthog:mcp-analytics-sessions-generate-intent` | LLM summary of a session's goal (cached after first call)  |\n| `posthog:execute-sql`                            | Errored sessions, effective tool names, cross-session cuts |\n\nThe three `mcp-analytics-*` tools are gated behind the `mcp-analytics` flag and\nrun the same code as the sessions UI, so results match the screen. If they aren't\nin your tool list, the project doesn't have the flag — fall back to\n`posthog:execute-sql`, which is ungated.\n\n## The date-window trap — read this first\n\nThe two detail tools default to a **7-day lookback**. A session you found in a\nlist that reaches further back will come back **empty** unless you pass its\n`session_start` as `date_from`:\n\n- `posthog:mcp-analytics-sessions-tool-calls` — `date_from` is an absolute ISO\n  timestamp; pass the `session_start` you got from\n  `posthog:mcp-analytics-sessions-list`.\n- `posthog:mcp-analytics-sessions-generate-intent` — same `date_from` query\n  param, same reason.\n\nEmpty tool calls for a session that visibly exists is almost always this, not a\ndata problem. Carry `session_start` forward from the list row.\n\n## Workflow: list recent sessions\n\n```json\nposthog:mcp-analytics-sessions-list\n{ \"date_from\": \"-7d\", \"order_by\": \"-session_start\", \"limit\": 100 }\n```\n\nEach row: `session_id`, `tool_calls`, `session_start`, `session_end`,\n`tools_used`, `mcp_client_name`, `distinct_id` (+ resolved `person_email` \u002F\n`person_name`), and `intent` (empty until generated). Response is\n`{ results, has_next }` — page with `limit` \u002F `offset`.\n\nThree sharp edges:\n\n- **`order_by` takes column names, not response field names.** Sort call volume\n  as `tool_call_count` (not `tool_calls`). `duration_seconds` sorts fine even\n  though it isn't returned. An unrecognised key **silently** falls back to\n  newest-first — so verify the order you got is the order you asked for. Valid:\n  `session_id`, `session_start`, `session_end`, `duration_seconds`,\n  `tool_call_count`, `mcp_client_name`, `distinct_id`; prefix `-` to descend.\n- **There is no error filter and no error count on a session row.** \"Which\n  sessions had errors?\" is a SQL question — see below.\n- **`distinct_id_count` is always `0`.** The field is in the response but the\n  backend never populates it, so don't read it as \"one distinct id per session\"\n  — it says nothing. To count distinct ids in a session, use SQL.\n\n`search` does a case-insensitive substring match across `session_id`,\n`distinct_id`, `mcp_client_name`, and `tools_used`.\n\n## Workflow: read one session's tool calls\n\n```json\nposthog:mcp-analytics-sessions-tool-calls\n{ \"id\": \"\u003Csession_id>\", \"date_from\": \"\u003Csession_start>\", \"limit\": 500 }\n```\n\nChronological `tool_name`, `intent`, `timestamp`, `duration_ms`, `is_error`,\n`error_message` — read top to bottom to reconstruct the run. `limit` defaults to\n500 (also the max), which is the whole page for almost every session; `has_next`\ntells you if more remain.\n\n**Caveat: `tool_name` here is the raw `$mcp_tool_name`.** Unlike the tool-quality\nand tool-detail tools, this endpoint does not resolve the inner tool of a\nsingle-exec wrapper call, so wrapper calls show the wrapper. When the inner tool\nis what matters (comparing against a tool-quality ranking, tracing a specific\ntool through a run), use the SQL recipe below instead. The same applies to\n`tools_used` on the session list.\n\n## Workflow: summarise the agent's goal\n\n```json\nposthog:mcp-analytics-sessions-generate-intent\n{ \"id\": \"\u003Csession_id>\", \"date_from\": \"\u003Csession_start>\" }\n```\n\nSummarises the session's recorded `$mcp_intent` values via an LLM and persists\nthe result; later calls return the cached summary. Returns\n`{ session_id, intent }`. A 503 means LLM summarisation isn't configured — fall\nback to reading the raw `$mcp_intent` values from the tool-call list.\n\n## When to drop to SQL\n\nFour cases, all via `posthog:execute-sql`, which — unlike the typed tools above —\nis **not** gated behind the `mcp-analytics` flag.\n\n**1. The project doesn't have the `mcp-analytics` flag.** The typed tools simply\nwon't be in your tool list. Everything below still works; this query is the\nplain session listing:\n\n```sql\nSELECT\n    $session_id AS session_id,\n    min(timestamp) AS session_start,\n    max(timestamp) AS session_end,\n    dateDiff('second', min(timestamp), max(timestamp)) AS duration_seconds,\n    count() AS tool_calls,\n    countIf(toBool(properties.$mcp_is_error)) AS errors,\n    any(properties.$mcp_client_name) AS client\nFROM events\nWHERE event = '$mcp_tool_call'\n    AND $session_id != ''\n    AND timestamp >= now() - INTERVAL 7 DAY\nGROUP BY session_id\nORDER BY session_start DESC\nLIMIT 50\n```\n\n**2. Errored sessions.** The session list can't filter or count errors — add\n`HAVING errors > 0` to the query above and order by `errors DESC`.\n\n**3. Effective tool names within a session** — the coalesce the typed tool-calls\nendpoint doesn't apply:\n\n```sql\nSELECT\n    timestamp,\n    coalesce(nullIf(toString(properties.$mcp_exec_tool_call_name), ''), toString(properties.$mcp_tool_name)) AS tool,\n    toBool(properties.$mcp_is_error) AS is_error,\n    toString(properties.$mcp_error_message) AS error_message,\n    round(toFloat(properties.$mcp_duration_ms)) AS duration_ms\nFROM events\nWHERE event = '$mcp_tool_call'\n    AND $session_id = '\u003Csession_id>'\nORDER BY timestamp ASC\n```\n\n**4. Cross-session aggregation** — \"sessions per day\", \"sessions that used tool\nX and then failed\", custom breakdowns. Recipes in\n[`models-mcp.md`](..\u002F..\u002F..\u002Fposthog_ai\u002Fskills\u002Fquerying-posthog-data\u002Freferences\u002Fmodels-mcp.md).\n\nNote `$session_id` is a **materialised events column** — the same id as\n`$mcp_session_id`. Reference it bare, never as `properties.$session_id`: the\n`properties.` accessor renders null-wrapped in SELECT but as the raw column in\nHAVING\u002FORDER, so a `HAVING` search would mismatch the `GROUP BY` key.\n\n## Constructing UI links\n\n- **Sessions list**: `https:\u002F\u002Fapp.posthog.com\u002Fproject\u002F\u003Cproject_id>\u002Fmcp-analytics\u002Fsessions`\n\n## Tips\n\n- A session with many calls but no errors that ends abruptly often means the\n  agent gave up — check whether the last call returned a large or empty result\n- `$mcp_intent` is only present when the client supplied it; absence is common,\n  so generate-intent is the more reliable goal signal\n- To go from a failing tool (see\n  [`exploring-mcp-tool-quality`](..\u002Fexploring-mcp-tool-quality\u002FSKILL.md)) to the\n  sessions that hit it, `search` the session list by tool name — remembering\n  `tools_used` holds raw names, so search the registered name, not the inner one\n\n## Related skills\n\n- [`exploring-mcp-tool-usage`](..\u002Fexploring-mcp-tool-usage\u002FSKILL.md) — the front\n  door: routes a broad \"how is my MCP doing?\" question to the right tool\n- [`exploring-mcp-tool-quality`](..\u002Fexploring-mcp-tool-quality\u002FSKILL.md) — error\n  rates and latency across all tools\n- [`exploring-mcp-intent-clusters`](..\u002Fexploring-mcp-intent-clusters\u002FSKILL.md) —\n  group goals across many sessions\n",{"data":50,"body":51},{"name":4,"description":6},{"type":52,"children":53},"root",[54,62,93,134,141,237,265,271,306,358,370,376,509,611,616,748,784,790,904,965,996,1002,1088,1116,1121,1147,1163,1305,1330,1340,1424,1443,1502,1508,1527,1533,1582,1588,1634],{"type":55,"tag":56,"props":57,"children":58},"element","h1",{"id":4},[59],{"type":60,"value":61},"text","Exploring MCP sessions",{"type":55,"tag":63,"props":64,"children":65},"p",{},[66,68,75,77,83,85,91],{"type":60,"value":67},"An MCP session is one agent run: the set of ",{"type":55,"tag":69,"props":70,"children":72},"code",{"className":71},[],[73],{"type":60,"value":74},"$mcp_tool_call",{"type":60,"value":76}," events sharing a\n",{"type":55,"tag":69,"props":78,"children":80},{"className":79},[],[81],{"type":60,"value":82},"$session_id",{"type":60,"value":84},", ordered by ",{"type":55,"tag":69,"props":86,"children":88},{"className":87},[],[89],{"type":60,"value":90},"timestamp",{"type":60,"value":92},".",{"type":55,"tag":63,"props":94,"children":95},{},[96,98,104,106,113,115,121,123,133],{"type":60,"value":97},"Listing sessions, reading a session's tool calls, and summarising its goal each\nhave a ",{"type":55,"tag":99,"props":100,"children":101},"strong",{},[102],{"type":60,"value":103},"typed tool",{"type":60,"value":105}," — reach for those first. Drop to HogQL only for the three\nthings the typed tools genuinely can't do (see\n",{"type":55,"tag":107,"props":108,"children":110},"a",{"href":109},"#when-to-drop-to-sql",[111],{"type":60,"value":112},"When to drop to SQL",{"type":60,"value":114},"). The full ",{"type":55,"tag":69,"props":116,"children":118},{"className":117},[],[119],{"type":60,"value":120},"$mcp_*",{"type":60,"value":122}," property schema\nand query recipes live in the shared reference:\n",{"type":55,"tag":107,"props":124,"children":126},{"href":125},"..\u002F..\u002F..\u002Fposthog_ai\u002Fskills\u002Fquerying-posthog-data\u002Freferences\u002Fmodels-mcp.md",[127],{"type":55,"tag":69,"props":128,"children":130},{"className":129},[],[131],{"type":60,"value":132},"models-mcp.md",{"type":60,"value":92},{"type":55,"tag":135,"props":136,"children":138},"h2",{"id":137},"tools",[139],{"type":60,"value":140},"Tools",{"type":55,"tag":142,"props":143,"children":144},"table",{},[145,164],{"type":55,"tag":146,"props":147,"children":148},"thead",{},[149],{"type":55,"tag":150,"props":151,"children":152},"tr",{},[153,159],{"type":55,"tag":154,"props":155,"children":156},"th",{},[157],{"type":60,"value":158},"Tool",{"type":55,"tag":154,"props":160,"children":161},{},[162],{"type":60,"value":163},"Purpose",{"type":55,"tag":165,"props":166,"children":167},"tbody",{},[168,186,203,220],{"type":55,"tag":150,"props":169,"children":170},{},[171,181],{"type":55,"tag":172,"props":173,"children":174},"td",{},[175],{"type":55,"tag":69,"props":176,"children":178},{"className":177},[],[179],{"type":60,"value":180},"posthog:mcp-analytics-sessions-list",{"type":55,"tag":172,"props":182,"children":183},{},[184],{"type":60,"value":185},"List sessions — one row per session, newest first",{"type":55,"tag":150,"props":187,"children":188},{},[189,198],{"type":55,"tag":172,"props":190,"children":191},{},[192],{"type":55,"tag":69,"props":193,"children":195},{"className":194},[],[196],{"type":60,"value":197},"posthog:mcp-analytics-sessions-tool-calls",{"type":55,"tag":172,"props":199,"children":200},{},[201],{"type":60,"value":202},"One session's tool calls, chronological",{"type":55,"tag":150,"props":204,"children":205},{},[206,215],{"type":55,"tag":172,"props":207,"children":208},{},[209],{"type":55,"tag":69,"props":210,"children":212},{"className":211},[],[213],{"type":60,"value":214},"posthog:mcp-analytics-sessions-generate-intent",{"type":55,"tag":172,"props":216,"children":217},{},[218],{"type":60,"value":219},"LLM summary of a session's goal (cached after first call)",{"type":55,"tag":150,"props":221,"children":222},{},[223,232],{"type":55,"tag":172,"props":224,"children":225},{},[226],{"type":55,"tag":69,"props":227,"children":229},{"className":228},[],[230],{"type":60,"value":231},"posthog:execute-sql",{"type":55,"tag":172,"props":233,"children":234},{},[235],{"type":60,"value":236},"Errored sessions, effective tool names, cross-session cuts",{"type":55,"tag":63,"props":238,"children":239},{},[240,242,248,250,256,258,263],{"type":60,"value":241},"The three ",{"type":55,"tag":69,"props":243,"children":245},{"className":244},[],[246],{"type":60,"value":247},"mcp-analytics-*",{"type":60,"value":249}," tools are gated behind the ",{"type":55,"tag":69,"props":251,"children":253},{"className":252},[],[254],{"type":60,"value":255},"mcp-analytics",{"type":60,"value":257}," flag and\nrun the same code as the sessions UI, so results match the screen. If they aren't\nin your tool list, the project doesn't have the flag — fall back to\n",{"type":55,"tag":69,"props":259,"children":261},{"className":260},[],[262],{"type":60,"value":231},{"type":60,"value":264},", which is ungated.",{"type":55,"tag":135,"props":266,"children":268},{"id":267},"the-date-window-trap-read-this-first",[269],{"type":60,"value":270},"The date-window trap — read this first",{"type":55,"tag":63,"props":272,"children":273},{},[274,276,281,283,288,290,296,298,304],{"type":60,"value":275},"The two detail tools default to a ",{"type":55,"tag":99,"props":277,"children":278},{},[279],{"type":60,"value":280},"7-day lookback",{"type":60,"value":282},". A session you found in a\nlist that reaches further back will come back ",{"type":55,"tag":99,"props":284,"children":285},{},[286],{"type":60,"value":287},"empty",{"type":60,"value":289}," unless you pass its\n",{"type":55,"tag":69,"props":291,"children":293},{"className":292},[],[294],{"type":60,"value":295},"session_start",{"type":60,"value":297}," as ",{"type":55,"tag":69,"props":299,"children":301},{"className":300},[],[302],{"type":60,"value":303},"date_from",{"type":60,"value":305},":",{"type":55,"tag":307,"props":308,"children":309},"ul",{},[310,341],{"type":55,"tag":311,"props":312,"children":313},"li",{},[314,319,321,326,328,333,335,340],{"type":55,"tag":69,"props":315,"children":317},{"className":316},[],[318],{"type":60,"value":197},{"type":60,"value":320}," — ",{"type":55,"tag":69,"props":322,"children":324},{"className":323},[],[325],{"type":60,"value":303},{"type":60,"value":327}," is an absolute ISO\ntimestamp; pass the ",{"type":55,"tag":69,"props":329,"children":331},{"className":330},[],[332],{"type":60,"value":295},{"type":60,"value":334}," you got from\n",{"type":55,"tag":69,"props":336,"children":338},{"className":337},[],[339],{"type":60,"value":180},{"type":60,"value":92},{"type":55,"tag":311,"props":342,"children":343},{},[344,349,351,356],{"type":55,"tag":69,"props":345,"children":347},{"className":346},[],[348],{"type":60,"value":214},{"type":60,"value":350}," — same ",{"type":55,"tag":69,"props":352,"children":354},{"className":353},[],[355],{"type":60,"value":303},{"type":60,"value":357}," query\nparam, same reason.",{"type":55,"tag":63,"props":359,"children":360},{},[361,363,368],{"type":60,"value":362},"Empty tool calls for a session that visibly exists is almost always this, not a\ndata problem. Carry ",{"type":55,"tag":69,"props":364,"children":366},{"className":365},[],[367],{"type":60,"value":295},{"type":60,"value":369}," forward from the list row.",{"type":55,"tag":135,"props":371,"children":373},{"id":372},"workflow-list-recent-sessions",[374],{"type":60,"value":375},"Workflow: list recent sessions",{"type":55,"tag":377,"props":378,"children":383},"pre",{"className":379,"code":380,"language":381,"meta":382,"style":382},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","posthog:mcp-analytics-sessions-list\n{ \"date_from\": \"-7d\", \"order_by\": \"-session_start\", \"limit\": 100 }\n","json","",[384],{"type":55,"tag":69,"props":385,"children":386},{"__ignoreMap":382},[387,399],{"type":55,"tag":388,"props":389,"children":392},"span",{"class":390,"line":391},"line",1,[393],{"type":55,"tag":388,"props":394,"children":396},{"style":395},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[397],{"type":60,"value":398},"posthog:mcp-analytics-sessions-list\n",{"type":55,"tag":388,"props":400,"children":402},{"class":390,"line":401},2,[403,409,414,419,424,428,432,438,442,447,451,456,460,464,468,473,477,481,485,490,494,498,504],{"type":55,"tag":388,"props":404,"children":406},{"style":405},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[407],{"type":60,"value":408},"{",{"type":55,"tag":388,"props":410,"children":411},{"style":405},[412],{"type":60,"value":413}," \"",{"type":55,"tag":388,"props":415,"children":417},{"style":416},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[418],{"type":60,"value":303},{"type":55,"tag":388,"props":420,"children":421},{"style":405},[422],{"type":60,"value":423},"\"",{"type":55,"tag":388,"props":425,"children":426},{"style":405},[427],{"type":60,"value":305},{"type":55,"tag":388,"props":429,"children":430},{"style":405},[431],{"type":60,"value":413},{"type":55,"tag":388,"props":433,"children":435},{"style":434},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[436],{"type":60,"value":437},"-7d",{"type":55,"tag":388,"props":439,"children":440},{"style":405},[441],{"type":60,"value":423},{"type":55,"tag":388,"props":443,"children":444},{"style":405},[445],{"type":60,"value":446},",",{"type":55,"tag":388,"props":448,"children":449},{"style":405},[450],{"type":60,"value":413},{"type":55,"tag":388,"props":452,"children":453},{"style":416},[454],{"type":60,"value":455},"order_by",{"type":55,"tag":388,"props":457,"children":458},{"style":405},[459],{"type":60,"value":423},{"type":55,"tag":388,"props":461,"children":462},{"style":405},[463],{"type":60,"value":305},{"type":55,"tag":388,"props":465,"children":466},{"style":405},[467],{"type":60,"value":413},{"type":55,"tag":388,"props":469,"children":470},{"style":434},[471],{"type":60,"value":472},"-session_start",{"type":55,"tag":388,"props":474,"children":475},{"style":405},[476],{"type":60,"value":423},{"type":55,"tag":388,"props":478,"children":479},{"style":405},[480],{"type":60,"value":446},{"type":55,"tag":388,"props":482,"children":483},{"style":405},[484],{"type":60,"value":413},{"type":55,"tag":388,"props":486,"children":487},{"style":416},[488],{"type":60,"value":489},"limit",{"type":55,"tag":388,"props":491,"children":492},{"style":405},[493],{"type":60,"value":423},{"type":55,"tag":388,"props":495,"children":496},{"style":405},[497],{"type":60,"value":305},{"type":55,"tag":388,"props":499,"children":501},{"style":500},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[502],{"type":60,"value":503}," 100",{"type":55,"tag":388,"props":505,"children":506},{"style":405},[507],{"type":60,"value":508}," }\n",{"type":55,"tag":63,"props":510,"children":511},{},[512,514,520,522,528,529,534,535,541,543,549,550,556,557,563,565,571,573,579,581,587,589,595,597,602,604,610],{"type":60,"value":513},"Each row: ",{"type":55,"tag":69,"props":515,"children":517},{"className":516},[],[518],{"type":60,"value":519},"session_id",{"type":60,"value":521},", ",{"type":55,"tag":69,"props":523,"children":525},{"className":524},[],[526],{"type":60,"value":527},"tool_calls",{"type":60,"value":521},{"type":55,"tag":69,"props":530,"children":532},{"className":531},[],[533],{"type":60,"value":295},{"type":60,"value":521},{"type":55,"tag":69,"props":536,"children":538},{"className":537},[],[539],{"type":60,"value":540},"session_end",{"type":60,"value":542},",\n",{"type":55,"tag":69,"props":544,"children":546},{"className":545},[],[547],{"type":60,"value":548},"tools_used",{"type":60,"value":521},{"type":55,"tag":69,"props":551,"children":553},{"className":552},[],[554],{"type":60,"value":555},"mcp_client_name",{"type":60,"value":521},{"type":55,"tag":69,"props":558,"children":560},{"className":559},[],[561],{"type":60,"value":562},"distinct_id",{"type":60,"value":564}," (+ resolved ",{"type":55,"tag":69,"props":566,"children":568},{"className":567},[],[569],{"type":60,"value":570},"person_email",{"type":60,"value":572}," \u002F\n",{"type":55,"tag":69,"props":574,"children":576},{"className":575},[],[577],{"type":60,"value":578},"person_name",{"type":60,"value":580},"), and ",{"type":55,"tag":69,"props":582,"children":584},{"className":583},[],[585],{"type":60,"value":586},"intent",{"type":60,"value":588}," (empty until generated). Response is\n",{"type":55,"tag":69,"props":590,"children":592},{"className":591},[],[593],{"type":60,"value":594},"{ results, has_next }",{"type":60,"value":596}," — page with ",{"type":55,"tag":69,"props":598,"children":600},{"className":599},[],[601],{"type":60,"value":489},{"type":60,"value":603}," \u002F ",{"type":55,"tag":69,"props":605,"children":607},{"className":606},[],[608],{"type":60,"value":609},"offset",{"type":60,"value":92},{"type":55,"tag":63,"props":612,"children":613},{},[614],{"type":60,"value":615},"Three sharp edges:",{"type":55,"tag":307,"props":617,"children":618},{},[619,715,725],{"type":55,"tag":311,"props":620,"children":621},{},[622,632,634,640,642,647,649,655,657,662,664,669,670,675,676,681,682,687,688,693,694,699,700,705,707,713],{"type":55,"tag":99,"props":623,"children":624},{},[625,630],{"type":55,"tag":69,"props":626,"children":628},{"className":627},[],[629],{"type":60,"value":455},{"type":60,"value":631}," takes column names, not response field names.",{"type":60,"value":633}," Sort call volume\nas ",{"type":55,"tag":69,"props":635,"children":637},{"className":636},[],[638],{"type":60,"value":639},"tool_call_count",{"type":60,"value":641}," (not ",{"type":55,"tag":69,"props":643,"children":645},{"className":644},[],[646],{"type":60,"value":527},{"type":60,"value":648},"). ",{"type":55,"tag":69,"props":650,"children":652},{"className":651},[],[653],{"type":60,"value":654},"duration_seconds",{"type":60,"value":656}," sorts fine even\nthough it isn't returned. An unrecognised key ",{"type":55,"tag":99,"props":658,"children":659},{},[660],{"type":60,"value":661},"silently",{"type":60,"value":663}," falls back to\nnewest-first — so verify the order you got is the order you asked for. Valid:\n",{"type":55,"tag":69,"props":665,"children":667},{"className":666},[],[668],{"type":60,"value":519},{"type":60,"value":521},{"type":55,"tag":69,"props":671,"children":673},{"className":672},[],[674],{"type":60,"value":295},{"type":60,"value":521},{"type":55,"tag":69,"props":677,"children":679},{"className":678},[],[680],{"type":60,"value":540},{"type":60,"value":521},{"type":55,"tag":69,"props":683,"children":685},{"className":684},[],[686],{"type":60,"value":654},{"type":60,"value":542},{"type":55,"tag":69,"props":689,"children":691},{"className":690},[],[692],{"type":60,"value":639},{"type":60,"value":521},{"type":55,"tag":69,"props":695,"children":697},{"className":696},[],[698],{"type":60,"value":555},{"type":60,"value":521},{"type":55,"tag":69,"props":701,"children":703},{"className":702},[],[704],{"type":60,"value":562},{"type":60,"value":706},"; prefix ",{"type":55,"tag":69,"props":708,"children":710},{"className":709},[],[711],{"type":60,"value":712},"-",{"type":60,"value":714}," to descend.",{"type":55,"tag":311,"props":716,"children":717},{},[718,723],{"type":55,"tag":99,"props":719,"children":720},{},[721],{"type":60,"value":722},"There is no error filter and no error count on a session row.",{"type":60,"value":724}," \"Which\nsessions had errors?\" is a SQL question — see below.",{"type":55,"tag":311,"props":726,"children":727},{},[728,746],{"type":55,"tag":99,"props":729,"children":730},{},[731,737,739,745],{"type":55,"tag":69,"props":732,"children":734},{"className":733},[],[735],{"type":60,"value":736},"distinct_id_count",{"type":60,"value":738}," is always ",{"type":55,"tag":69,"props":740,"children":742},{"className":741},[],[743],{"type":60,"value":744},"0",{"type":60,"value":92},{"type":60,"value":747}," The field is in the response but the\nbackend never populates it, so don't read it as \"one distinct id per session\"\n— it says nothing. To count distinct ids in a session, use SQL.",{"type":55,"tag":63,"props":749,"children":750},{},[751,757,759,764,765,770,771,776,778,783],{"type":55,"tag":69,"props":752,"children":754},{"className":753},[],[755],{"type":60,"value":756},"search",{"type":60,"value":758}," does a case-insensitive substring match across ",{"type":55,"tag":69,"props":760,"children":762},{"className":761},[],[763],{"type":60,"value":519},{"type":60,"value":542},{"type":55,"tag":69,"props":766,"children":768},{"className":767},[],[769],{"type":60,"value":562},{"type":60,"value":521},{"type":55,"tag":69,"props":772,"children":774},{"className":773},[],[775],{"type":60,"value":555},{"type":60,"value":777},", and ",{"type":55,"tag":69,"props":779,"children":781},{"className":780},[],[782],{"type":60,"value":548},{"type":60,"value":92},{"type":55,"tag":135,"props":785,"children":787},{"id":786},"workflow-read-one-sessions-tool-calls",[788],{"type":60,"value":789},"Workflow: read one session's tool calls",{"type":55,"tag":377,"props":791,"children":793},{"className":379,"code":792,"language":381,"meta":382,"style":382},"posthog:mcp-analytics-sessions-tool-calls\n{ \"id\": \"\u003Csession_id>\", \"date_from\": \"\u003Csession_start>\", \"limit\": 500 }\n",[794],{"type":55,"tag":69,"props":795,"children":796},{"__ignoreMap":382},[797,805],{"type":55,"tag":388,"props":798,"children":799},{"class":390,"line":391},[800],{"type":55,"tag":388,"props":801,"children":802},{"style":395},[803],{"type":60,"value":804},"posthog:mcp-analytics-sessions-tool-calls\n",{"type":55,"tag":388,"props":806,"children":807},{"class":390,"line":401},[808,812,816,821,825,829,833,838,842,846,850,854,858,862,866,871,875,879,883,887,891,895,900],{"type":55,"tag":388,"props":809,"children":810},{"style":405},[811],{"type":60,"value":408},{"type":55,"tag":388,"props":813,"children":814},{"style":405},[815],{"type":60,"value":413},{"type":55,"tag":388,"props":817,"children":818},{"style":416},[819],{"type":60,"value":820},"id",{"type":55,"tag":388,"props":822,"children":823},{"style":405},[824],{"type":60,"value":423},{"type":55,"tag":388,"props":826,"children":827},{"style":405},[828],{"type":60,"value":305},{"type":55,"tag":388,"props":830,"children":831},{"style":405},[832],{"type":60,"value":413},{"type":55,"tag":388,"props":834,"children":835},{"style":434},[836],{"type":60,"value":837},"\u003Csession_id>",{"type":55,"tag":388,"props":839,"children":840},{"style":405},[841],{"type":60,"value":423},{"type":55,"tag":388,"props":843,"children":844},{"style":405},[845],{"type":60,"value":446},{"type":55,"tag":388,"props":847,"children":848},{"style":405},[849],{"type":60,"value":413},{"type":55,"tag":388,"props":851,"children":852},{"style":416},[853],{"type":60,"value":303},{"type":55,"tag":388,"props":855,"children":856},{"style":405},[857],{"type":60,"value":423},{"type":55,"tag":388,"props":859,"children":860},{"style":405},[861],{"type":60,"value":305},{"type":55,"tag":388,"props":863,"children":864},{"style":405},[865],{"type":60,"value":413},{"type":55,"tag":388,"props":867,"children":868},{"style":434},[869],{"type":60,"value":870},"\u003Csession_start>",{"type":55,"tag":388,"props":872,"children":873},{"style":405},[874],{"type":60,"value":423},{"type":55,"tag":388,"props":876,"children":877},{"style":405},[878],{"type":60,"value":446},{"type":55,"tag":388,"props":880,"children":881},{"style":405},[882],{"type":60,"value":413},{"type":55,"tag":388,"props":884,"children":885},{"style":416},[886],{"type":60,"value":489},{"type":55,"tag":388,"props":888,"children":889},{"style":405},[890],{"type":60,"value":423},{"type":55,"tag":388,"props":892,"children":893},{"style":405},[894],{"type":60,"value":305},{"type":55,"tag":388,"props":896,"children":897},{"style":500},[898],{"type":60,"value":899}," 500",{"type":55,"tag":388,"props":901,"children":902},{"style":405},[903],{"type":60,"value":508},{"type":55,"tag":63,"props":905,"children":906},{},[907,909,915,916,921,922,927,928,934,935,941,942,948,950,955,957,963],{"type":60,"value":908},"Chronological ",{"type":55,"tag":69,"props":910,"children":912},{"className":911},[],[913],{"type":60,"value":914},"tool_name",{"type":60,"value":521},{"type":55,"tag":69,"props":917,"children":919},{"className":918},[],[920],{"type":60,"value":586},{"type":60,"value":521},{"type":55,"tag":69,"props":923,"children":925},{"className":924},[],[926],{"type":60,"value":90},{"type":60,"value":521},{"type":55,"tag":69,"props":929,"children":931},{"className":930},[],[932],{"type":60,"value":933},"duration_ms",{"type":60,"value":521},{"type":55,"tag":69,"props":936,"children":938},{"className":937},[],[939],{"type":60,"value":940},"is_error",{"type":60,"value":542},{"type":55,"tag":69,"props":943,"children":945},{"className":944},[],[946],{"type":60,"value":947},"error_message",{"type":60,"value":949}," — read top to bottom to reconstruct the run. ",{"type":55,"tag":69,"props":951,"children":953},{"className":952},[],[954],{"type":60,"value":489},{"type":60,"value":956}," defaults to\n500 (also the max), which is the whole page for almost every session; ",{"type":55,"tag":69,"props":958,"children":960},{"className":959},[],[961],{"type":60,"value":962},"has_next",{"type":60,"value":964},"\ntells you if more remain.",{"type":55,"tag":63,"props":966,"children":967},{},[968,987,989,994],{"type":55,"tag":99,"props":969,"children":970},{},[971,973,978,980,986],{"type":60,"value":972},"Caveat: ",{"type":55,"tag":69,"props":974,"children":976},{"className":975},[],[977],{"type":60,"value":914},{"type":60,"value":979}," here is the raw ",{"type":55,"tag":69,"props":981,"children":983},{"className":982},[],[984],{"type":60,"value":985},"$mcp_tool_name",{"type":60,"value":92},{"type":60,"value":988}," Unlike the tool-quality\nand tool-detail tools, this endpoint does not resolve the inner tool of a\nsingle-exec wrapper call, so wrapper calls show the wrapper. When the inner tool\nis what matters (comparing against a tool-quality ranking, tracing a specific\ntool through a run), use the SQL recipe below instead. The same applies to\n",{"type":55,"tag":69,"props":990,"children":992},{"className":991},[],[993],{"type":60,"value":548},{"type":60,"value":995}," on the session list.",{"type":55,"tag":135,"props":997,"children":999},{"id":998},"workflow-summarise-the-agents-goal",[1000],{"type":60,"value":1001},"Workflow: summarise the agent's goal",{"type":55,"tag":377,"props":1003,"children":1005},{"className":379,"code":1004,"language":381,"meta":382,"style":382},"posthog:mcp-analytics-sessions-generate-intent\n{ \"id\": \"\u003Csession_id>\", \"date_from\": \"\u003Csession_start>\" }\n",[1006],{"type":55,"tag":69,"props":1007,"children":1008},{"__ignoreMap":382},[1009,1017],{"type":55,"tag":388,"props":1010,"children":1011},{"class":390,"line":391},[1012],{"type":55,"tag":388,"props":1013,"children":1014},{"style":395},[1015],{"type":60,"value":1016},"posthog:mcp-analytics-sessions-generate-intent\n",{"type":55,"tag":388,"props":1018,"children":1019},{"class":390,"line":401},[1020,1024,1028,1032,1036,1040,1044,1048,1052,1056,1060,1064,1068,1072,1076,1080,1084],{"type":55,"tag":388,"props":1021,"children":1022},{"style":405},[1023],{"type":60,"value":408},{"type":55,"tag":388,"props":1025,"children":1026},{"style":405},[1027],{"type":60,"value":413},{"type":55,"tag":388,"props":1029,"children":1030},{"style":416},[1031],{"type":60,"value":820},{"type":55,"tag":388,"props":1033,"children":1034},{"style":405},[1035],{"type":60,"value":423},{"type":55,"tag":388,"props":1037,"children":1038},{"style":405},[1039],{"type":60,"value":305},{"type":55,"tag":388,"props":1041,"children":1042},{"style":405},[1043],{"type":60,"value":413},{"type":55,"tag":388,"props":1045,"children":1046},{"style":434},[1047],{"type":60,"value":837},{"type":55,"tag":388,"props":1049,"children":1050},{"style":405},[1051],{"type":60,"value":423},{"type":55,"tag":388,"props":1053,"children":1054},{"style":405},[1055],{"type":60,"value":446},{"type":55,"tag":388,"props":1057,"children":1058},{"style":405},[1059],{"type":60,"value":413},{"type":55,"tag":388,"props":1061,"children":1062},{"style":416},[1063],{"type":60,"value":303},{"type":55,"tag":388,"props":1065,"children":1066},{"style":405},[1067],{"type":60,"value":423},{"type":55,"tag":388,"props":1069,"children":1070},{"style":405},[1071],{"type":60,"value":305},{"type":55,"tag":388,"props":1073,"children":1074},{"style":405},[1075],{"type":60,"value":413},{"type":55,"tag":388,"props":1077,"children":1078},{"style":434},[1079],{"type":60,"value":870},{"type":55,"tag":388,"props":1081,"children":1082},{"style":405},[1083],{"type":60,"value":423},{"type":55,"tag":388,"props":1085,"children":1086},{"style":405},[1087],{"type":60,"value":508},{"type":55,"tag":63,"props":1089,"children":1090},{},[1091,1093,1099,1101,1107,1109,1114],{"type":60,"value":1092},"Summarises the session's recorded ",{"type":55,"tag":69,"props":1094,"children":1096},{"className":1095},[],[1097],{"type":60,"value":1098},"$mcp_intent",{"type":60,"value":1100}," values via an LLM and persists\nthe result; later calls return the cached summary. Returns\n",{"type":55,"tag":69,"props":1102,"children":1104},{"className":1103},[],[1105],{"type":60,"value":1106},"{ session_id, intent }",{"type":60,"value":1108},". A 503 means LLM summarisation isn't configured — fall\nback to reading the raw ",{"type":55,"tag":69,"props":1110,"children":1112},{"className":1111},[],[1113],{"type":60,"value":1098},{"type":60,"value":1115}," values from the tool-call list.",{"type":55,"tag":135,"props":1117,"children":1119},{"id":1118},"when-to-drop-to-sql",[1120],{"type":60,"value":112},{"type":55,"tag":63,"props":1122,"children":1123},{},[1124,1126,1131,1133,1138,1140,1145],{"type":60,"value":1125},"Four cases, all via ",{"type":55,"tag":69,"props":1127,"children":1129},{"className":1128},[],[1130],{"type":60,"value":231},{"type":60,"value":1132},", which — unlike the typed tools above —\nis ",{"type":55,"tag":99,"props":1134,"children":1135},{},[1136],{"type":60,"value":1137},"not",{"type":60,"value":1139}," gated behind the ",{"type":55,"tag":69,"props":1141,"children":1143},{"className":1142},[],[1144],{"type":60,"value":255},{"type":60,"value":1146}," flag.",{"type":55,"tag":63,"props":1148,"children":1149},{},[1150,1161],{"type":55,"tag":99,"props":1151,"children":1152},{},[1153,1155,1160],{"type":60,"value":1154},"1. The project doesn't have the ",{"type":55,"tag":69,"props":1156,"children":1158},{"className":1157},[],[1159],{"type":60,"value":255},{"type":60,"value":1146},{"type":60,"value":1162}," The typed tools simply\nwon't be in your tool list. Everything below still works; this query is the\nplain session listing:",{"type":55,"tag":377,"props":1164,"children":1168},{"className":1165,"code":1166,"language":1167,"meta":382,"style":382},"language-sql shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","SELECT\n    $session_id AS session_id,\n    min(timestamp) AS session_start,\n    max(timestamp) AS session_end,\n    dateDiff('second', min(timestamp), max(timestamp)) AS duration_seconds,\n    count() AS tool_calls,\n    countIf(toBool(properties.$mcp_is_error)) AS errors,\n    any(properties.$mcp_client_name) AS client\nFROM events\nWHERE event = '$mcp_tool_call'\n    AND $session_id != ''\n    AND timestamp >= now() - INTERVAL 7 DAY\nGROUP BY session_id\nORDER BY session_start DESC\nLIMIT 50\n","sql",[1169],{"type":55,"tag":69,"props":1170,"children":1171},{"__ignoreMap":382},[1172,1180,1188,1197,1206,1215,1224,1233,1242,1251,1260,1269,1278,1287,1296],{"type":55,"tag":388,"props":1173,"children":1174},{"class":390,"line":391},[1175],{"type":55,"tag":388,"props":1176,"children":1177},{},[1178],{"type":60,"value":1179},"SELECT\n",{"type":55,"tag":388,"props":1181,"children":1182},{"class":390,"line":401},[1183],{"type":55,"tag":388,"props":1184,"children":1185},{},[1186],{"type":60,"value":1187},"    $session_id AS session_id,\n",{"type":55,"tag":388,"props":1189,"children":1191},{"class":390,"line":1190},3,[1192],{"type":55,"tag":388,"props":1193,"children":1194},{},[1195],{"type":60,"value":1196},"    min(timestamp) AS session_start,\n",{"type":55,"tag":388,"props":1198,"children":1200},{"class":390,"line":1199},4,[1201],{"type":55,"tag":388,"props":1202,"children":1203},{},[1204],{"type":60,"value":1205},"    max(timestamp) AS session_end,\n",{"type":55,"tag":388,"props":1207,"children":1209},{"class":390,"line":1208},5,[1210],{"type":55,"tag":388,"props":1211,"children":1212},{},[1213],{"type":60,"value":1214},"    dateDiff('second', min(timestamp), max(timestamp)) AS duration_seconds,\n",{"type":55,"tag":388,"props":1216,"children":1218},{"class":390,"line":1217},6,[1219],{"type":55,"tag":388,"props":1220,"children":1221},{},[1222],{"type":60,"value":1223},"    count() AS tool_calls,\n",{"type":55,"tag":388,"props":1225,"children":1227},{"class":390,"line":1226},7,[1228],{"type":55,"tag":388,"props":1229,"children":1230},{},[1231],{"type":60,"value":1232},"    countIf(toBool(properties.$mcp_is_error)) AS errors,\n",{"type":55,"tag":388,"props":1234,"children":1236},{"class":390,"line":1235},8,[1237],{"type":55,"tag":388,"props":1238,"children":1239},{},[1240],{"type":60,"value":1241},"    any(properties.$mcp_client_name) AS client\n",{"type":55,"tag":388,"props":1243,"children":1245},{"class":390,"line":1244},9,[1246],{"type":55,"tag":388,"props":1247,"children":1248},{},[1249],{"type":60,"value":1250},"FROM events\n",{"type":55,"tag":388,"props":1252,"children":1254},{"class":390,"line":1253},10,[1255],{"type":55,"tag":388,"props":1256,"children":1257},{},[1258],{"type":60,"value":1259},"WHERE event = '$mcp_tool_call'\n",{"type":55,"tag":388,"props":1261,"children":1263},{"class":390,"line":1262},11,[1264],{"type":55,"tag":388,"props":1265,"children":1266},{},[1267],{"type":60,"value":1268},"    AND $session_id != ''\n",{"type":55,"tag":388,"props":1270,"children":1272},{"class":390,"line":1271},12,[1273],{"type":55,"tag":388,"props":1274,"children":1275},{},[1276],{"type":60,"value":1277},"    AND timestamp >= now() - INTERVAL 7 DAY\n",{"type":55,"tag":388,"props":1279,"children":1281},{"class":390,"line":1280},13,[1282],{"type":55,"tag":388,"props":1283,"children":1284},{},[1285],{"type":60,"value":1286},"GROUP BY session_id\n",{"type":55,"tag":388,"props":1288,"children":1290},{"class":390,"line":1289},14,[1291],{"type":55,"tag":388,"props":1292,"children":1293},{},[1294],{"type":60,"value":1295},"ORDER BY session_start DESC\n",{"type":55,"tag":388,"props":1297,"children":1299},{"class":390,"line":1298},15,[1300],{"type":55,"tag":388,"props":1301,"children":1302},{},[1303],{"type":60,"value":1304},"LIMIT 50\n",{"type":55,"tag":63,"props":1306,"children":1307},{},[1308,1313,1315,1321,1323,1329],{"type":55,"tag":99,"props":1309,"children":1310},{},[1311],{"type":60,"value":1312},"2. Errored sessions.",{"type":60,"value":1314}," The session list can't filter or count errors — add\n",{"type":55,"tag":69,"props":1316,"children":1318},{"className":1317},[],[1319],{"type":60,"value":1320},"HAVING errors > 0",{"type":60,"value":1322}," to the query above and order by ",{"type":55,"tag":69,"props":1324,"children":1326},{"className":1325},[],[1327],{"type":60,"value":1328},"errors DESC",{"type":60,"value":92},{"type":55,"tag":63,"props":1331,"children":1332},{},[1333,1338],{"type":55,"tag":99,"props":1334,"children":1335},{},[1336],{"type":60,"value":1337},"3. Effective tool names within a session",{"type":60,"value":1339}," — the coalesce the typed tool-calls\nendpoint doesn't apply:",{"type":55,"tag":377,"props":1341,"children":1343},{"className":1165,"code":1342,"language":1167,"meta":382,"style":382},"SELECT\n    timestamp,\n    coalesce(nullIf(toString(properties.$mcp_exec_tool_call_name), ''), toString(properties.$mcp_tool_name)) AS tool,\n    toBool(properties.$mcp_is_error) AS is_error,\n    toString(properties.$mcp_error_message) AS error_message,\n    round(toFloat(properties.$mcp_duration_ms)) AS duration_ms\nFROM events\nWHERE event = '$mcp_tool_call'\n    AND $session_id = '\u003Csession_id>'\nORDER BY timestamp ASC\n",[1344],{"type":55,"tag":69,"props":1345,"children":1346},{"__ignoreMap":382},[1347,1354,1362,1370,1378,1386,1394,1401,1408,1416],{"type":55,"tag":388,"props":1348,"children":1349},{"class":390,"line":391},[1350],{"type":55,"tag":388,"props":1351,"children":1352},{},[1353],{"type":60,"value":1179},{"type":55,"tag":388,"props":1355,"children":1356},{"class":390,"line":401},[1357],{"type":55,"tag":388,"props":1358,"children":1359},{},[1360],{"type":60,"value":1361},"    timestamp,\n",{"type":55,"tag":388,"props":1363,"children":1364},{"class":390,"line":1190},[1365],{"type":55,"tag":388,"props":1366,"children":1367},{},[1368],{"type":60,"value":1369},"    coalesce(nullIf(toString(properties.$mcp_exec_tool_call_name), ''), toString(properties.$mcp_tool_name)) AS tool,\n",{"type":55,"tag":388,"props":1371,"children":1372},{"class":390,"line":1199},[1373],{"type":55,"tag":388,"props":1374,"children":1375},{},[1376],{"type":60,"value":1377},"    toBool(properties.$mcp_is_error) AS is_error,\n",{"type":55,"tag":388,"props":1379,"children":1380},{"class":390,"line":1208},[1381],{"type":55,"tag":388,"props":1382,"children":1383},{},[1384],{"type":60,"value":1385},"    toString(properties.$mcp_error_message) AS error_message,\n",{"type":55,"tag":388,"props":1387,"children":1388},{"class":390,"line":1217},[1389],{"type":55,"tag":388,"props":1390,"children":1391},{},[1392],{"type":60,"value":1393},"    round(toFloat(properties.$mcp_duration_ms)) AS duration_ms\n",{"type":55,"tag":388,"props":1395,"children":1396},{"class":390,"line":1226},[1397],{"type":55,"tag":388,"props":1398,"children":1399},{},[1400],{"type":60,"value":1250},{"type":55,"tag":388,"props":1402,"children":1403},{"class":390,"line":1235},[1404],{"type":55,"tag":388,"props":1405,"children":1406},{},[1407],{"type":60,"value":1259},{"type":55,"tag":388,"props":1409,"children":1410},{"class":390,"line":1244},[1411],{"type":55,"tag":388,"props":1412,"children":1413},{},[1414],{"type":60,"value":1415},"    AND $session_id = '\u003Csession_id>'\n",{"type":55,"tag":388,"props":1417,"children":1418},{"class":390,"line":1253},[1419],{"type":55,"tag":388,"props":1420,"children":1421},{},[1422],{"type":60,"value":1423},"ORDER BY timestamp ASC\n",{"type":55,"tag":63,"props":1425,"children":1426},{},[1427,1432,1434,1442],{"type":55,"tag":99,"props":1428,"children":1429},{},[1430],{"type":60,"value":1431},"4. Cross-session aggregation",{"type":60,"value":1433}," — \"sessions per day\", \"sessions that used tool\nX and then failed\", custom breakdowns. Recipes in\n",{"type":55,"tag":107,"props":1435,"children":1436},{"href":125},[1437],{"type":55,"tag":69,"props":1438,"children":1440},{"className":1439},[],[1441],{"type":60,"value":132},{"type":60,"value":92},{"type":55,"tag":63,"props":1444,"children":1445},{},[1446,1448,1453,1455,1460,1462,1468,1470,1476,1478,1484,1486,1492,1494,1500],{"type":60,"value":1447},"Note ",{"type":55,"tag":69,"props":1449,"children":1451},{"className":1450},[],[1452],{"type":60,"value":82},{"type":60,"value":1454}," is a ",{"type":55,"tag":99,"props":1456,"children":1457},{},[1458],{"type":60,"value":1459},"materialised events column",{"type":60,"value":1461}," — the same id as\n",{"type":55,"tag":69,"props":1463,"children":1465},{"className":1464},[],[1466],{"type":60,"value":1467},"$mcp_session_id",{"type":60,"value":1469},". Reference it bare, never as ",{"type":55,"tag":69,"props":1471,"children":1473},{"className":1472},[],[1474],{"type":60,"value":1475},"properties.$session_id",{"type":60,"value":1477},": the\n",{"type":55,"tag":69,"props":1479,"children":1481},{"className":1480},[],[1482],{"type":60,"value":1483},"properties.",{"type":60,"value":1485}," accessor renders null-wrapped in SELECT but as the raw column in\nHAVING\u002FORDER, so a ",{"type":55,"tag":69,"props":1487,"children":1489},{"className":1488},[],[1490],{"type":60,"value":1491},"HAVING",{"type":60,"value":1493}," search would mismatch the ",{"type":55,"tag":69,"props":1495,"children":1497},{"className":1496},[],[1498],{"type":60,"value":1499},"GROUP BY",{"type":60,"value":1501}," key.",{"type":55,"tag":135,"props":1503,"children":1505},{"id":1504},"constructing-ui-links",[1506],{"type":60,"value":1507},"Constructing UI links",{"type":55,"tag":307,"props":1509,"children":1510},{},[1511],{"type":55,"tag":311,"props":1512,"children":1513},{},[1514,1519,1521],{"type":55,"tag":99,"props":1515,"children":1516},{},[1517],{"type":60,"value":1518},"Sessions list",{"type":60,"value":1520},": ",{"type":55,"tag":69,"props":1522,"children":1524},{"className":1523},[],[1525],{"type":60,"value":1526},"https:\u002F\u002Fapp.posthog.com\u002Fproject\u002F\u003Cproject_id>\u002Fmcp-analytics\u002Fsessions",{"type":55,"tag":135,"props":1528,"children":1530},{"id":1529},"tips",[1531],{"type":60,"value":1532},"Tips",{"type":55,"tag":307,"props":1534,"children":1535},{},[1536,1541,1551],{"type":55,"tag":311,"props":1537,"children":1538},{},[1539],{"type":60,"value":1540},"A session with many calls but no errors that ends abruptly often means the\nagent gave up — check whether the last call returned a large or empty result",{"type":55,"tag":311,"props":1542,"children":1543},{},[1544,1549],{"type":55,"tag":69,"props":1545,"children":1547},{"className":1546},[],[1548],{"type":60,"value":1098},{"type":60,"value":1550}," is only present when the client supplied it; absence is common,\nso generate-intent is the more reliable goal signal",{"type":55,"tag":311,"props":1552,"children":1553},{},[1554,1556,1566,1568,1573,1575,1580],{"type":60,"value":1555},"To go from a failing tool (see\n",{"type":55,"tag":107,"props":1557,"children":1559},{"href":1558},"..\u002Fexploring-mcp-tool-quality\u002FSKILL.md",[1560],{"type":55,"tag":69,"props":1561,"children":1563},{"className":1562},[],[1564],{"type":60,"value":1565},"exploring-mcp-tool-quality",{"type":60,"value":1567},") to the\nsessions that hit it, ",{"type":55,"tag":69,"props":1569,"children":1571},{"className":1570},[],[1572],{"type":60,"value":756},{"type":60,"value":1574}," the session list by tool name — remembering\n",{"type":55,"tag":69,"props":1576,"children":1578},{"className":1577},[],[1579],{"type":60,"value":548},{"type":60,"value":1581}," holds raw names, so search the registered name, not the inner one",{"type":55,"tag":135,"props":1583,"children":1585},{"id":1584},"related-skills",[1586],{"type":60,"value":1587},"Related skills",{"type":55,"tag":307,"props":1589,"children":1590},{},[1591,1606,1619],{"type":55,"tag":311,"props":1592,"children":1593},{},[1594,1604],{"type":55,"tag":107,"props":1595,"children":1597},{"href":1596},"..\u002Fexploring-mcp-tool-usage\u002FSKILL.md",[1598],{"type":55,"tag":69,"props":1599,"children":1601},{"className":1600},[],[1602],{"type":60,"value":1603},"exploring-mcp-tool-usage",{"type":60,"value":1605}," — the front\ndoor: routes a broad \"how is my MCP doing?\" question to the right tool",{"type":55,"tag":311,"props":1607,"children":1608},{},[1609,1617],{"type":55,"tag":107,"props":1610,"children":1611},{"href":1558},[1612],{"type":55,"tag":69,"props":1613,"children":1615},{"className":1614},[],[1616],{"type":60,"value":1565},{"type":60,"value":1618}," — error\nrates and latency across all tools",{"type":55,"tag":311,"props":1620,"children":1621},{},[1622,1632],{"type":55,"tag":107,"props":1623,"children":1625},{"href":1624},"..\u002Fexploring-mcp-intent-clusters\u002FSKILL.md",[1626],{"type":55,"tag":69,"props":1627,"children":1629},{"className":1628},[],[1630],{"type":60,"value":1631},"exploring-mcp-intent-clusters",{"type":60,"value":1633}," —\ngroup goals across many sessions",{"type":55,"tag":1635,"props":1636,"children":1637},"style",{},[1638],{"type":60,"value":1639},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":1641,"total":1737},[1642,1656,1668,1680,1693,1706,1722],{"slug":1643,"name":1643,"fn":1644,"description":1645,"org":1646,"tags":1647,"stars":23,"repoUrl":24,"updatedAt":1655},"analyzing-expensive-users","analyze expensive users in AI observability","Analyze the most expensive users in AI observability and explain why they cost so much. Use when the user asks about top spenders, expensive users, per-user LLM cost, user-level cost drivers, or patterns behind high AI observability spend.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1648,1650,1653,1654],{"name":1649,"slug":31,"type":15},"Analytics",{"name":1651,"slug":1652,"type":15},"Cost Optimization","cost-optimization",{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},"2026-07-28T05:34:11.117757",{"slug":1657,"name":1657,"fn":1658,"description":1659,"org":1660,"tags":1661,"stars":23,"repoUrl":24,"updatedAt":1667},"auditing-endpoints","audit PostHog project endpoints","Audit every endpoint in a PostHog project for staleness, failed materialisations, and unused materialised versions. Use when the user asks \"what endpoints can I clean up?\", \"are any of my endpoints broken?\", \"which materialised versions are still being called?\", or wants a one-shot cleanup pass over the Endpoints product. Produces a prioritised report grouped by issue type, with recommended actions but does not modify anything without explicit confirmation.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1662,1663,1666],{"name":1649,"slug":31,"type":15},{"name":1664,"slug":1665,"type":15},"Audit","audit",{"name":9,"slug":8,"type":15},"2026-06-08T08:08:33.693989",{"slug":1669,"name":1669,"fn":1670,"description":1671,"org":1672,"tags":1673,"stars":23,"repoUrl":24,"updatedAt":1679},"auditing-warehouse-source-health","audit PostHog data warehouse source health","Audit the health of a PostHog project's data warehouse sources and syncs — find every broken or degraded source connection, sync schema, and webhook channel. Use when the user asks \"why are my imports failing?\", \"what's broken with my sources?\", \"why is my warehouse data stale?\", or wants a one-shot triage of source\u002Fsync health before deciding where to dig in. Produces a prioritized report grouped by severity, with recommended next steps. For materialized-view health use `auditing-warehouse-view-health`; for a single failing sync use `diagnosing-failed-warehouse-syncs`.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1674,1675,1677,1678],{"name":1664,"slug":1665,"type":15},{"name":1676,"slug":33,"type":15},"Data Warehouse",{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},"2026-06-18T08:22:57.67984",{"slug":1681,"name":1681,"fn":1682,"description":1683,"org":1684,"tags":1685,"stars":23,"repoUrl":24,"updatedAt":1692},"auditing-warehouse-view-health","audit PostHog materialized view health","Audit the health of a PostHog project's materialized views (saved queries) — find every failed materialization and flag unused or stale materialized views that cost storage and compute. Use when the user asks \"which of my views are broken?\", \"why is this materialized view failing?\", \"are any of my views wasting compute?\", or wants a one-shot triage of view health. For source\u002Fsync health use `auditing-warehouse-source-health`.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1686,1687,1688,1691],{"name":1664,"slug":1665,"type":15},{"name":1676,"slug":33,"type":15},{"name":1689,"slug":1690,"type":15},"Performance","performance",{"name":9,"slug":8,"type":15},"2026-06-18T08:25:10.936787",{"slug":1694,"name":1694,"fn":1695,"description":1696,"org":1697,"tags":1698,"stars":23,"repoUrl":24,"updatedAt":1705},"authoring-error-tracking-alerts","author PostHog error tracking alerts","Author error tracking alerts that fire when an issue is created, reopened, or starts spiking. Use when the user asks to set up error notifications, route exceptions to Slack\u002Fwebhook\u002FLinear, or evaluate which error events are worth alerting on. Covers trigger-event selection, integration choice, dedup against existing alerts, and shipping with the canonical message body shape.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1699,1702,1703,1704],{"name":1700,"slug":1701,"type":15},"Alerting","alerting",{"name":21,"slug":22,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},"2026-06-18T08:24:40.318583",{"slug":1707,"name":1707,"fn":1708,"description":1709,"org":1710,"tags":1711,"stars":23,"repoUrl":24,"updatedAt":1721},"authoring-log-alerts","author log alerts in PostHog","Author useful, low-noise log alerts on services in a PostHog project. Use when the user asks to set up alerts for their logs, suggest alerts they should add, or evaluate whether a service is worth monitoring. Covers service triage, baseline characterisation, threshold drafting, back-testing via simulate, and shipping with a notification destination.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1712,1713,1716,1717,1720],{"name":1649,"slug":31,"type":15},{"name":1714,"slug":1715,"type":15},"Monitoring","monitoring",{"name":13,"slug":14,"type":15},{"name":1718,"slug":1719,"type":15},"Operations","operations",{"name":9,"slug":8,"type":15},"2026-07-18T05:10:54.430898",{"slug":1723,"name":1723,"fn":1724,"description":1725,"org":1726,"tags":1727,"stars":23,"repoUrl":24,"updatedAt":1736},"building-workflows","build and edit PostHog workflows","Build, edit, test, enable, and monitor PostHog workflows over MCP. Author the action\u002Fedge graph so it runs and opens cleanly in the visual editor, then change drafts surgically with patch operations. Use when asked to build, set up, automate, change, fix, or debug a workflow, campaign, broadcast, drip sequence, or event-triggered automation in the workflows product.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1728,1731,1732,1733],{"name":1729,"slug":1730,"type":15},"Automation","automation",{"name":18,"slug":19,"type":15},{"name":9,"slug":8,"type":15},{"name":1734,"slug":1735,"type":15},"Workflow Automation","workflow-automation","2026-07-28T05:34:12.167015",61,{"items":1739,"total":1856},[1740,1747,1753,1760,1767,1774,1782,1789,1803,1818,1828,1846],{"slug":1643,"name":1643,"fn":1644,"description":1645,"org":1741,"tags":1742,"stars":23,"repoUrl":24,"updatedAt":1655},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1743,1744,1745,1746],{"name":1649,"slug":31,"type":15},{"name":1651,"slug":1652,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"slug":1657,"name":1657,"fn":1658,"description":1659,"org":1748,"tags":1749,"stars":23,"repoUrl":24,"updatedAt":1667},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1750,1751,1752],{"name":1649,"slug":31,"type":15},{"name":1664,"slug":1665,"type":15},{"name":9,"slug":8,"type":15},{"slug":1669,"name":1669,"fn":1670,"description":1671,"org":1754,"tags":1755,"stars":23,"repoUrl":24,"updatedAt":1679},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1756,1757,1758,1759],{"name":1664,"slug":1665,"type":15},{"name":1676,"slug":33,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"slug":1681,"name":1681,"fn":1682,"description":1683,"org":1761,"tags":1762,"stars":23,"repoUrl":24,"updatedAt":1692},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1763,1764,1765,1766],{"name":1664,"slug":1665,"type":15},{"name":1676,"slug":33,"type":15},{"name":1689,"slug":1690,"type":15},{"name":9,"slug":8,"type":15},{"slug":1694,"name":1694,"fn":1695,"description":1696,"org":1768,"tags":1769,"stars":23,"repoUrl":24,"updatedAt":1705},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1770,1771,1772,1773],{"name":1700,"slug":1701,"type":15},{"name":21,"slug":22,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"slug":1707,"name":1707,"fn":1708,"description":1709,"org":1775,"tags":1776,"stars":23,"repoUrl":24,"updatedAt":1721},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1777,1778,1779,1780,1781],{"name":1649,"slug":31,"type":15},{"name":1714,"slug":1715,"type":15},{"name":13,"slug":14,"type":15},{"name":1718,"slug":1719,"type":15},{"name":9,"slug":8,"type":15},{"slug":1723,"name":1723,"fn":1724,"description":1725,"org":1783,"tags":1784,"stars":23,"repoUrl":24,"updatedAt":1736},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1785,1786,1787,1788],{"name":1729,"slug":1730,"type":15},{"name":18,"slug":19,"type":15},{"name":9,"slug":8,"type":15},{"name":1734,"slug":1735,"type":15},{"slug":1790,"name":1790,"fn":1791,"description":1792,"org":1793,"tags":1794,"stars":23,"repoUrl":24,"updatedAt":1802},"check-posthog-loading","inspect PostHog SDK loading across URLs","Inspect how the PostHog JavaScript SDK is loaded across a list of URLs. Use to confirm consistent installation across pages, find pages missing the snippet, detect mismatched API keys or hosts between pages, and verify the load method (head snippet vs deferred vs array.js).\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1795,1796,1797,1800,1801],{"name":1649,"slug":31,"type":15},{"name":21,"slug":22,"type":15},{"name":1798,"slug":1799,"type":15},"Frontend","frontend",{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},"2026-05-07T05:56:19.828048",{"slug":1804,"name":1804,"fn":1805,"description":1806,"org":1807,"tags":1808,"stars":23,"repoUrl":24,"updatedAt":1817},"consuming-endpoints-from-client-code","integrate PostHog endpoints into client applications","Wire a PostHog endpoint into a client app or SDK. Covers fetching the OpenAPI spec, generating a typed client with openapi-generator or @hey-api\u002Fopenapi-ts, sending the right auth header, shaping the variables payload (HogQL code_name vs insight breakdown property), handling rate-limit and materialised-endpoint error responses. Use when the user says \"how do I call my endpoint\", \"generate a client for this\", or \"what auth header do I use\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1809,1812,1813,1814],{"name":1810,"slug":1811,"type":15},"API Development","api-development",{"name":1798,"slug":1799,"type":15},{"name":9,"slug":8,"type":15},{"name":1815,"slug":1816,"type":15},"SDK","sdk","2026-06-08T08:08:34.929454",{"slug":1819,"name":1819,"fn":1820,"description":1821,"org":1822,"tags":1823,"stars":23,"repoUrl":24,"updatedAt":1827},"copying-endpoints-across-projects","copy PostHog endpoints across projects","Copy a PostHog endpoint (a saved HogQL\u002Finsight query exposed as an API route) to another project in the same organization, or duplicate it under a new name in the same project. Use when the user wants to duplicate an endpoint, promote an endpoint from staging to production, replicate an endpoint's query\u002Fvariables\u002Ffreshness config in another workspace, or clone an endpoint to iterate on it. Unlike feature flags and experiments, endpoints have NO native cross-project copy tool — this skill covers the read-then-recreate flow (endpoint-get then endpoint-create), the active-project switching it requires, name-collision checks, and the safe defaults (land unmaterialised in the target, verify with endpoint-run). Does not cover editing endpoint versions (see managing-endpoint-versions) or authoring a brand-new endpoint from scratch (see creating-an-endpoint).\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1824,1825,1826],{"name":1810,"slug":1811,"type":15},{"name":1718,"slug":1719,"type":15},{"name":9,"slug":8,"type":15},"2026-07-15T05:29:58.442727",{"slug":1829,"name":1829,"fn":1830,"description":1831,"org":1832,"tags":1833,"stars":23,"repoUrl":24,"updatedAt":1845},"creating-ai-subscription","schedule recurring AI-generated PostHog reports","Create a recurring AI-generated PostHog report — schedule a free-text prompt to run on a cron, with the LLM-synthesized markdown delivered to email or Slack on each tick. Use when the user wants a recurring AI summary of X on any cadence (daily, weekly, monthly, yearly) rather than a one-off report. (To attach an AI summary to an existing insight\u002Fdashboard subscription instead of a free-text prompt, see `managing-subscriptions` and its `summary_enabled` option.)\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1834,1835,1838,1839,1842],{"name":1729,"slug":1730,"type":15},{"name":1836,"slug":1837,"type":15},"Email","email",{"name":9,"slug":8,"type":15},{"name":1840,"slug":1841,"type":15},"Reporting","reporting",{"name":1843,"slug":1844,"type":15},"Slack","slack","2026-06-09T07:32:27.935712",{"slug":1847,"name":1847,"fn":1848,"description":1849,"org":1850,"tags":1851,"stars":23,"repoUrl":24,"updatedAt":1855},"creating-an-endpoint","create PostHog API endpoints","Create a PostHog endpoint with the right shape on the first try — covers query kind choice, name conventions, what to expose as variables (HogQL code_name vs insight breakdown), data_freshness_seconds, and whether to materialise on day one. Use when the user says \"create an endpoint\", \"expose this query as an API\", \"turn this insight into an endpoint\", or asks for help structuring a new endpoint. Steers away from common mistakes: materialising a query with cohort breakdowns or compare mode, inline-only variables on a materialised endpoint, unbounded date ranges, ambiguous names.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1852,1853,1854],{"name":1649,"slug":31,"type":15},{"name":1810,"slug":1811,"type":15},{"name":9,"slug":8,"type":15},"2026-06-08T08:08:29.624498",231]