: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.
Render an interactive, explorable PostHog visualization for the user. Strongly prefer rendering whenever your answer centers on an analytics query, specific entity, or list that has a UI app — a trends or funnel result, experiment (or its results), survey (or its stats), cohort, action, error-tracking issue, session recording, trace, or workflow, plus the list view for most — so the user can see and verify it, not just read a text summary. Render in addition to your written summary, not instead of it, and not only when the user explicitly asks to "see" something. The exception is an app that carries the whole answer: its render result says what your reply may still add, and nothing else goes in the reply.
If the query result or harness explicitly says the user already sees an interactive view, keep your written conclusion and do not render the same result again. A UI resource on a query tool does not by itself establish that an exec call displayed the chart. Rendering is independent of query selection: keep typed runners for supported analytics, even when this separate presentation step is needed.
ALWAYS run exec first — render-ui is the final presentation step, never a discovery step. Use exec (search → info → schema → call) to resolve the entity (look up its real ID), confirm the data exists, and gather what you need for your written summary; only then render. Never render with a guessed tool_input.
tool_name must be a tool from the enum; tool_input is the same input you would call it with — which you already know from your exec work. The widget fetches its own data, so you may skip a redundant call of that same UI-app tool purely to populate the widget — but that is the only call you may skip, never the discovery/verification workflow. Never invent a tool_name.
When to render (always after exec, alongside your written answer):
- Show me / pull up X → its detail tool, e.g.
render-ui({ "tool_name": "survey-get", "tool_input": { "id": "abc123" } }) - Status, "how is X going" →
render-ui({ "tool_name": "experiment-get", "tool_input": { "id": 2 } }) - Lists / inventory, "what do we have" → the
*-listtool, e.g.render-ui({ "tool_name": "experiment-list", "tool_input": {} }) - Results / stats, "is it significant", "response rate" → the results tool, e.g.
render-ui({ "tool_name": "survey-stats", "tool_input": { "survey_id": "abc123" } }) - Analytics queries without an inline chart → run the query with
execfor your analysis, then render the same tool with the same validated input (not result rows), e.g.render-ui({ "tool_name": "query-trends", "tool_input": { ... } }) - After a mutation (create/launch/pause/end/resolve) → the entity's detail tool, to confirm the change landed
- Evidence mid-investigation (a recording, error issue, trace) → render it inline, e.g.
render-ui({ "tool_name": "query-error-tracking-issue", "tool_input": { "issueId": "0190-..." } })