@@ -8,49 +8,46 @@ export type TelemetryBoolSet = "true" | "false";
88/**
99 * Base interface for all events
1010 */
11- export interface Event {
11+ export type TelemetryEvent < T > = {
1212 timestamp : string ;
1313 source : "mdbmcp" ;
14- properties : Record < string , unknown > ;
15- }
16-
17- export interface BaseEvent extends Event {
18- properties : CommonProperties & {
14+ properties : T & {
1915 component : string ;
2016 duration_ms : number ;
2117 result : TelemetryResult ;
2218 category : string ;
23- } & Event [ "properties" ] ;
24- }
19+ } ;
20+ } ;
21+
22+ export type BaseEvent = TelemetryEvent < unknown > ;
2523
2624/**
2725 * Interface for tool events
2826 */
29- export interface ToolEvent extends BaseEvent {
30- properties : {
31- command : string ;
32- error_code ?: string ;
33- error_type ?: string ;
34- project_id ?: string ;
35- org_id ?: string ;
36- cluster_name ?: string ;
37- is_atlas ?: boolean ;
38- } & BaseEvent [ "properties" ] ;
39- }
27+ export type ToolEventProperties = {
28+ command : string ;
29+ error_code ?: string ;
30+ error_type ?: string ;
31+ project_id ?: string ;
32+ org_id ?: string ;
33+ cluster_name ?: string ;
34+ is_atlas ?: boolean ;
35+ } ;
4036
37+ export type ToolEvent = TelemetryEvent < ToolEventProperties > ;
4138/**
4239 * Interface for server events
4340 */
44- export interface ServerEvent extends BaseEvent {
45- properties : {
46- command : ServerCommand ;
47- reason ?: string ;
48- startup_time_ms ?: number ;
49- runtime_duration_ms ?: number ;
50- read_only_mode ?: boolean ;
51- disabled_tools ?: string [ ] ;
52- } & BaseEvent [ "properties" ] ;
53- }
41+ export type ServerEventProperties = {
42+ command : ServerCommand ;
43+ reason ?: string ;
44+ startup_time_ms ?: number ;
45+ runtime_duration_ms ?: number ;
46+ read_only_mode ?: boolean ;
47+ disabled_tools ?: string [ ] ;
48+ } ;
49+
50+ export type ServerEvent = TelemetryEvent < ServerEventProperties > ;
5451
5552/**
5653 * Interface for static properties, they can be fetched once and reused.
@@ -69,6 +66,7 @@ export type CommonStaticProperties = {
6966 * Common properties for all events that might change.
7067 */
7168export type CommonProperties = {
69+ device_id ?: string ;
7270 mcp_client_version ?: string ;
7371 mcp_client_name ?: string ;
7472 config_atlas_auth ?: TelemetryBoolSet ;
0 commit comments