@gremlin/mcp-server 2.2.1 → 2.3.0

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.
@@ -0,0 +1,41 @@
1
+ export interface OpenApiSpec {
2
+ paths: Record<string, PathItem>;
3
+ }
4
+ export interface PathItem {
5
+ [method: string]: Operation | undefined;
6
+ }
7
+ export interface Operation {
8
+ summary?: string;
9
+ description?: string;
10
+ operationId?: string;
11
+ tags?: string[];
12
+ parameters?: Parameter[];
13
+ requestBody?: RequestBody;
14
+ security?: Array<Record<string, string[]>>;
15
+ }
16
+ export interface Parameter {
17
+ name: string;
18
+ in: 'path' | 'query' | 'header' | 'cookie';
19
+ required?: boolean;
20
+ description?: string;
21
+ schema?: Record<string, unknown>;
22
+ }
23
+ export interface RequestBody {
24
+ required?: boolean;
25
+ description?: string;
26
+ content?: Record<string, {
27
+ schema?: Record<string, unknown>;
28
+ }>;
29
+ }
30
+ export interface EndpointMatch {
31
+ method: string;
32
+ path: string;
33
+ summary?: string;
34
+ description?: string;
35
+ operationId?: string;
36
+ tags?: string[];
37
+ parameters?: Parameter[];
38
+ requestBody?: RequestBody;
39
+ }
40
+ export declare function getSpec(): Promise<OpenApiSpec>;
41
+ export declare function searchSpec(spec: OpenApiSpec, query: string, methodFilter?: string, tagFilter?: string, topN?: number): EndpointMatch[];
@@ -0,0 +1,9 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import type { GremlinClient } from "../client/interface";
3
+ /**
4
+ * Register all resources with the MCP server
5
+ *
6
+ * @param server - The MCP server instance
7
+ * @param api - The Gremlin API client
8
+ */
9
+ export declare function registerResources(server: McpServer, api: GremlinClient): void;
@@ -0,0 +1,49 @@
1
+ import z from "zod";
2
+ import type { GremlinClient } from "../client/interface";
3
+ import type { ReportPeriod } from "../types";
4
+ export declare function createGetPricingReportTool(api: GremlinClient): {
5
+ name: string;
6
+ description: string;
7
+ schema: {
8
+ startDate: z.ZodString;
9
+ endDate: z.ZodString;
10
+ trackingPeriod: z.ZodOptional<z.ZodEnum<["Daily", "Weekly", "Monthly"]>>;
11
+ };
12
+ handler: (args: {
13
+ startDate: string;
14
+ endDate: string;
15
+ trackingPeriod?: "Daily" | "Weekly" | "Monthly";
16
+ }) => Promise<import("../types").PricingReport>;
17
+ };
18
+ export declare function createGetClientSummaryTool(api: GremlinClient): {
19
+ name: string;
20
+ description: string;
21
+ schema: {
22
+ teamId: z.ZodString;
23
+ start: z.ZodString;
24
+ end: z.ZodString;
25
+ period: z.ZodEnum<["MONTHS", "WEEKS", "DAYS"]>;
26
+ };
27
+ handler: (args: {
28
+ teamId: string;
29
+ start: string;
30
+ end: string;
31
+ period: ReportPeriod;
32
+ }) => Promise<unknown>;
33
+ };
34
+ export declare function createGetAttackSummaryTool(api: GremlinClient): {
35
+ name: string;
36
+ description: string;
37
+ schema: {
38
+ teamId: z.ZodString;
39
+ start: z.ZodString;
40
+ end: z.ZodString;
41
+ period: z.ZodEnum<["MONTHS", "WEEKS", "DAYS"]>;
42
+ };
43
+ handler: (args: {
44
+ teamId: string;
45
+ start: string;
46
+ end: string;
47
+ period: ReportPeriod;
48
+ }) => Promise<unknown>;
49
+ };
@@ -0,0 +1,3 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import type { GremlinClient } from "../client/interface";
3
+ export declare function registerTools(server: McpServer, api: GremlinClient): void;
@@ -0,0 +1,49 @@
1
+ import z from 'zod';
2
+ import type { GremlinClient } from '../client/interface';
3
+ import type { ElicitationClient } from '../elicitation';
4
+ import { OpenApiSpec } from '../openapi/spec-loader';
5
+ export declare function createSearchGremlinApiTool(_api: GremlinClient): {
6
+ name: string;
7
+ description: string;
8
+ schema: {
9
+ query: z.ZodString;
10
+ method: z.ZodOptional<z.ZodEnum<["GET", "POST", "PUT", "DELETE", "PATCH"]>>;
11
+ tag: z.ZodOptional<z.ZodString>;
12
+ limit: z.ZodOptional<z.ZodNumber>;
13
+ };
14
+ handler: (args: {
15
+ query: string;
16
+ method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
17
+ tag?: string;
18
+ limit?: number;
19
+ }) => Promise<{
20
+ message: string;
21
+ results: import("../openapi/spec-loader").EndpointMatch[];
22
+ }>;
23
+ };
24
+ export declare function getRunPrivileges(spec: OpenApiSpec, specPath: string, method: string): string[];
25
+ export declare function createExecuteGremlinApiTool(api: GremlinClient, elicitation: ElicitationClient): {
26
+ name: string;
27
+ description: string;
28
+ schema: {
29
+ method: z.ZodEnum<["GET", "POST", "PUT", "DELETE", "PATCH"]>;
30
+ path: z.ZodString;
31
+ pathParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
32
+ queryParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
33
+ body: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
34
+ confirmExecution: z.ZodOptional<z.ZodBoolean>;
35
+ };
36
+ annotations: {
37
+ destructiveHint: boolean;
38
+ idempotentHint: boolean;
39
+ openWorldHint: boolean;
40
+ };
41
+ handler: (args: {
42
+ method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
43
+ path: string;
44
+ pathParams?: Record<string, string>;
45
+ queryParams?: Record<string, string>;
46
+ body?: Record<string, unknown>;
47
+ confirmExecution?: boolean;
48
+ }) => Promise<unknown>;
49
+ };
@@ -0,0 +1,98 @@
1
+ import z from "zod";
2
+ import type { GremlinClient } from "../client/interface";
3
+ import type { ReliabilityTestRun } from "../types";
4
+ export declare function createGetReliabilityExperimentTool(api: GremlinClient): {
5
+ name: string;
6
+ description: string;
7
+ schema: {
8
+ teamId: z.ZodString;
9
+ serviceId: z.ZodString;
10
+ dependencyId: z.ZodOptional<z.ZodString>;
11
+ testId: z.ZodOptional<z.ZodString>;
12
+ limit: z.ZodOptional<z.ZodNumber>;
13
+ includeScenarioRun: z.ZodOptional<z.ZodBoolean>;
14
+ };
15
+ handler: (args: {
16
+ serviceId: string;
17
+ teamId: string;
18
+ dependencyId?: string;
19
+ testId?: string;
20
+ limit?: number;
21
+ includeScenarioRun?: boolean;
22
+ }) => Promise<ReliabilityTestRun | import("../types").Page<ReliabilityTestRun>>;
23
+ };
24
+ export declare function createGetReliabilityReportTool(api: GremlinClient): {
25
+ name: string;
26
+ description: string;
27
+ schema: {
28
+ teamId: z.ZodString;
29
+ serviceId: z.ZodString;
30
+ date: z.ZodOptional<z.ZodString>;
31
+ };
32
+ handler: (args: {
33
+ serviceId: string;
34
+ teamId: string;
35
+ date?: string;
36
+ }) => Promise<import("../types").ReliabilityReport>;
37
+ };
38
+ export declare function createGetCurrentTestSuiteTool(api: GremlinClient): {
39
+ name: string;
40
+ description: string;
41
+ schema: {
42
+ teamId: z.ZodOptional<z.ZodString>;
43
+ };
44
+ handler: (args: {
45
+ teamId: string;
46
+ }) => Promise<import("../types").ReliabilityTestSuite[]>;
47
+ };
48
+ export declare function createRunReliabilityTestTool(api: GremlinClient): {
49
+ name: string;
50
+ description: string;
51
+ schema: {
52
+ teamId: z.ZodString;
53
+ serviceId: z.ZodString;
54
+ reliabilityTestId: z.ZodString;
55
+ dependencyId: z.ZodOptional<z.ZodString>;
56
+ failureFlagName: z.ZodOptional<z.ZodString>;
57
+ includeScenarioRun: z.ZodOptional<z.ZodBoolean>;
58
+ };
59
+ annotations: {
60
+ destructiveHint: boolean;
61
+ idempotentHint: boolean;
62
+ openWorldHint: boolean;
63
+ };
64
+ handler: (args: {
65
+ teamId: string;
66
+ serviceId: string;
67
+ reliabilityTestId: string;
68
+ dependencyId?: string;
69
+ failureFlagName?: string;
70
+ includeScenarioRun?: boolean;
71
+ }) => Promise<ReliabilityTestRun>;
72
+ };
73
+ export declare function createGetPendingTestRunsTool(api: GremlinClient): {
74
+ name: string;
75
+ description: string;
76
+ schema: {
77
+ teamId: z.ZodString;
78
+ serviceId: z.ZodString;
79
+ };
80
+ handler: (args: {
81
+ teamId: string;
82
+ serviceId: string;
83
+ }) => Promise<import("../types").PendingReliabilityTestRun[]>;
84
+ };
85
+ export declare function createGetRecentReliabilityTestsTool(api: GremlinClient): {
86
+ name: string;
87
+ description: string;
88
+ schema: {
89
+ teamId: z.ZodString;
90
+ pageSize: z.ZodOptional<z.ZodNumber>;
91
+ pageToken: z.ZodOptional<z.ZodString>;
92
+ };
93
+ handler: (args: {
94
+ teamId: string;
95
+ pageSize?: number;
96
+ pageToken?: string;
97
+ }) => Promise<import("../types").Page<import("../types").RecentRunResponse>>;
98
+ };
@@ -0,0 +1,55 @@
1
+ import z from "zod";
2
+ import type { GremlinClient } from "../client/interface";
3
+ import type { Service } from "../types";
4
+ export declare function createGetServiceDependenciesTool(api: GremlinClient): {
5
+ name: string;
6
+ description: string;
7
+ schema: {
8
+ teamId: z.ZodString;
9
+ serviceId: z.ZodString;
10
+ };
11
+ handler: (args: {
12
+ serviceId: string;
13
+ teamId: string;
14
+ }) => Promise<import("../types").ReliabilityReport>;
15
+ };
16
+ export declare function createListServiceRisksTool(api: GremlinClient): {
17
+ name: string;
18
+ description: string;
19
+ schema: {
20
+ teamId: z.ZodString;
21
+ serviceId: z.ZodString;
22
+ };
23
+ handler: (args: {
24
+ serviceId: string;
25
+ teamId: string;
26
+ }) => Promise<import("../types").ReliabilityReport>;
27
+ };
28
+ export declare function createGetServiceStatusChecksTool(api: GremlinClient): {
29
+ name: string;
30
+ description: string;
31
+ schema: {
32
+ teamId: z.ZodString;
33
+ serviceId: z.ZodString;
34
+ };
35
+ handler: (args: {
36
+ serviceId: string;
37
+ teamId: string;
38
+ }) => Promise<import("../types").ReliabilityReport>;
39
+ };
40
+ export declare function createListServicesTool(api: GremlinClient): {
41
+ name: string;
42
+ description: string;
43
+ schema: {
44
+ $schema: string;
45
+ type: string;
46
+ properties: {};
47
+ };
48
+ /**
49
+ * Handles the list_services tool request with pagination and search
50
+ *
51
+ * @param params - none currently, but will be extended for pagination
52
+ * @returns list of services with their details
53
+ */
54
+ handler: (params: {}) => Promise<Service[]>;
55
+ };
@@ -0,0 +1,7 @@
1
+ import type { GremlinClient } from "../client/interface";
2
+ export declare function createListTeamsTool(api: GremlinClient): {
3
+ name: string;
4
+ description: string;
5
+ schema: {};
6
+ handler: () => Promise<import("..").Team[]>;
7
+ };
@@ -0,0 +1,155 @@
1
+ export interface Team {
2
+ identifier: string;
3
+ name: string;
4
+ companyId: string;
5
+ production: boolean;
6
+ }
7
+ export interface Service {
8
+ serviceId: string;
9
+ teamId: string;
10
+ name: string;
11
+ targetingStrategy?: string;
12
+ applicationSelector?: string;
13
+ description?: string;
14
+ schedulableTests?: string[];
15
+ }
16
+ export interface Self {
17
+ identifier: string;
18
+ user_id: string;
19
+ company_id: string;
20
+ team_memberships: string[];
21
+ }
22
+ export interface ReliabilityReport {
23
+ reliabilityScore: number;
24
+ testSuiteId: string;
25
+ reliability: Map<string, ReliabilityCategorySummary>;
26
+ }
27
+ export interface ReliabilityCategorySummary {
28
+ category: string;
29
+ score: number;
30
+ policyTarget: string;
31
+ policyStates: PolicyEvaluation[];
32
+ }
33
+ export interface PolicyEvaluation {
34
+ policyId: string;
35
+ reliabilityTestId: string;
36
+ serviceId: string;
37
+ dependencyId?: string;
38
+ failureFlagName?: string;
39
+ evaluationTime?: number;
40
+ staleness: number;
41
+ result: 'PASSED' | 'FAILED' | 'EXPIRED' | 'NEVER_RUN';
42
+ }
43
+ interface ScenarioRunResponse {
44
+ scenarioId: string;
45
+ runNumber: number;
46
+ orgId: string;
47
+ name: string;
48
+ description: string;
49
+ createdAt: Date;
50
+ updatedAt: Date;
51
+ endTime?: Date;
52
+ createSource: string;
53
+ triggerSource: string;
54
+ results: {
55
+ status: 'Passed' | 'Failed' | 'Unsure';
56
+ };
57
+ graph: ScenarioGraph;
58
+ }
59
+ interface ScenarioGraph {
60
+ nodesRecursive: never[];
61
+ expectedLength: number;
62
+ graph: Record<string, ScenarioGraphNode>;
63
+ }
64
+ interface ScenarioGraphNode {
65
+ id: string;
66
+ state: {
67
+ lifeCycle: 'NotStarted' | 'Running' | 'Completed' | 'Failed' | 'Halted' | 'HaltRequested' | 'Active' | 'Successful';
68
+ };
69
+ }
70
+ interface Suggestion {
71
+ markdown: string;
72
+ embeddings: {
73
+ serviceId: string;
74
+ key: string;
75
+ }[];
76
+ }
77
+ interface DiagnosisResponse {
78
+ summary: string;
79
+ suggestions: Suggestion[];
80
+ }
81
+ export interface PendingReliabilityTestRun {
82
+ reliabilityTestId: string;
83
+ reliabilityTestName: string;
84
+ dependencyId?: string;
85
+ dependencyName?: string;
86
+ failureFlagName?: string;
87
+ triggerSource: 'MANUAL' | 'RUN_ALL' | 'SCHEDULED' | 'RECURRING_SCHEDULE';
88
+ triggeredBy?: string;
89
+ expectedTriggerTime?: string;
90
+ }
91
+ export interface ReliabilityTestRunParameters {
92
+ serviceId: string;
93
+ dependencyId?: string;
94
+ failureFlagName?: string;
95
+ }
96
+ export interface ReliabilityTestRun {
97
+ guid: string;
98
+ serviceId: string;
99
+ dependencyId?: string;
100
+ dependencyName?: string;
101
+ failureFlagName?: string;
102
+ isDependencySpof?: boolean;
103
+ runNumber?: number;
104
+ run: ScenarioRunResponse;
105
+ diagnosis?: DiagnosisResponse;
106
+ }
107
+ export interface RecentRunResponse {
108
+ serviceId: string;
109
+ dependencyId?: string;
110
+ dependencyName?: string;
111
+ diagnosisAvailable: boolean;
112
+ createTime: Date;
113
+ endTime?: Date;
114
+ passCriteria: string;
115
+ reliabilityTestId: string;
116
+ reliabilityTestName: string;
117
+ runNumber: number;
118
+ status: 'Passed' | 'Failed' | 'Unsure';
119
+ triggerSource: string;
120
+ triggeredBy: string;
121
+ }
122
+ export interface Page<T> {
123
+ items: T[];
124
+ pageToken?: string;
125
+ pageSize?: number;
126
+ }
127
+ export interface ReliabilityTestSuite {
128
+ identifier: string;
129
+ name: string;
130
+ description?: string;
131
+ targetTeamIds: string[];
132
+ testResponses: any[];
133
+ excludedRiskIds?: string[];
134
+ }
135
+ export interface PricingUsage {
136
+ start: string;
137
+ end: string;
138
+ maxActiveAgents: number;
139
+ maxTargetableApplications: number;
140
+ uniqueTargetsApplication: number;
141
+ uniqueTargetsContainer: number;
142
+ uniqueTargetsHost: number;
143
+ }
144
+ export type TrackingPeriod = 'Daily' | 'Weekly' | 'Monthly';
145
+ export interface PricingReport {
146
+ companyId: string;
147
+ startDate: string;
148
+ endDate: string;
149
+ trackingPeriod: TrackingPeriod;
150
+ usageByTrackingPeriod: PricingUsage[];
151
+ }
152
+ export type ReportPeriod = 'MONTHS' | 'WEEKS' | 'DAYS';
153
+ export interface User {
154
+ }
155
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gremlin/mcp-server",
3
- "version": "2.2.1",
3
+ "version": "2.3.0",
4
4
  "description": "Gremlin MCP Server",
5
5
  "main": "build/main.mjs",
6
6
  "bin": "build/main.mjs",
@@ -21,9 +21,9 @@
21
21
  },
22
22
  "keywords": [],
23
23
  "author": "",
24
- "license": "ISC",
24
+ "license": "Apache-2.0",
25
25
  "dependencies": {
26
- "@modelcontextprotocol/sdk": "^1.15.0",
26
+ "@modelcontextprotocol/sdk": "^1.26.0",
27
27
  "@isaacs/ttlcache": "^1.1.1",
28
28
  "zod": "^3.25.75"
29
29
  },
@@ -32,5 +32,11 @@
32
32
  "esbuild": "^0.25.8",
33
33
  "typescript": "^5.8.3",
34
34
  "vitest": "^4.0.18"
35
+ },
36
+ "overrides": {
37
+ "vite": "7.3.3",
38
+ "rollup": "4.60.4",
39
+ "postcss": "8.5.14",
40
+ "picomatch": "4.0.4"
35
41
  }
36
42
  }