@utdk/posthog 1.0.0-20260712.5-dev.e2949a6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +373 -0
- package/README.md +172 -0
- package/docs/account_relationship_definitions.md +194 -0
- package/docs/accounts.md +380 -0
- package/docs/actions.md +274 -0
- package/docs/activity_logs.md +144 -0
- package/docs/advanced_activity_logs.md +101 -0
- package/docs/agent_platform.md +2525 -0
- package/docs/ai-observability.md +514 -0
- package/docs/alerts.md +444 -0
- package/docs/annotations.md +200 -0
- package/docs/batch_exports.md +2118 -0
- package/docs/business_knowledge.md +468 -0
- package/docs/code-invites.md +72 -0
- package/docs/cohorts.md +412 -0
- package/docs/comments.md +321 -0
- package/docs/conversations.md +695 -0
- package/docs/custom_property_definitions.md +442 -0
- package/docs/custom_property_sources.md +194 -0
- package/docs/customer_analytics.md +442 -0
- package/docs/customer_journeys.md +380 -0
- package/docs/customer_profile_configs.md +380 -0
- package/docs/dashboard_templates.md +258 -0
- package/docs/dashboards.md +1896 -0
- package/docs/data_color_themes.md +380 -0
- package/docs/data_modeling_jobs.md +264 -0
- package/docs/data_warehouse.md +928 -0
- package/docs/dataset_items.md +382 -0
- package/docs/datasets.md +382 -0
- package/docs/desktop_file_system.md +753 -0
- package/docs/desktop_file_system_shortcut.md +244 -0
- package/docs/docs.md +72 -0
- package/docs/early_access_feature.md +194 -0
- package/docs/elements.md +510 -0
- package/docs/endpoints.md +1030 -0
- package/docs/engineering_analytics.md +712 -0
- package/docs/environments.md +881 -0
- package/docs/error_tracking.md +5108 -0
- package/docs/evaluation_runs.md +78 -0
- package/docs/evaluations.md +446 -0
- package/docs/event_definitions.md +425 -0
- package/docs/event_filter.md +280 -0
- package/docs/event_schemas.md +163 -0
- package/docs/events.md +208 -0
- package/docs/experiment_holdouts.md +194 -0
- package/docs/experiment_saved_metrics.md +194 -0
- package/docs/experiments.md +1088 -0
- package/docs/exports.md +256 -0
- package/docs/external_data_schemas.md +752 -0
- package/docs/external_data_sources.md +2296 -0
- package/docs/feature_flags.md +808 -0
- package/docs/field_notes.md +206 -0
- package/docs/file_system.md +880 -0
- package/docs/file_system_shortcut.md +444 -0
- package/docs/flag_value.md +46 -0
- package/docs/groups.md +514 -0
- package/docs/groups_types.md +349 -0
- package/docs/health_issues.md +386 -0
- package/docs/heatmap_screenshots.md +72 -0
- package/docs/heatmaps.md +136 -0
- package/docs/hog_flows.md +1576 -0
- package/docs/hog_function_templates.md +101 -0
- package/docs/hog_functions.md +974 -0
- package/docs/ingestion_warnings_v2.md +40 -0
- package/docs/insight_variables.md +380 -0
- package/docs/insights.md +1722 -0
- package/docs/integrations.md +1954 -0
- package/docs/js-snippet.md +104 -0
- package/docs/live_debugger_breakpoints.md +264 -0
- package/docs/llm_analytics.md +3373 -0
- package/docs/llm_prompts.md +442 -0
- package/docs/llm_skills.md +952 -0
- package/docs/logs.md +2446 -0
- package/docs/managed_viewsets.md +140 -0
- package/docs/marketing_analytics.md +518 -0
- package/docs/max.md +772 -0
- package/docs/max_tools.md +70 -0
- package/docs/mcp_analytics.md +712 -0
- package/docs/mcp_server_installations.md +970 -0
- package/docs/mcp_servers.md +78 -0
- package/docs/mcp_tools.md +82 -0
- package/docs/messaging_templates.md +444 -0
- package/docs/metrics.md +462 -0
- package/docs/notebooks.md +838 -0
- package/docs/object_media_previews.md +228 -0
- package/docs/organizations.md +2958 -0
- package/docs/persons.md +1514 -0
- package/docs/platform_features.md +700 -0
- package/docs/plugin_configs.md +70 -0
- package/docs/product_enablement.md +39 -0
- package/docs/product_tours.md +357 -0
- package/docs/project_secret_api_keys.md +444 -0
- package/docs/property_access_controls.md +200 -0
- package/docs/property_definitions.md +244 -0
- package/docs/query.md +560 -0
- package/docs/quota_limits.md +40 -0
- package/docs/reminders.md +194 -0
- package/docs/replay.md +1020 -0
- package/docs/reverse_proxy.md +200 -0
- package/docs/sandbox-custom-images.md +209 -0
- package/docs/sandbox-environments.md +168 -0
- package/docs/saved.md +392 -0
- package/docs/saved_query_column_annotations.md +224 -0
- package/docs/scheduled_changes.md +200 -0
- package/docs/schema_property_groups.md +194 -0
- package/docs/sdk_health.md +40 -0
- package/docs/session_group_summaries.md +200 -0
- package/docs/session_recordings.md +260 -0
- package/docs/session_summaries.md +200 -0
- package/docs/sessions.md +132 -0
- package/docs/signals.md +1428 -0
- package/docs/single_session_summaries.md +72 -0
- package/docs/streamlit_apps.md +456 -0
- package/docs/subscriptions.md +634 -0
- package/docs/surveys.md +731 -0
- package/docs/taggers.md +446 -0
- package/docs/task-automations.md +200 -0
- package/docs/task-runs.md +654 -0
- package/docs/task_channels.md +136 -0
- package/docs/task_mentions.md +40 -0
- package/docs/tasks.md +776 -0
- package/docs/tracing.md +1186 -0
- package/docs/uploaded_media.md +44 -0
- package/docs/user_home_settings.md +72 -0
- package/docs/user_interview_topics.md +1288 -0
- package/docs/user_interviews.md +444 -0
- package/docs/users.md +1267 -0
- package/docs/vision.md +2022 -0
- package/docs/visual_review.md +816 -0
- package/docs/warehouse_column_annotations.md +224 -0
- package/docs/warehouse_column_statistics.md +80 -0
- package/docs/warehouse_dag.md +40 -0
- package/docs/warehouse_model_paths.md +70 -0
- package/docs/warehouse_saved_queries.md +1056 -0
- package/docs/warehouse_saved_query_folders.md +318 -0
- package/docs/warehouse_tables.md +584 -0
- package/docs/warehouse_view_link.md +456 -0
- package/docs/warehouse_view_links.md +456 -0
- package/docs/web_analytics.md +136 -0
- package/docs/web_analytics_achievements.md +200 -0
- package/docs/web_experiments.md +194 -0
- package/docs/web_vitals.md +74 -0
- package/docs/wizard.md +170 -0
- package/index.ts +22 -0
- package/metadata.ts +41419 -0
- package/openapi.json +297382 -0
- package/overlay.yaml +23 -0
- package/package.json +34 -0
- package/provenance.json +24 -0
- package/research.json +80 -0
- package/types/index.ts +17547 -0
|
@@ -0,0 +1,712 @@
|
|
|
1
|
+
# Mcp Analytics
|
|
2
|
+
|
|
3
|
+
## Operations
|
|
4
|
+
|
|
5
|
+
### `posthog.environmentsMcpAnalyticsFeedbackList`
|
|
6
|
+
|
|
7
|
+
- **HTTP**: `GET /api/environments/{environment_id}/mcp_analytics/feedback/`
|
|
8
|
+
- **What it does**: List MCP feedback submissions for the current project, newest first.
|
|
9
|
+
- **OpenAPI operationId**: `environments_mcp_analytics_feedback_list`
|
|
10
|
+
- **Path params**: None
|
|
11
|
+
- **Query params**: `limit`, `offset`
|
|
12
|
+
- **Response codes**: `200`
|
|
13
|
+
- **Transport options**: None
|
|
14
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
15
|
+
|
|
16
|
+
**Inputs**
|
|
17
|
+
|
|
18
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
19
|
+
- Client transport options: None
|
|
20
|
+
|
|
21
|
+
**Outputs**
|
|
22
|
+
|
|
23
|
+
- Client return type: `{ count: number; next?: string | null; previous?: string | null; results: ({ id: string; kind: "feedback" | "missing_capability"; goal: string; summary: string; category: string; blocked: boolean | null; attempted_tool:...`
|
|
24
|
+
- OpenAPI response codes: `200`
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import posthog from "@utdk/posthog";
|
|
28
|
+
|
|
29
|
+
type EnvironmentsMcpAnalyticsFeedbackListInput = Parameters<typeof posthog.environmentsMcpAnalyticsFeedbackList> extends [infer T, ...unknown[]] ? T : undefined;
|
|
30
|
+
type EnvironmentsMcpAnalyticsFeedbackListOutput = Awaited<ReturnType<typeof posthog.environmentsMcpAnalyticsFeedbackList>>;
|
|
31
|
+
|
|
32
|
+
const result: EnvironmentsMcpAnalyticsFeedbackListOutput = await posthog.environmentsMcpAnalyticsFeedbackList();
|
|
33
|
+
|
|
34
|
+
// Result shape (from schema): { count: number; next?: string | null; previous?: string | null; results: ({ id: string; kind: "feedback" | "missing_capability"; goal: string; summary: string; category: string; blocked: boolean | null; attempted_tool:...
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### `posthog.environmentsMcpAnalyticsFeedbackCreate`
|
|
38
|
+
|
|
39
|
+
- **HTTP**: `POST /api/environments/{environment_id}/mcp_analytics/feedback/`
|
|
40
|
+
- **What it does**: Create a new MCP feedback submission for the current project.
|
|
41
|
+
- **OpenAPI operationId**: `environments_mcp_analytics_feedback_create`
|
|
42
|
+
- **Path params**: None
|
|
43
|
+
- **Query params**: None
|
|
44
|
+
- **Response codes**: `201`
|
|
45
|
+
- **Transport options**: None
|
|
46
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
47
|
+
|
|
48
|
+
**Inputs**
|
|
49
|
+
|
|
50
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
51
|
+
- Client transport options: None
|
|
52
|
+
|
|
53
|
+
**Outputs**
|
|
54
|
+
|
|
55
|
+
- Client return type: `{ id: string; kind: "feedback" | "missing_capability"; goal: string; summary: string; category: string; blocked: boolean | null; attempted_tool: string; mcp_client_name: string; mcp_client_version: string; mcp_protocol_...`
|
|
56
|
+
- OpenAPI response codes: `201`
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
import posthog from "@utdk/posthog";
|
|
60
|
+
|
|
61
|
+
type EnvironmentsMcpAnalyticsFeedbackCreateInput = Parameters<typeof posthog.environmentsMcpAnalyticsFeedbackCreate> extends [infer T, ...unknown[]] ? T : undefined;
|
|
62
|
+
type EnvironmentsMcpAnalyticsFeedbackCreateOutput = Awaited<ReturnType<typeof posthog.environmentsMcpAnalyticsFeedbackCreate>>;
|
|
63
|
+
|
|
64
|
+
const result: EnvironmentsMcpAnalyticsFeedbackCreateOutput = await posthog.environmentsMcpAnalyticsFeedbackCreate();
|
|
65
|
+
|
|
66
|
+
// Result shape (from schema): { id: string; kind: "feedback" | "missing_capability"; goal: string; summary: string; category: string; blocked: boolean | null; attempted_tool: string; mcp_client_name: string; mcp_client_version: string; mcp_protocol_...
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### `posthog.environmentsMcpAnalyticsIntentClustersRetrieve`
|
|
70
|
+
|
|
71
|
+
- **HTTP**: `GET /api/environments/{environment_id}/mcp_analytics/intent_clusters/`
|
|
72
|
+
- **What it does**: Return the most recent intent cluster snapshot for the current project. Returns an empty IDLE snapshot when no clustering run has happened yet.
|
|
73
|
+
- **OpenAPI operationId**: `environments_mcp_analytics_intent_clusters_retrieve`
|
|
74
|
+
- **Path params**: None
|
|
75
|
+
- **Query params**: None
|
|
76
|
+
- **Response codes**: `200`
|
|
77
|
+
- **Transport options**: None
|
|
78
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
79
|
+
|
|
80
|
+
**Inputs**
|
|
81
|
+
|
|
82
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
83
|
+
- Client transport options: None
|
|
84
|
+
|
|
85
|
+
**Outputs**
|
|
86
|
+
|
|
87
|
+
- Client return type: `({ status: "idle" | "computing" | "error"; error_message: string; last_computed_at: string | null; last_computed_by_email: string; clusters: ({ id: number; label: string; intent_count: number; session_count: number; cal...`
|
|
88
|
+
- OpenAPI response codes: `200`
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
import posthog from "@utdk/posthog";
|
|
92
|
+
|
|
93
|
+
type EnvironmentsMcpAnalyticsIntentClustersRetrieveInput = Parameters<typeof posthog.environmentsMcpAnalyticsIntentClustersRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
|
|
94
|
+
type EnvironmentsMcpAnalyticsIntentClustersRetrieveOutput = Awaited<ReturnType<typeof posthog.environmentsMcpAnalyticsIntentClustersRetrieve>>;
|
|
95
|
+
|
|
96
|
+
const result: EnvironmentsMcpAnalyticsIntentClustersRetrieveOutput = await posthog.environmentsMcpAnalyticsIntentClustersRetrieve();
|
|
97
|
+
|
|
98
|
+
// Result shape (from schema): ({ status: "idle" | "computing" | "error"; error_message: string; last_computed_at: string | null; last_computed_by_email: string; clusters: ({ id: number; label: string; intent_count: number; session_count: number; cal...
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### `posthog.environmentsMcpAnalyticsIntentClustersRecompute`
|
|
102
|
+
|
|
103
|
+
- **HTTP**: `POST /api/environments/{environment_id}/mcp_analytics/intent_clusters/recompute/`
|
|
104
|
+
- **What it does**: Trigger an asynchronous recompute of the intent cluster snapshot. The task runs in the background; poll the GET endpoint for progress (status transitions to 'idle' or 'error').
|
|
105
|
+
- **OpenAPI operationId**: `environments_mcp_analytics_intent_clusters_recompute`
|
|
106
|
+
- **Path params**: None
|
|
107
|
+
- **Query params**: None
|
|
108
|
+
- **Response codes**: `202`
|
|
109
|
+
- **Transport options**: None
|
|
110
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
111
|
+
|
|
112
|
+
**Inputs**
|
|
113
|
+
|
|
114
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
115
|
+
- Client transport options: None
|
|
116
|
+
|
|
117
|
+
**Outputs**
|
|
118
|
+
|
|
119
|
+
- Client return type: `unknown`
|
|
120
|
+
- OpenAPI response codes: `202`
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
import posthog from "@utdk/posthog";
|
|
124
|
+
|
|
125
|
+
type EnvironmentsMcpAnalyticsIntentClustersRecomputeInput = Parameters<typeof posthog.environmentsMcpAnalyticsIntentClustersRecompute> extends [infer T, ...unknown[]] ? T : undefined;
|
|
126
|
+
type EnvironmentsMcpAnalyticsIntentClustersRecomputeOutput = Awaited<ReturnType<typeof posthog.environmentsMcpAnalyticsIntentClustersRecompute>>;
|
|
127
|
+
|
|
128
|
+
const result: EnvironmentsMcpAnalyticsIntentClustersRecomputeOutput = await posthog.environmentsMcpAnalyticsIntentClustersRecompute();
|
|
129
|
+
|
|
130
|
+
// Result shape (from schema): unknown
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### `posthog.environmentsMcpAnalyticsMissingCapabilitiesList`
|
|
134
|
+
|
|
135
|
+
- **HTTP**: `GET /api/environments/{environment_id}/mcp_analytics/missing_capabilities/`
|
|
136
|
+
- **What it does**: List missing capability reports for the current project, newest first.
|
|
137
|
+
- **OpenAPI operationId**: `environments_mcp_analytics_missing_capabilities_list`
|
|
138
|
+
- **Path params**: None
|
|
139
|
+
- **Query params**: `limit`, `offset`
|
|
140
|
+
- **Response codes**: `200`
|
|
141
|
+
- **Transport options**: None
|
|
142
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
143
|
+
|
|
144
|
+
**Inputs**
|
|
145
|
+
|
|
146
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
147
|
+
- Client transport options: None
|
|
148
|
+
|
|
149
|
+
**Outputs**
|
|
150
|
+
|
|
151
|
+
- Client return type: `{ count: number; next?: string | null; previous?: string | null; results: ({ id: string; kind: "feedback" | "missing_capability"; goal: string; summary: string; category: string; blocked: boolean | null; attempted_tool:...`
|
|
152
|
+
- OpenAPI response codes: `200`
|
|
153
|
+
|
|
154
|
+
```ts
|
|
155
|
+
import posthog from "@utdk/posthog";
|
|
156
|
+
|
|
157
|
+
type EnvironmentsMcpAnalyticsMissingCapabilitiesListInput = Parameters<typeof posthog.environmentsMcpAnalyticsMissingCapabilitiesList> extends [infer T, ...unknown[]] ? T : undefined;
|
|
158
|
+
type EnvironmentsMcpAnalyticsMissingCapabilitiesListOutput = Awaited<ReturnType<typeof posthog.environmentsMcpAnalyticsMissingCapabilitiesList>>;
|
|
159
|
+
|
|
160
|
+
const result: EnvironmentsMcpAnalyticsMissingCapabilitiesListOutput = await posthog.environmentsMcpAnalyticsMissingCapabilitiesList();
|
|
161
|
+
|
|
162
|
+
// Result shape (from schema): { count: number; next?: string | null; previous?: string | null; results: ({ id: string; kind: "feedback" | "missing_capability"; goal: string; summary: string; category: string; blocked: boolean | null; attempted_tool:...
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### `posthog.environmentsMcpAnalyticsMissingCapabilitiesCreate`
|
|
166
|
+
|
|
167
|
+
- **HTTP**: `POST /api/environments/{environment_id}/mcp_analytics/missing_capabilities/`
|
|
168
|
+
- **What it does**: Create a new missing capability report for the current project.
|
|
169
|
+
- **OpenAPI operationId**: `environments_mcp_analytics_missing_capabilities_create`
|
|
170
|
+
- **Path params**: None
|
|
171
|
+
- **Query params**: None
|
|
172
|
+
- **Response codes**: `201`
|
|
173
|
+
- **Transport options**: None
|
|
174
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
175
|
+
|
|
176
|
+
**Inputs**
|
|
177
|
+
|
|
178
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
179
|
+
- Client transport options: None
|
|
180
|
+
|
|
181
|
+
**Outputs**
|
|
182
|
+
|
|
183
|
+
- Client return type: `{ id: string; kind: "feedback" | "missing_capability"; goal: string; summary: string; category: string; blocked: boolean | null; attempted_tool: string; mcp_client_name: string; mcp_client_version: string; mcp_protocol_...`
|
|
184
|
+
- OpenAPI response codes: `201`
|
|
185
|
+
|
|
186
|
+
```ts
|
|
187
|
+
import posthog from "@utdk/posthog";
|
|
188
|
+
|
|
189
|
+
type EnvironmentsMcpAnalyticsMissingCapabilitiesCreateInput = Parameters<typeof posthog.environmentsMcpAnalyticsMissingCapabilitiesCreate> extends [infer T, ...unknown[]] ? T : undefined;
|
|
190
|
+
type EnvironmentsMcpAnalyticsMissingCapabilitiesCreateOutput = Awaited<ReturnType<typeof posthog.environmentsMcpAnalyticsMissingCapabilitiesCreate>>;
|
|
191
|
+
|
|
192
|
+
const result: EnvironmentsMcpAnalyticsMissingCapabilitiesCreateOutput = await posthog.environmentsMcpAnalyticsMissingCapabilitiesCreate();
|
|
193
|
+
|
|
194
|
+
// Result shape (from schema): { id: string; kind: "feedback" | "missing_capability"; goal: string; summary: string; category: string; blocked: boolean | null; attempted_tool: string; mcp_client_name: string; mcp_client_version: string; mcp_protocol_...
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### `posthog.environmentsMcpAnalyticsSessionsList`
|
|
198
|
+
|
|
199
|
+
- **HTTP**: `GET /api/environments/{environment_id}/mcp_analytics/sessions/`
|
|
200
|
+
- **What it does**: List MCP sessions for the current project, derived by grouping $mcp_tool_call events by $mcp_session_id. Ordered by newest session start first by default.
|
|
201
|
+
- **OpenAPI operationId**: `environments_mcp_analytics_sessions_list`
|
|
202
|
+
- **Path params**: None
|
|
203
|
+
- **Query params**: `date_from`, `date_to`, `limit`, `offset`, `order_by`, `search`
|
|
204
|
+
- **Response codes**: `200`
|
|
205
|
+
- **Transport options**: None
|
|
206
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
207
|
+
|
|
208
|
+
**Inputs**
|
|
209
|
+
|
|
210
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
211
|
+
- Client transport options: None
|
|
212
|
+
|
|
213
|
+
**Outputs**
|
|
214
|
+
|
|
215
|
+
- Client return type: `{ results: ({ session_id: string; tool_calls: number; session_start: string; session_end: string; distinct_id_count: number; tools_used: (string)[]; mcp_client_name: string; distinct_id: string; person_email: string; pe...`
|
|
216
|
+
- OpenAPI response codes: `200`
|
|
217
|
+
|
|
218
|
+
```ts
|
|
219
|
+
import posthog from "@utdk/posthog";
|
|
220
|
+
|
|
221
|
+
type EnvironmentsMcpAnalyticsSessionsListInput = Parameters<typeof posthog.environmentsMcpAnalyticsSessionsList> extends [infer T, ...unknown[]] ? T : undefined;
|
|
222
|
+
type EnvironmentsMcpAnalyticsSessionsListOutput = Awaited<ReturnType<typeof posthog.environmentsMcpAnalyticsSessionsList>>;
|
|
223
|
+
|
|
224
|
+
const result: EnvironmentsMcpAnalyticsSessionsListOutput = await posthog.environmentsMcpAnalyticsSessionsList();
|
|
225
|
+
|
|
226
|
+
// Result shape (from schema): { results: ({ session_id: string; tool_calls: number; session_start: string; session_end: string; distinct_id_count: number; tools_used: (string)[]; mcp_client_name: string; distinct_id: string; person_email: string; pe...
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### `posthog.environmentsMcpAnalyticsSessionsGenerateIntent`
|
|
230
|
+
|
|
231
|
+
- **HTTP**: `POST /api/environments/{environment_id}/mcp_analytics/sessions/{id}/generate_intent/`
|
|
232
|
+
- **What it does**: Generate (or return the cached) LLM summary of the agent's goal for a session, derived from its recorded $mcp_intents. The first call summarises and persists the result; subsequent calls return the stored summary.
|
|
233
|
+
- **OpenAPI operationId**: `environments_mcp_analytics_sessions_generate_intent`
|
|
234
|
+
- **Path params**: `id`
|
|
235
|
+
- **Query params**: `date_from`
|
|
236
|
+
- **Response codes**: `200`
|
|
237
|
+
- **Transport options**: None
|
|
238
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
239
|
+
|
|
240
|
+
**Inputs**
|
|
241
|
+
|
|
242
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
243
|
+
- Client transport options: None
|
|
244
|
+
|
|
245
|
+
**Outputs**
|
|
246
|
+
|
|
247
|
+
- Client return type: `{ session_id: string; intent: string }`
|
|
248
|
+
- OpenAPI response codes: `200`
|
|
249
|
+
|
|
250
|
+
```ts
|
|
251
|
+
import posthog from "@utdk/posthog";
|
|
252
|
+
|
|
253
|
+
type EnvironmentsMcpAnalyticsSessionsGenerateIntentInput = Parameters<typeof posthog.environmentsMcpAnalyticsSessionsGenerateIntent> extends [infer T, ...unknown[]] ? T : undefined;
|
|
254
|
+
type EnvironmentsMcpAnalyticsSessionsGenerateIntentOutput = Awaited<ReturnType<typeof posthog.environmentsMcpAnalyticsSessionsGenerateIntent>>;
|
|
255
|
+
|
|
256
|
+
const result: EnvironmentsMcpAnalyticsSessionsGenerateIntentOutput = await posthog.environmentsMcpAnalyticsSessionsGenerateIntent();
|
|
257
|
+
|
|
258
|
+
// Result shape (from schema): { session_id: string; intent: string }
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### `posthog.environmentsMcpAnalyticsSessionsToolCalls`
|
|
262
|
+
|
|
263
|
+
- **HTTP**: `GET /api/environments/{environment_id}/mcp_analytics/sessions/{id}/tool_calls/`
|
|
264
|
+
- **What it does**: List a page of the $mcp_tool_call events that belong to a given $session_id, in chronological order.
|
|
265
|
+
- **OpenAPI operationId**: `environments_mcp_analytics_sessions_tool_calls`
|
|
266
|
+
- **Path params**: `id`
|
|
267
|
+
- **Query params**: `date_from`, `limit`, `offset`
|
|
268
|
+
- **Response codes**: `200`
|
|
269
|
+
- **Transport options**: None
|
|
270
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
271
|
+
|
|
272
|
+
**Inputs**
|
|
273
|
+
|
|
274
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
275
|
+
- Client transport options: None
|
|
276
|
+
|
|
277
|
+
**Outputs**
|
|
278
|
+
|
|
279
|
+
- Client return type: `{ results: ({ event_id: string; timestamp: string; tool_name: string; intent: string; is_error: boolean; error_message: string; duration_ms: number | null })[]; has_next: boolean }`
|
|
280
|
+
- OpenAPI response codes: `200`
|
|
281
|
+
|
|
282
|
+
```ts
|
|
283
|
+
import posthog from "@utdk/posthog";
|
|
284
|
+
|
|
285
|
+
type EnvironmentsMcpAnalyticsSessionsToolCallsInput = Parameters<typeof posthog.environmentsMcpAnalyticsSessionsToolCalls> extends [infer T, ...unknown[]] ? T : undefined;
|
|
286
|
+
type EnvironmentsMcpAnalyticsSessionsToolCallsOutput = Awaited<ReturnType<typeof posthog.environmentsMcpAnalyticsSessionsToolCalls>>;
|
|
287
|
+
|
|
288
|
+
const result: EnvironmentsMcpAnalyticsSessionsToolCallsOutput = await posthog.environmentsMcpAnalyticsSessionsToolCalls();
|
|
289
|
+
|
|
290
|
+
// Result shape (from schema): { results: ({ event_id: string; timestamp: string; tool_name: string; intent: string; is_error: boolean; error_message: string; duration_ms: number | null })[]; has_next: boolean }
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### `posthog.environmentsMcpAnalyticsSessionsActivityOverview`
|
|
294
|
+
|
|
295
|
+
- **HTTP**: `GET /api/environments/{environment_id}/mcp_analytics/sessions/activity_overview/`
|
|
296
|
+
- **What it does**: Aggregate counters, top tools, agent clients, and the most recent tool calls for the last 30 days, computed in one request. Powers the dashboard's activity view; always computed fresh so polling callers watch data arrive.
|
|
297
|
+
- **OpenAPI operationId**: `environments_mcp_analytics_sessions_activity_overview`
|
|
298
|
+
- **Path params**: None
|
|
299
|
+
- **Query params**: None
|
|
300
|
+
- **Response codes**: `200`
|
|
301
|
+
- **Transport options**: None
|
|
302
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
303
|
+
|
|
304
|
+
**Inputs**
|
|
305
|
+
|
|
306
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
307
|
+
- Client transport options: None
|
|
308
|
+
|
|
309
|
+
**Outputs**
|
|
310
|
+
|
|
311
|
+
- Client return type: `{ stats: { total_calls: number; distinct_tools: number; distinct_sessions: number; distinct_clients: number; calls_with_intent: number; error_calls: number; missing_capability_reports: number }; top_tools: ({ tool: stri...`
|
|
312
|
+
- OpenAPI response codes: `200`
|
|
313
|
+
|
|
314
|
+
```ts
|
|
315
|
+
import posthog from "@utdk/posthog";
|
|
316
|
+
|
|
317
|
+
type EnvironmentsMcpAnalyticsSessionsActivityOverviewInput = Parameters<typeof posthog.environmentsMcpAnalyticsSessionsActivityOverview> extends [infer T, ...unknown[]] ? T : undefined;
|
|
318
|
+
type EnvironmentsMcpAnalyticsSessionsActivityOverviewOutput = Awaited<ReturnType<typeof posthog.environmentsMcpAnalyticsSessionsActivityOverview>>;
|
|
319
|
+
|
|
320
|
+
const result: EnvironmentsMcpAnalyticsSessionsActivityOverviewOutput = await posthog.environmentsMcpAnalyticsSessionsActivityOverview();
|
|
321
|
+
|
|
322
|
+
// Result shape (from schema): { stats: { total_calls: number; distinct_tools: number; distinct_sessions: number; distinct_clients: number; calls_with_intent: number; error_calls: number; missing_capability_reports: number }; top_tools: ({ tool: stri...
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
### `posthog.environmentsMcpAnalyticsSessionsIntentDigest`
|
|
326
|
+
|
|
327
|
+
- **HTTP**: `POST /api/environments/{environment_id}/mcp_analytics/sessions/intent_digest/`
|
|
328
|
+
- **What it does**: Generate (or return the cached) LLM digest of what agents are trying to do with this MCP server, derived from the most recent recorded $mcp_intents across all sessions. Content-addressed cache: only regenerates when new intents arrive. Powers the dashboard's low-volume activity stage.
|
|
329
|
+
- **OpenAPI operationId**: `environments_mcp_analytics_sessions_intent_digest`
|
|
330
|
+
- **Path params**: None
|
|
331
|
+
- **Query params**: None
|
|
332
|
+
- **Response codes**: `200`, `503`
|
|
333
|
+
- **Transport options**: None
|
|
334
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
335
|
+
|
|
336
|
+
**Inputs**
|
|
337
|
+
|
|
338
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
339
|
+
- Client transport options: None
|
|
340
|
+
|
|
341
|
+
**Outputs**
|
|
342
|
+
|
|
343
|
+
- Client return type: `{ digest: string | null; intent_count: number }`
|
|
344
|
+
- OpenAPI response codes: `200`, `503`
|
|
345
|
+
|
|
346
|
+
```ts
|
|
347
|
+
import posthog from "@utdk/posthog";
|
|
348
|
+
|
|
349
|
+
type EnvironmentsMcpAnalyticsSessionsIntentDigestInput = Parameters<typeof posthog.environmentsMcpAnalyticsSessionsIntentDigest> extends [infer T, ...unknown[]] ? T : undefined;
|
|
350
|
+
type EnvironmentsMcpAnalyticsSessionsIntentDigestOutput = Awaited<ReturnType<typeof posthog.environmentsMcpAnalyticsSessionsIntentDigest>>;
|
|
351
|
+
|
|
352
|
+
const result: EnvironmentsMcpAnalyticsSessionsIntentDigestOutput = await posthog.environmentsMcpAnalyticsSessionsIntentDigest();
|
|
353
|
+
|
|
354
|
+
// Result shape (from schema): { digest: string | null; intent_count: number }
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
### `posthog.mcpAnalyticsFeedbackList`
|
|
358
|
+
|
|
359
|
+
- **HTTP**: `GET /api/projects/{project_id}/mcp_analytics/feedback/`
|
|
360
|
+
- **What it does**: List MCP feedback submissions for the current project, newest first.
|
|
361
|
+
- **OpenAPI operationId**: `mcp_analytics_feedback_list`
|
|
362
|
+
- **Path params**: None
|
|
363
|
+
- **Query params**: `limit`, `offset`
|
|
364
|
+
- **Response codes**: `200`
|
|
365
|
+
- **Transport options**: None
|
|
366
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
367
|
+
|
|
368
|
+
**Inputs**
|
|
369
|
+
|
|
370
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
371
|
+
- Client transport options: None
|
|
372
|
+
|
|
373
|
+
**Outputs**
|
|
374
|
+
|
|
375
|
+
- Client return type: `{ count: number; next?: string | null; previous?: string | null; results: ({ id: string; kind: "feedback" | "missing_capability"; goal: string; summary: string; category: string; blocked: boolean | null; attempted_tool:...`
|
|
376
|
+
- OpenAPI response codes: `200`
|
|
377
|
+
|
|
378
|
+
```ts
|
|
379
|
+
import posthog from "@utdk/posthog";
|
|
380
|
+
|
|
381
|
+
type McpAnalyticsFeedbackListInput = Parameters<typeof posthog.mcpAnalyticsFeedbackList> extends [infer T, ...unknown[]] ? T : undefined;
|
|
382
|
+
type McpAnalyticsFeedbackListOutput = Awaited<ReturnType<typeof posthog.mcpAnalyticsFeedbackList>>;
|
|
383
|
+
|
|
384
|
+
const result: McpAnalyticsFeedbackListOutput = await posthog.mcpAnalyticsFeedbackList();
|
|
385
|
+
|
|
386
|
+
// Result shape (from schema): { count: number; next?: string | null; previous?: string | null; results: ({ id: string; kind: "feedback" | "missing_capability"; goal: string; summary: string; category: string; blocked: boolean | null; attempted_tool:...
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
### `posthog.mcpAnalyticsFeedbackCreate`
|
|
390
|
+
|
|
391
|
+
- **HTTP**: `POST /api/projects/{project_id}/mcp_analytics/feedback/`
|
|
392
|
+
- **What it does**: Create a new MCP feedback submission for the current project.
|
|
393
|
+
- **OpenAPI operationId**: `mcp_analytics_feedback_create`
|
|
394
|
+
- **Path params**: None
|
|
395
|
+
- **Query params**: None
|
|
396
|
+
- **Response codes**: `201`
|
|
397
|
+
- **Transport options**: None
|
|
398
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
399
|
+
|
|
400
|
+
**Inputs**
|
|
401
|
+
|
|
402
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
403
|
+
- Client transport options: None
|
|
404
|
+
|
|
405
|
+
**Outputs**
|
|
406
|
+
|
|
407
|
+
- Client return type: `{ id: string; kind: "feedback" | "missing_capability"; goal: string; summary: string; category: string; blocked: boolean | null; attempted_tool: string; mcp_client_name: string; mcp_client_version: string; mcp_protocol_...`
|
|
408
|
+
- OpenAPI response codes: `201`
|
|
409
|
+
|
|
410
|
+
```ts
|
|
411
|
+
import posthog from "@utdk/posthog";
|
|
412
|
+
|
|
413
|
+
type McpAnalyticsFeedbackCreateInput = Parameters<typeof posthog.mcpAnalyticsFeedbackCreate> extends [infer T, ...unknown[]] ? T : undefined;
|
|
414
|
+
type McpAnalyticsFeedbackCreateOutput = Awaited<ReturnType<typeof posthog.mcpAnalyticsFeedbackCreate>>;
|
|
415
|
+
|
|
416
|
+
const result: McpAnalyticsFeedbackCreateOutput = await posthog.mcpAnalyticsFeedbackCreate();
|
|
417
|
+
|
|
418
|
+
// Result shape (from schema): { id: string; kind: "feedback" | "missing_capability"; goal: string; summary: string; category: string; blocked: boolean | null; attempted_tool: string; mcp_client_name: string; mcp_client_version: string; mcp_protocol_...
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
### `posthog.mcpAnalyticsIntentClustersRetrieve`
|
|
422
|
+
|
|
423
|
+
- **HTTP**: `GET /api/projects/{project_id}/mcp_analytics/intent_clusters/`
|
|
424
|
+
- **What it does**: Return the most recent intent cluster snapshot for the current project. Returns an empty IDLE snapshot when no clustering run has happened yet.
|
|
425
|
+
- **OpenAPI operationId**: `mcp_analytics_intent_clusters_retrieve`
|
|
426
|
+
- **Path params**: None
|
|
427
|
+
- **Query params**: None
|
|
428
|
+
- **Response codes**: `200`
|
|
429
|
+
- **Transport options**: None
|
|
430
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
431
|
+
|
|
432
|
+
**Inputs**
|
|
433
|
+
|
|
434
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
435
|
+
- Client transport options: None
|
|
436
|
+
|
|
437
|
+
**Outputs**
|
|
438
|
+
|
|
439
|
+
- Client return type: `({ status: "idle" | "computing" | "error"; error_message: string; last_computed_at: string | null; last_computed_by_email: string; clusters: ({ id: number; label: string; intent_count: number; session_count: number; cal...`
|
|
440
|
+
- OpenAPI response codes: `200`
|
|
441
|
+
|
|
442
|
+
```ts
|
|
443
|
+
import posthog from "@utdk/posthog";
|
|
444
|
+
|
|
445
|
+
type McpAnalyticsIntentClustersRetrieveInput = Parameters<typeof posthog.mcpAnalyticsIntentClustersRetrieve> extends [infer T, ...unknown[]] ? T : undefined;
|
|
446
|
+
type McpAnalyticsIntentClustersRetrieveOutput = Awaited<ReturnType<typeof posthog.mcpAnalyticsIntentClustersRetrieve>>;
|
|
447
|
+
|
|
448
|
+
const result: McpAnalyticsIntentClustersRetrieveOutput = await posthog.mcpAnalyticsIntentClustersRetrieve();
|
|
449
|
+
|
|
450
|
+
// Result shape (from schema): ({ status: "idle" | "computing" | "error"; error_message: string; last_computed_at: string | null; last_computed_by_email: string; clusters: ({ id: number; label: string; intent_count: number; session_count: number; cal...
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
### `posthog.mcpAnalyticsIntentClustersRecompute`
|
|
454
|
+
|
|
455
|
+
- **HTTP**: `POST /api/projects/{project_id}/mcp_analytics/intent_clusters/recompute/`
|
|
456
|
+
- **What it does**: Trigger an asynchronous recompute of the intent cluster snapshot. The task runs in the background; poll the GET endpoint for progress (status transitions to 'idle' or 'error').
|
|
457
|
+
- **OpenAPI operationId**: `mcp_analytics_intent_clusters_recompute`
|
|
458
|
+
- **Path params**: None
|
|
459
|
+
- **Query params**: None
|
|
460
|
+
- **Response codes**: `202`
|
|
461
|
+
- **Transport options**: None
|
|
462
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
463
|
+
|
|
464
|
+
**Inputs**
|
|
465
|
+
|
|
466
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
467
|
+
- Client transport options: None
|
|
468
|
+
|
|
469
|
+
**Outputs**
|
|
470
|
+
|
|
471
|
+
- Client return type: `unknown`
|
|
472
|
+
- OpenAPI response codes: `202`
|
|
473
|
+
|
|
474
|
+
```ts
|
|
475
|
+
import posthog from "@utdk/posthog";
|
|
476
|
+
|
|
477
|
+
type McpAnalyticsIntentClustersRecomputeInput = Parameters<typeof posthog.mcpAnalyticsIntentClustersRecompute> extends [infer T, ...unknown[]] ? T : undefined;
|
|
478
|
+
type McpAnalyticsIntentClustersRecomputeOutput = Awaited<ReturnType<typeof posthog.mcpAnalyticsIntentClustersRecompute>>;
|
|
479
|
+
|
|
480
|
+
const result: McpAnalyticsIntentClustersRecomputeOutput = await posthog.mcpAnalyticsIntentClustersRecompute();
|
|
481
|
+
|
|
482
|
+
// Result shape (from schema): unknown
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
### `posthog.mcpAnalyticsMissingCapabilitiesList`
|
|
486
|
+
|
|
487
|
+
- **HTTP**: `GET /api/projects/{project_id}/mcp_analytics/missing_capabilities/`
|
|
488
|
+
- **What it does**: List missing capability reports for the current project, newest first.
|
|
489
|
+
- **OpenAPI operationId**: `mcp_analytics_missing_capabilities_list`
|
|
490
|
+
- **Path params**: None
|
|
491
|
+
- **Query params**: `limit`, `offset`
|
|
492
|
+
- **Response codes**: `200`
|
|
493
|
+
- **Transport options**: None
|
|
494
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
495
|
+
|
|
496
|
+
**Inputs**
|
|
497
|
+
|
|
498
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
499
|
+
- Client transport options: None
|
|
500
|
+
|
|
501
|
+
**Outputs**
|
|
502
|
+
|
|
503
|
+
- Client return type: `{ count: number; next?: string | null; previous?: string | null; results: ({ id: string; kind: "feedback" | "missing_capability"; goal: string; summary: string; category: string; blocked: boolean | null; attempted_tool:...`
|
|
504
|
+
- OpenAPI response codes: `200`
|
|
505
|
+
|
|
506
|
+
```ts
|
|
507
|
+
import posthog from "@utdk/posthog";
|
|
508
|
+
|
|
509
|
+
type McpAnalyticsMissingCapabilitiesListInput = Parameters<typeof posthog.mcpAnalyticsMissingCapabilitiesList> extends [infer T, ...unknown[]] ? T : undefined;
|
|
510
|
+
type McpAnalyticsMissingCapabilitiesListOutput = Awaited<ReturnType<typeof posthog.mcpAnalyticsMissingCapabilitiesList>>;
|
|
511
|
+
|
|
512
|
+
const result: McpAnalyticsMissingCapabilitiesListOutput = await posthog.mcpAnalyticsMissingCapabilitiesList();
|
|
513
|
+
|
|
514
|
+
// Result shape (from schema): { count: number; next?: string | null; previous?: string | null; results: ({ id: string; kind: "feedback" | "missing_capability"; goal: string; summary: string; category: string; blocked: boolean | null; attempted_tool:...
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
### `posthog.mcpAnalyticsMissingCapabilitiesCreate`
|
|
518
|
+
|
|
519
|
+
- **HTTP**: `POST /api/projects/{project_id}/mcp_analytics/missing_capabilities/`
|
|
520
|
+
- **What it does**: Create a new missing capability report for the current project.
|
|
521
|
+
- **OpenAPI operationId**: `mcp_analytics_missing_capabilities_create`
|
|
522
|
+
- **Path params**: None
|
|
523
|
+
- **Query params**: None
|
|
524
|
+
- **Response codes**: `201`
|
|
525
|
+
- **Transport options**: None
|
|
526
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
527
|
+
|
|
528
|
+
**Inputs**
|
|
529
|
+
|
|
530
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
531
|
+
- Client transport options: None
|
|
532
|
+
|
|
533
|
+
**Outputs**
|
|
534
|
+
|
|
535
|
+
- Client return type: `{ id: string; kind: "feedback" | "missing_capability"; goal: string; summary: string; category: string; blocked: boolean | null; attempted_tool: string; mcp_client_name: string; mcp_client_version: string; mcp_protocol_...`
|
|
536
|
+
- OpenAPI response codes: `201`
|
|
537
|
+
|
|
538
|
+
```ts
|
|
539
|
+
import posthog from "@utdk/posthog";
|
|
540
|
+
|
|
541
|
+
type McpAnalyticsMissingCapabilitiesCreateInput = Parameters<typeof posthog.mcpAnalyticsMissingCapabilitiesCreate> extends [infer T, ...unknown[]] ? T : undefined;
|
|
542
|
+
type McpAnalyticsMissingCapabilitiesCreateOutput = Awaited<ReturnType<typeof posthog.mcpAnalyticsMissingCapabilitiesCreate>>;
|
|
543
|
+
|
|
544
|
+
const result: McpAnalyticsMissingCapabilitiesCreateOutput = await posthog.mcpAnalyticsMissingCapabilitiesCreate();
|
|
545
|
+
|
|
546
|
+
// Result shape (from schema): { id: string; kind: "feedback" | "missing_capability"; goal: string; summary: string; category: string; blocked: boolean | null; attempted_tool: string; mcp_client_name: string; mcp_client_version: string; mcp_protocol_...
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
### `posthog.mcpAnalyticsSessionsList`
|
|
550
|
+
|
|
551
|
+
- **HTTP**: `GET /api/projects/{project_id}/mcp_analytics/sessions/`
|
|
552
|
+
- **What it does**: List MCP sessions for the current project, derived by grouping $mcp_tool_call events by $mcp_session_id. Ordered by newest session start first by default.
|
|
553
|
+
- **OpenAPI operationId**: `mcp_analytics_sessions_list`
|
|
554
|
+
- **Path params**: None
|
|
555
|
+
- **Query params**: `date_from`, `date_to`, `limit`, `offset`, `order_by`, `search`
|
|
556
|
+
- **Response codes**: `200`
|
|
557
|
+
- **Transport options**: None
|
|
558
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
559
|
+
|
|
560
|
+
**Inputs**
|
|
561
|
+
|
|
562
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
563
|
+
- Client transport options: None
|
|
564
|
+
|
|
565
|
+
**Outputs**
|
|
566
|
+
|
|
567
|
+
- Client return type: `{ results: ({ session_id: string; tool_calls: number; session_start: string; session_end: string; distinct_id_count: number; tools_used: (string)[]; mcp_client_name: string; distinct_id: string; person_email: string; pe...`
|
|
568
|
+
- OpenAPI response codes: `200`
|
|
569
|
+
|
|
570
|
+
```ts
|
|
571
|
+
import posthog from "@utdk/posthog";
|
|
572
|
+
|
|
573
|
+
type McpAnalyticsSessionsListInput = Parameters<typeof posthog.mcpAnalyticsSessionsList> extends [infer T, ...unknown[]] ? T : undefined;
|
|
574
|
+
type McpAnalyticsSessionsListOutput = Awaited<ReturnType<typeof posthog.mcpAnalyticsSessionsList>>;
|
|
575
|
+
|
|
576
|
+
const result: McpAnalyticsSessionsListOutput = await posthog.mcpAnalyticsSessionsList();
|
|
577
|
+
|
|
578
|
+
// Result shape (from schema): { results: ({ session_id: string; tool_calls: number; session_start: string; session_end: string; distinct_id_count: number; tools_used: (string)[]; mcp_client_name: string; distinct_id: string; person_email: string; pe...
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
### `posthog.mcpAnalyticsSessionsGenerateIntent`
|
|
582
|
+
|
|
583
|
+
- **HTTP**: `POST /api/projects/{project_id}/mcp_analytics/sessions/{id}/generate_intent/`
|
|
584
|
+
- **What it does**: Generate (or return the cached) LLM summary of the agent's goal for a session, derived from its recorded $mcp_intents. The first call summarises and persists the result; subsequent calls return the stored summary.
|
|
585
|
+
- **OpenAPI operationId**: `mcp_analytics_sessions_generate_intent`
|
|
586
|
+
- **Path params**: `id`
|
|
587
|
+
- **Query params**: `date_from`
|
|
588
|
+
- **Response codes**: `200`
|
|
589
|
+
- **Transport options**: None
|
|
590
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
591
|
+
|
|
592
|
+
**Inputs**
|
|
593
|
+
|
|
594
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
595
|
+
- Client transport options: None
|
|
596
|
+
|
|
597
|
+
**Outputs**
|
|
598
|
+
|
|
599
|
+
- Client return type: `{ session_id: string; intent: string }`
|
|
600
|
+
- OpenAPI response codes: `200`
|
|
601
|
+
|
|
602
|
+
```ts
|
|
603
|
+
import posthog from "@utdk/posthog";
|
|
604
|
+
|
|
605
|
+
type McpAnalyticsSessionsGenerateIntentInput = Parameters<typeof posthog.mcpAnalyticsSessionsGenerateIntent> extends [infer T, ...unknown[]] ? T : undefined;
|
|
606
|
+
type McpAnalyticsSessionsGenerateIntentOutput = Awaited<ReturnType<typeof posthog.mcpAnalyticsSessionsGenerateIntent>>;
|
|
607
|
+
|
|
608
|
+
const result: McpAnalyticsSessionsGenerateIntentOutput = await posthog.mcpAnalyticsSessionsGenerateIntent();
|
|
609
|
+
|
|
610
|
+
// Result shape (from schema): { session_id: string; intent: string }
|
|
611
|
+
```
|
|
612
|
+
|
|
613
|
+
### `posthog.mcpAnalyticsSessionsToolCalls`
|
|
614
|
+
|
|
615
|
+
- **HTTP**: `GET /api/projects/{project_id}/mcp_analytics/sessions/{id}/tool_calls/`
|
|
616
|
+
- **What it does**: List a page of the $mcp_tool_call events that belong to a given $session_id, in chronological order.
|
|
617
|
+
- **OpenAPI operationId**: `mcp_analytics_sessions_tool_calls`
|
|
618
|
+
- **Path params**: `id`
|
|
619
|
+
- **Query params**: `date_from`, `limit`, `offset`
|
|
620
|
+
- **Response codes**: `200`
|
|
621
|
+
- **Transport options**: None
|
|
622
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
623
|
+
|
|
624
|
+
**Inputs**
|
|
625
|
+
|
|
626
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
627
|
+
- Client transport options: None
|
|
628
|
+
|
|
629
|
+
**Outputs**
|
|
630
|
+
|
|
631
|
+
- Client return type: `{ results: ({ event_id: string; timestamp: string; tool_name: string; intent: string; is_error: boolean; error_message: string; duration_ms: number | null })[]; has_next: boolean }`
|
|
632
|
+
- OpenAPI response codes: `200`
|
|
633
|
+
|
|
634
|
+
```ts
|
|
635
|
+
import posthog from "@utdk/posthog";
|
|
636
|
+
|
|
637
|
+
type McpAnalyticsSessionsToolCallsInput = Parameters<typeof posthog.mcpAnalyticsSessionsToolCalls> extends [infer T, ...unknown[]] ? T : undefined;
|
|
638
|
+
type McpAnalyticsSessionsToolCallsOutput = Awaited<ReturnType<typeof posthog.mcpAnalyticsSessionsToolCalls>>;
|
|
639
|
+
|
|
640
|
+
const result: McpAnalyticsSessionsToolCallsOutput = await posthog.mcpAnalyticsSessionsToolCalls();
|
|
641
|
+
|
|
642
|
+
// Result shape (from schema): { results: ({ event_id: string; timestamp: string; tool_name: string; intent: string; is_error: boolean; error_message: string; duration_ms: number | null })[]; has_next: boolean }
|
|
643
|
+
```
|
|
644
|
+
|
|
645
|
+
### `posthog.mcpAnalyticsSessionsActivityOverview`
|
|
646
|
+
|
|
647
|
+
- **HTTP**: `GET /api/projects/{project_id}/mcp_analytics/sessions/activity_overview/`
|
|
648
|
+
- **What it does**: Aggregate counters, top tools, agent clients, and the most recent tool calls for the last 30 days, computed in one request. Powers the dashboard's activity view; always computed fresh so polling callers watch data arrive.
|
|
649
|
+
- **OpenAPI operationId**: `mcp_analytics_sessions_activity_overview`
|
|
650
|
+
- **Path params**: None
|
|
651
|
+
- **Query params**: None
|
|
652
|
+
- **Response codes**: `200`
|
|
653
|
+
- **Transport options**: None
|
|
654
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
655
|
+
|
|
656
|
+
**Inputs**
|
|
657
|
+
|
|
658
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
659
|
+
- Client transport options: None
|
|
660
|
+
|
|
661
|
+
**Outputs**
|
|
662
|
+
|
|
663
|
+
- Client return type: `{ stats: { total_calls: number; distinct_tools: number; distinct_sessions: number; distinct_clients: number; calls_with_intent: number; error_calls: number; missing_capability_reports: number }; top_tools: ({ tool: stri...`
|
|
664
|
+
- OpenAPI response codes: `200`
|
|
665
|
+
|
|
666
|
+
```ts
|
|
667
|
+
import posthog from "@utdk/posthog";
|
|
668
|
+
|
|
669
|
+
type McpAnalyticsSessionsActivityOverviewInput = Parameters<typeof posthog.mcpAnalyticsSessionsActivityOverview> extends [infer T, ...unknown[]] ? T : undefined;
|
|
670
|
+
type McpAnalyticsSessionsActivityOverviewOutput = Awaited<ReturnType<typeof posthog.mcpAnalyticsSessionsActivityOverview>>;
|
|
671
|
+
|
|
672
|
+
const result: McpAnalyticsSessionsActivityOverviewOutput = await posthog.mcpAnalyticsSessionsActivityOverview();
|
|
673
|
+
|
|
674
|
+
// Result shape (from schema): { stats: { total_calls: number; distinct_tools: number; distinct_sessions: number; distinct_clients: number; calls_with_intent: number; error_calls: number; missing_capability_reports: number }; top_tools: ({ tool: stri...
|
|
675
|
+
```
|
|
676
|
+
|
|
677
|
+
### `posthog.mcpAnalyticsSessionsIntentDigest`
|
|
678
|
+
|
|
679
|
+
- **HTTP**: `POST /api/projects/{project_id}/mcp_analytics/sessions/intent_digest/`
|
|
680
|
+
- **What it does**: Generate (or return the cached) LLM digest of what agents are trying to do with this MCP server, derived from the most recent recorded $mcp_intents across all sessions. Content-addressed cache: only regenerates when new intents arrive. Powers the dashboard's low-volume activity stage.
|
|
681
|
+
- **OpenAPI operationId**: `mcp_analytics_sessions_intent_digest`
|
|
682
|
+
- **Path params**: None
|
|
683
|
+
- **Query params**: None
|
|
684
|
+
- **Response codes**: `200`, `503`
|
|
685
|
+
- **Transport options**: None
|
|
686
|
+
- **TypeScript**: [Client interface](../types.ts)
|
|
687
|
+
|
|
688
|
+
**Inputs**
|
|
689
|
+
|
|
690
|
+
- Client input type: `{ [key: string]: unknown }`
|
|
691
|
+
- Client transport options: None
|
|
692
|
+
|
|
693
|
+
**Outputs**
|
|
694
|
+
|
|
695
|
+
- Client return type: `{ digest: string | null; intent_count: number }`
|
|
696
|
+
- OpenAPI response codes: `200`, `503`
|
|
697
|
+
|
|
698
|
+
```ts
|
|
699
|
+
import posthog from "@utdk/posthog";
|
|
700
|
+
|
|
701
|
+
type McpAnalyticsSessionsIntentDigestInput = Parameters<typeof posthog.mcpAnalyticsSessionsIntentDigest> extends [infer T, ...unknown[]] ? T : undefined;
|
|
702
|
+
type McpAnalyticsSessionsIntentDigestOutput = Awaited<ReturnType<typeof posthog.mcpAnalyticsSessionsIntentDigest>>;
|
|
703
|
+
|
|
704
|
+
const result: McpAnalyticsSessionsIntentDigestOutput = await posthog.mcpAnalyticsSessionsIntentDigest();
|
|
705
|
+
|
|
706
|
+
// Result shape (from schema): { digest: string | null; intent_count: number }
|
|
707
|
+
```
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
<!-- prompt-hash:
|
|
711
|
+
8c3694991a4c289225f05a4e8f1e098cc74d085a088d7dffd82f00d93797b7f8
|
|
712
|
+
-->
|