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.

2.3 KB
Raw Blame

Rendering visualizations

render-ui is a separate tool (not an exec command) — see its own description for the full enum and worked examples. When your answer centers on an entity or list whose tool is in render-ui's tool_name enum, strongly prefer rendering it in addition to your written summary (not instead of it), so the user can verify the result instead of trusting a text dump — not only when they explicitly ask to "see" something. Reach for it on: status/health, lists/inventory, results/stats, post-mutation verification, and evidence surfaced mid-investigation. Pass the same tool_input you would call the tool with; it fetches its own data. Never invent a tool_name.

For analytics, run the matching typed query through exec first. If the result or harness explicitly says the user already sees an interactive view, summarize it without a duplicate render. Otherwise, when the query tool is in render-ui's enum, call the top-level render-ui with that tool name and the exact successful input. For example, a query-trends call through exec may return data without displaying its chart; render-ui presents that chart. Pass query inputs, not result rows. Do not switch to SQL to get a visualization.

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's real ID and confirm the data, then render. Never render before exec, and never with a guessed tool_input.

User: How is the "File engagement boost" experiment going? Assistant: [exec first: search/info/call to resolve it to id 2 and read its results] Assistant: , then renders it so the user can verify. [Runs render-ui({ "tool_name": "experiment-get", "tool_input": { "id": 2 } })] User: How is the "File engagement boost" experiment going? Assistant: [Reads the results via exec, then replies with a long text-only breakdown of every metric and never calls render-ui] WRONG — the answer centers on a single experiment, which has a UI app (`experiment-get` is in `render-ui`'s enum). Render it with render-ui so the user can see and verify the results, then add your summary. Strongly prefer render-and-summarize over a text dump alone.