SuperAPI AI 工具集

exploring-mcp-sessions

数据与分析

查看项目

更新于 10-16 03:45

技能介绍

用途:调查 PostHog MCP 的单个会话。一个 MCP 会话即一次 agent 运行,由共享 $session_id 的 $mcp_tool_call 事件按时间排序组成。

主要能力:提供三个类型化工具。posthog:mcp-analytics-sessions-list 列出会话(每会话一行,最新在前);posthog:mcp-analytics-sessions-tool-calls 按时间顺序读取某会话的工具调用;posthog:mcp-analytics-sessions-generate-intent 用 LLM 总结会话目标(首次调用后缓存)。三者与 sessions UI 运行相同代码,结果一致。若工具列表中没有,可回退到 posthog:execute-sql。

使用方式:列表调用可传 date_from、order_by、limit 等参数,返回 session_id、tool_calls、session_start、tools_used、mcp_client_name、distinct_id、intent 等字段。读取工具调用需传 id 与 date_from,返回 tool_name、intent、timestamp、duration_ms、is_error、error_message。生成目标摘要同样传 id 与 date_from,返回 session_id 与 intent。

限制与注意:两个详情工具默认回看 7 天,若会话更早,必须把列表中的 session_start 作为 date_from 传入,否则会返回空。order_by 使用列名而非响应字段名,无法识别的键会静默回退为最新优先。会话行没有错误过滤或错误计数,distinct_id_count 始终为 0。工具调用中的 tool_name 是原始 $mcp_tool_name,不解析单次执行包装器的内部工具。generate-intent 返回 503 表示未配置 LLM 摘要,可改读原始 $mcp_intent。需要错误会话、有效工具名或跨会话聚合时,改用 posthog:execute-sql。$session_id 是物化列,应直接引用,不要写成 properties.$session_id。