@jupiterone/jupiterone-mcp 0.2.0 → 0.2.2
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/README.md +1 -1
- package/dist/client/graphql/mutations.d.ts +0 -4
- package/dist/client/graphql/mutations.d.ts.map +1 -1
- package/dist/client/graphql/mutations.js +1 -78
- package/dist/client/graphql/mutations.js.map +1 -1
- package/dist/client/graphql/queries.d.ts +3 -3
- package/dist/client/graphql/queries.d.ts.map +1 -1
- package/dist/client/graphql/queries.js +3 -0
- package/dist/client/graphql/queries.js.map +1 -1
- package/dist/client/jupiterone-client.d.ts +0 -21
- package/dist/client/jupiterone-client.d.ts.map +1 -1
- package/dist/client/jupiterone-client.js +2 -20
- package/dist/client/jupiterone-client.js.map +1 -1
- package/dist/client/sanitize-error.d.ts +30 -0
- package/dist/client/sanitize-error.d.ts.map +1 -0
- package/dist/client/sanitize-error.js +63 -0
- package/dist/client/sanitize-error.js.map +1 -0
- package/dist/client/services/j1ql-service.d.ts +0 -5
- package/dist/client/services/j1ql-service.d.ts.map +1 -1
- package/dist/client/services/j1ql-service.js +0 -8
- package/dist/client/services/j1ql-service.js.map +1 -1
- package/dist/client/services/rule-service.d.ts +1 -15
- package/dist/client/services/rule-service.d.ts.map +1 -1
- package/dist/client/services/rule-service.js +0 -21
- package/dist/client/services/rule-service.js.map +1 -1
- package/dist/generated/description-map.d.ts.map +1 -1
- package/dist/generated/description-map.js +34 -18
- package/dist/generated/description-map.js.map +1 -1
- package/dist/server/mcp-server.d.ts.map +1 -1
- package/dist/server/mcp-server.js +40 -82
- package/dist/server/mcp-server.js.map +1 -1
- package/dist/types/jupiterone.d.ts +0 -32
- package/dist/types/jupiterone.d.ts.map +1 -1
- package/package.json +7 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"description-map.d.ts","sourceRoot":"","sources":["../../src/generated/description-map.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"description-map.d.ts","sourceRoot":"","sources":["../../src/generated/description-map.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAq+EjD,CAAC"}
|
|
@@ -828,13 +828,6 @@ Based on confirmed working examples, use this template:
|
|
|
828
828
|
This format ensures reliable rule creation and helps avoid common pitfalls encountered during rule development.
|
|
829
829
|
After creating a rule, you should include the rule's url in your message to the user.
|
|
830
830
|
`,
|
|
831
|
-
"create-j1ql-from-natural-language.md": `# JupiterOne Natural Language to J1QL Converter
|
|
832
|
-
|
|
833
|
-
**Purpose**: Converts natural language queries into JupiterOne Query Language (J1QL) syntax using AI-powered translation.
|
|
834
|
-
Unless the user gives a specific query to run, this should always be used for determing a query to use for any (but not exclusively) of the following:
|
|
835
|
-
- Queries for rules
|
|
836
|
-
- Queries for widgets
|
|
837
|
-
- Queries to answer a user's question regarding their data in jupiterone`,
|
|
838
831
|
"evaluate-rule.md": `# Evaluate Rule Tool
|
|
839
832
|
|
|
840
833
|
Manually trigger the evaluation of a JupiterOne alert rule. This tool forces an immediate evaluation of the rule's conditions and returns the results.
|
|
@@ -851,7 +844,7 @@ Evaluate a specific rule:
|
|
|
851
844
|
\`\`\``,
|
|
852
845
|
"execute-j1ql-query.md": `# JupiterOne J1QL Query Executor
|
|
853
846
|
|
|
854
|
-
**Purpose**: Executes JupiterOne Query Language (J1QL) queries against your JupiterOne data and returns the results. This tool is used to directly run J1QL queries
|
|
847
|
+
**Purpose**: Executes JupiterOne Query Language (J1QL) queries against your JupiterOne data and returns the results. This tool is used to directly run J1QL queries.
|
|
855
848
|
|
|
856
849
|
## Recommended Query Development Workflow
|
|
857
850
|
|
|
@@ -1249,21 +1242,42 @@ Before running any J1QL query, verify:
|
|
|
1249
1242
|
|
|
1250
1243
|
**Remember**: The execute-j1ql-query tool now provides enhanced error messages with specific suggestions. Always test queries here first!
|
|
1251
1244
|
|
|
1245
|
+
#### Response Shape
|
|
1246
|
+
|
|
1247
|
+
Every successful query returns an envelope with the following top-level fields:
|
|
1248
|
+
|
|
1249
|
+
| Field | Type | Notes |
|
|
1250
|
+
|---|---|---|
|
|
1251
|
+
| \`type\` | \`'list'\` \| \`'table'\` \| \`'tree'\` | Result shape — \`list\` returns vertices, \`table\` returns named columns (when the query uses \`RETURN\`), \`tree\` returns vertices+edges. |
|
|
1252
|
+
| \`data\` | array (or \`{vertices, edges}\` for tree) | The query results for this page. |
|
|
1253
|
+
| \`cursor\` | string \| absent | **Present means more pages exist.** Absent means pagination is complete. See Pagination below. |
|
|
1254
|
+
| \`totalCount\` | number \| absent | Total matching rows across all pages. May be an estimate — see \`estimate\`. Absent when the query had an explicit \`LIMIT\` that bounded the result. |
|
|
1255
|
+
| \`estimate\` | boolean | \`true\` means \`totalCount\` is an estimate and may change between pages; \`false\` means \`totalCount\` is exact. |
|
|
1256
|
+
| \`status\` | string | \`COMPLETED\` on success. |
|
|
1257
|
+
| \`duration\` | number | Server-side execution time in ms. |
|
|
1258
|
+
| \`correlationId\` | string | Echo for support/debugging. |
|
|
1259
|
+
| \`messages\` | array | Server-side warnings or notices (usually empty). |
|
|
1260
|
+
| \`url\` | string | Direct link to view results in the JupiterOne UI. |
|
|
1261
|
+
|
|
1262
|
+
#### Pagination
|
|
1263
|
+
|
|
1264
|
+
**The pagination rule is: continue calling the tool with the returned \`cursor\` until the response no longer contains a \`cursor\` field.** Do not infer completion from \`data.length\` — a page can return zero rows while pagination is still in progress (this is intentional behavior; the underlying engine walks variable-sized partitions). Only the absence of \`cursor\` indicates "done."
|
|
1265
|
+
|
|
1266
|
+
To paginate:
|
|
1267
|
+
1. Call \`execute-j1ql-query\` with your query (no \`cursor\`).
|
|
1268
|
+
2. Process \`data\`. If the response includes a \`cursor\`, call again with the same \`query\` and pass that \`cursor\` as the \`cursor\` parameter.
|
|
1269
|
+
3. Repeat until the response has no \`cursor\`.
|
|
1270
|
+
|
|
1271
|
+
\`totalCount\` with \`estimate: true\` may change between pages — do not use it to decide when to stop. Only \`cursor\` is authoritative.
|
|
1272
|
+
|
|
1252
1273
|
#### 📌 IMPORTANT: Query Results URL
|
|
1253
1274
|
|
|
1254
|
-
|
|
1275
|
+
The \`url\` field in every response is a direct link to view the results in the JupiterOne UI. **Always share this URL with users when presenting query results** - it allows them to:
|
|
1255
1276
|
- View the data in an interactive table format
|
|
1256
1277
|
- Export results to CSV or other formats
|
|
1257
1278
|
- Save the query for future use
|
|
1258
1279
|
- Share results with team members
|
|
1259
|
-
- Further refine the query in the JupiterOne UI
|
|
1260
|
-
|
|
1261
|
-
Example response:
|
|
1262
|
-
\`\`\`json
|
|
1263
|
-
{
|
|
1264
|
-
"data": [...query results...],
|
|
1265
|
-
"url": "https://your-account.apps.us.jupiterone.io/home/results?search=..."
|
|
1266
|
-
}`,
|
|
1280
|
+
- Further refine the query in the JupiterOne UI`,
|
|
1267
1281
|
"get-dashboard-details.md": `# Get Dashboard Details Tool
|
|
1268
1282
|
|
|
1269
1283
|
Get detailed information about a specific JupiterOne dashboard including its widgets, layout, and configuration.
|
|
@@ -1295,7 +1309,7 @@ Get all dashboards:
|
|
|
1295
1309
|
Get all available integration definitions in your JupiterOne account. This tool returns a list of integration definitions that can be used to create integration instances. Integration definitions define the types of integrations available (like AWS, Azure, GitHub, etc.) and their configuration requirements. If a user is needing a specific integration instance id for something such as a rule action, you will want to start here and then use the \`get-integration-instances\` tool. Each integration definition will have a Name and a Title field, you should use this to identify which definition is correct for what the user is looking for. As an example, if the user wants to send a slack notification as a part of a rule action, you would want to pull all of the integration definitions and find any that have Slack in the name and/or title. If there are multiple, then clarify the differences to the user and allow them to guide you on which one is correct.
|
|
1296
1310
|
|
|
1297
1311
|
## Parameters
|
|
1298
|
-
- \`cursor\` (optional): Pagination cursor to get the next page of results.
|
|
1312
|
+
- \`cursor\` (optional): Pagination cursor to get the next page of results. The response includes a \`pageInfo\`; when \`pageInfo.hasNextPage\` is true, call again with \`cursor\` set to \`pageInfo.endCursor\`, and stop once it is false. When you need a specific type of integration, page through the full list so you can select from all definitions.
|
|
1299
1313
|
- \`includeConfig\` (optional): Whether to include configuration fields in the response. When true, returns detailed configuration schemas for each integration type. Typically this should be false or omitted entirely.
|
|
1300
1314
|
|
|
1301
1315
|
## Example Usage
|
|
@@ -1343,6 +1357,7 @@ Get all integration instances in your JupiterOne account. This tool returns a li
|
|
|
1343
1357
|
## Parameters
|
|
1344
1358
|
- \`definitionId\` (optional): Filter instances by a specific integration definition ID. Use this to get only instances of a particular integration type.
|
|
1345
1359
|
- \`limit\` (optional): Maximum number of instances to return (between 1 and 1000).
|
|
1360
|
+
- \`cursor\` (optional): Pagination cursor. The response includes a \`pageInfo\` object; when \`pageInfo.hasNextPage\` is true, call this tool again with \`cursor\` set to \`pageInfo.endCursor\` to fetch the next page.
|
|
1346
1361
|
|
|
1347
1362
|
## Example Usage
|
|
1348
1363
|
Get all integration instances:
|
|
@@ -1397,6 +1412,7 @@ List integration job execution history. This tool returns information about inte
|
|
|
1397
1412
|
- \`integrationInstanceIds\` (optional): Array of instance IDs to filter jobs
|
|
1398
1413
|
- \`status\` (optional): Filter by job status (PENDING, RUNNING, COMPLETED, FAILED, CANCELLED)
|
|
1399
1414
|
- \`size\` (optional): Maximum number of jobs to return (1-1000)
|
|
1415
|
+
- \`cursor\` (optional): Pagination cursor. The response includes a \`pageInfo\` object; when \`pageInfo.hasNextPage\` is true, call this tool again with \`cursor\` set to \`pageInfo.endCursor\` to fetch the next page.
|
|
1400
1416
|
|
|
1401
1417
|
## Example Usage
|
|
1402
1418
|
Get all integration jobs:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"description-map.js","sourceRoot":"","sources":["../../src/generated/description-map.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;AAC9B,QAAA,cAAc,GAA2B;IACpD,4BAA4B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../../src/server/mcp-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAc1D,qBAAa,mBAAmB;IACvB,MAAM,EAAE,SAAS,CAAC;IACzB,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,SAAS,CAAgB;IACjC,OAAO,CAAC,qBAAqB,CAAU;gBAE3B,MAAM,EAAE,gBAAgB;IAWpC,OAAO,CAAC,YAAY;IAkDpB,OAAO,CAAC,UAAU;YAsuDJ,eAAe;YAsBf,qBAAqB;IAQnC,OAAO,CAAC,6BAA6B;IAkBrC,OAAO,CAAC,wBAAwB;IAc1B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAKtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAG5B"}
|
|
@@ -5,6 +5,7 @@ const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
|
5
5
|
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
6
6
|
const zod_1 = require("zod");
|
|
7
7
|
const jupiterone_client_js_1 = require("../client/jupiterone-client.js");
|
|
8
|
+
const package_json_1 = require("../../package.json");
|
|
8
9
|
const load_description_js_1 = require("../utils/load-description.js");
|
|
9
10
|
const j1ql_validator_js_1 = require("../utils/j1ql-validator.js");
|
|
10
11
|
class JupiterOneMcpServer {
|
|
@@ -17,7 +18,7 @@ class JupiterOneMcpServer {
|
|
|
17
18
|
this.validator = new j1ql_validator_js_1.J1QLValidator(this.client.j1qlService);
|
|
18
19
|
this.server = new mcp_js_1.McpServer({
|
|
19
20
|
name: 'jupiterone-mcp',
|
|
20
|
-
version:
|
|
21
|
+
version: package_json_1.version,
|
|
21
22
|
});
|
|
22
23
|
this.hasEnvironmentAccount = !config.accountId;
|
|
23
24
|
this.setupTools();
|
|
@@ -92,7 +93,7 @@ class JupiterOneMcpServer {
|
|
|
92
93
|
outputs: instance.outputs,
|
|
93
94
|
})),
|
|
94
95
|
pageInfo: response.pageInfo,
|
|
95
|
-
}
|
|
96
|
+
}),
|
|
96
97
|
},
|
|
97
98
|
],
|
|
98
99
|
};
|
|
@@ -183,7 +184,7 @@ class JupiterOneMcpServer {
|
|
|
183
184
|
: null,
|
|
184
185
|
tags: rule.tags,
|
|
185
186
|
remediationSteps: rule.remediationSteps,
|
|
186
|
-
}
|
|
187
|
+
}),
|
|
187
188
|
},
|
|
188
189
|
],
|
|
189
190
|
};
|
|
@@ -210,9 +211,6 @@ class JupiterOneMcpServer {
|
|
|
210
211
|
try {
|
|
211
212
|
const isConnected = await client.testConnection();
|
|
212
213
|
const accountInfo = isConnected ? await client.getAccountInfo() : null;
|
|
213
|
-
// Get package version
|
|
214
|
-
const packageJson = require('../../package.json');
|
|
215
|
-
const version = packageJson.version;
|
|
216
214
|
return {
|
|
217
215
|
content: [
|
|
218
216
|
{
|
|
@@ -220,8 +218,8 @@ class JupiterOneMcpServer {
|
|
|
220
218
|
text: JSON.stringify({
|
|
221
219
|
connected: isConnected,
|
|
222
220
|
account: accountInfo,
|
|
223
|
-
version: version,
|
|
224
|
-
}
|
|
221
|
+
version: package_json_1.version,
|
|
222
|
+
}),
|
|
225
223
|
},
|
|
226
224
|
],
|
|
227
225
|
};
|
|
@@ -257,7 +255,7 @@ class JupiterOneMcpServer {
|
|
|
257
255
|
ruleId,
|
|
258
256
|
id: result.id,
|
|
259
257
|
__typename: result.__typename,
|
|
260
|
-
}
|
|
258
|
+
}),
|
|
261
259
|
},
|
|
262
260
|
],
|
|
263
261
|
};
|
|
@@ -319,7 +317,7 @@ class JupiterOneMcpServer {
|
|
|
319
317
|
endReason: instance.endReason,
|
|
320
318
|
dismissedOn: instance.dismissedOn,
|
|
321
319
|
})),
|
|
322
|
-
}
|
|
320
|
+
}),
|
|
323
321
|
},
|
|
324
322
|
],
|
|
325
323
|
};
|
|
@@ -370,7 +368,7 @@ class JupiterOneMcpServer {
|
|
|
370
368
|
}
|
|
371
369
|
: null,
|
|
372
370
|
})),
|
|
373
|
-
}
|
|
371
|
+
}),
|
|
374
372
|
},
|
|
375
373
|
],
|
|
376
374
|
};
|
|
@@ -411,7 +409,7 @@ class JupiterOneMcpServer {
|
|
|
411
409
|
name,
|
|
412
410
|
type,
|
|
413
411
|
url: dashboardUrl,
|
|
414
|
-
}
|
|
412
|
+
}),
|
|
415
413
|
},
|
|
416
414
|
],
|
|
417
415
|
};
|
|
@@ -543,7 +541,7 @@ class JupiterOneMcpServer {
|
|
|
543
541
|
moved: item.moved,
|
|
544
542
|
})),
|
|
545
543
|
},
|
|
546
|
-
}
|
|
544
|
+
}),
|
|
547
545
|
},
|
|
548
546
|
],
|
|
549
547
|
};
|
|
@@ -604,7 +602,7 @@ class JupiterOneMcpServer {
|
|
|
604
602
|
configSections: def.configSections,
|
|
605
603
|
})),
|
|
606
604
|
pageInfo: definitions.pageInfo,
|
|
607
|
-
}
|
|
605
|
+
}),
|
|
608
606
|
},
|
|
609
607
|
],
|
|
610
608
|
};
|
|
@@ -637,10 +635,14 @@ class JupiterOneMcpServer {
|
|
|
637
635
|
.max(1000)
|
|
638
636
|
.optional()
|
|
639
637
|
.describe('Optional limit for number of instances to return'),
|
|
638
|
+
cursor: zod_1.z
|
|
639
|
+
.string()
|
|
640
|
+
.optional()
|
|
641
|
+
.describe('Optional cursor for pagination; pass the endCursor from a previous response'),
|
|
640
642
|
},
|
|
641
|
-
handler: async ({ definitionId, limit }, client) => {
|
|
643
|
+
handler: async ({ definitionId, limit, cursor }, client) => {
|
|
642
644
|
try {
|
|
643
|
-
const instances = await client.getIntegrationInstances(definitionId,
|
|
645
|
+
const instances = await client.getIntegrationInstances(definitionId, cursor, limit);
|
|
644
646
|
return {
|
|
645
647
|
content: [
|
|
646
648
|
{
|
|
@@ -672,7 +674,7 @@ class JupiterOneMcpServer {
|
|
|
672
674
|
: null,
|
|
673
675
|
})),
|
|
674
676
|
pageInfo: instances.pageInfo,
|
|
675
|
-
}
|
|
677
|
+
}),
|
|
676
678
|
},
|
|
677
679
|
],
|
|
678
680
|
};
|
|
@@ -717,10 +719,14 @@ class JupiterOneMcpServer {
|
|
|
717
719
|
.max(1000)
|
|
718
720
|
.optional()
|
|
719
721
|
.describe('Optional size limit for number of jobs to return'),
|
|
722
|
+
cursor: zod_1.z
|
|
723
|
+
.string()
|
|
724
|
+
.optional()
|
|
725
|
+
.describe('Optional cursor for pagination; pass the endCursor from a previous response'),
|
|
720
726
|
},
|
|
721
|
-
handler: async ({ status, integrationInstanceId, integrationDefinitionId, integrationInstanceIds, size }, client) => {
|
|
727
|
+
handler: async ({ status, integrationInstanceId, integrationDefinitionId, integrationInstanceIds, size, cursor, }, client) => {
|
|
722
728
|
try {
|
|
723
|
-
const jobs = await client.getIntegrationJobs(status, integrationInstanceId, integrationDefinitionId, integrationInstanceIds,
|
|
729
|
+
const jobs = await client.getIntegrationJobs(status, integrationInstanceId, integrationDefinitionId, integrationInstanceIds, cursor, size);
|
|
724
730
|
return {
|
|
725
731
|
content: [
|
|
726
732
|
{
|
|
@@ -738,7 +744,7 @@ class JupiterOneMcpServer {
|
|
|
738
744
|
integrationDefinition: job.integrationDefinition,
|
|
739
745
|
})),
|
|
740
746
|
pageInfo: jobs.pageInfo,
|
|
741
|
-
}
|
|
747
|
+
}),
|
|
742
748
|
},
|
|
743
749
|
],
|
|
744
750
|
};
|
|
@@ -948,7 +954,7 @@ class JupiterOneMcpServer {
|
|
|
948
954
|
latestAlertIsActive: result.latestAlertIsActive,
|
|
949
955
|
url: ruleUrl,
|
|
950
956
|
},
|
|
951
|
-
}
|
|
957
|
+
}),
|
|
952
958
|
},
|
|
953
959
|
],
|
|
954
960
|
};
|
|
@@ -1088,7 +1094,7 @@ class JupiterOneMcpServer {
|
|
|
1088
1094
|
remediationSteps: result.remediationSteps,
|
|
1089
1095
|
url: ruleUrl,
|
|
1090
1096
|
},
|
|
1091
|
-
}
|
|
1097
|
+
}),
|
|
1092
1098
|
},
|
|
1093
1099
|
],
|
|
1094
1100
|
};
|
|
@@ -1130,7 +1136,7 @@ class JupiterOneMcpServer {
|
|
|
1130
1136
|
hasSkippedSteps: job.hasSkippedSteps,
|
|
1131
1137
|
integrationInstance: job.integrationInstance,
|
|
1132
1138
|
integrationDefinition: job.integrationDefinition,
|
|
1133
|
-
}
|
|
1139
|
+
}),
|
|
1134
1140
|
},
|
|
1135
1141
|
],
|
|
1136
1142
|
};
|
|
@@ -1181,7 +1187,7 @@ class JupiterOneMcpServer {
|
|
|
1181
1187
|
eventCode: event.eventCode,
|
|
1182
1188
|
})),
|
|
1183
1189
|
pageInfo: events.pageInfo,
|
|
1184
|
-
}
|
|
1190
|
+
}),
|
|
1185
1191
|
},
|
|
1186
1192
|
],
|
|
1187
1193
|
};
|
|
@@ -1236,7 +1242,7 @@ class JupiterOneMcpServer {
|
|
|
1236
1242
|
tag: evaluation.tag,
|
|
1237
1243
|
timestamp: evaluation.timestamp,
|
|
1238
1244
|
})),
|
|
1239
|
-
}
|
|
1245
|
+
}),
|
|
1240
1246
|
},
|
|
1241
1247
|
],
|
|
1242
1248
|
};
|
|
@@ -1313,7 +1319,7 @@ class JupiterOneMcpServer {
|
|
|
1313
1319
|
}))
|
|
1314
1320
|
: [],
|
|
1315
1321
|
ruleEvaluationOrigin: details.ruleEvaluationOrigin,
|
|
1316
|
-
}
|
|
1322
|
+
}),
|
|
1317
1323
|
},
|
|
1318
1324
|
],
|
|
1319
1325
|
};
|
|
@@ -1348,7 +1354,7 @@ class JupiterOneMcpServer {
|
|
|
1348
1354
|
text: JSON.stringify({
|
|
1349
1355
|
rawDataKey,
|
|
1350
1356
|
downloadUrl,
|
|
1351
|
-
}
|
|
1357
|
+
}),
|
|
1352
1358
|
},
|
|
1353
1359
|
],
|
|
1354
1360
|
};
|
|
@@ -1380,7 +1386,7 @@ class JupiterOneMcpServer {
|
|
|
1380
1386
|
content: [
|
|
1381
1387
|
{
|
|
1382
1388
|
type: 'text',
|
|
1383
|
-
text: JSON.stringify(results
|
|
1389
|
+
text: JSON.stringify(results),
|
|
1384
1390
|
},
|
|
1385
1391
|
],
|
|
1386
1392
|
};
|
|
@@ -1398,49 +1404,6 @@ class JupiterOneMcpServer {
|
|
|
1398
1404
|
}
|
|
1399
1405
|
},
|
|
1400
1406
|
});
|
|
1401
|
-
// The server is not doing a great job of this, will uncomment when we have better support for this
|
|
1402
|
-
// Tool: Create J1QL from natural language
|
|
1403
|
-
// this.server.tool(
|
|
1404
|
-
// 'create-j1ql-from-natural-language',
|
|
1405
|
-
// loadDescription('create-j1ql-from-natural-language.md'),
|
|
1406
|
-
// {
|
|
1407
|
-
// naturalLanguage: z.string().describe('Natural language description of what you want to find'),
|
|
1408
|
-
// },
|
|
1409
|
-
// async ({ naturalLanguage }) => {
|
|
1410
|
-
// try {
|
|
1411
|
-
// const result = await this.client.createJ1qlFromNaturalLanguage(naturalLanguage);
|
|
1412
|
-
// return {
|
|
1413
|
-
// content: [
|
|
1414
|
-
// {
|
|
1415
|
-
// type: 'text',
|
|
1416
|
-
// text: JSON.stringify(
|
|
1417
|
-
// {
|
|
1418
|
-
// success: true,
|
|
1419
|
-
// result: {
|
|
1420
|
-
// uuid: result.uuid,
|
|
1421
|
-
// question: result.question,
|
|
1422
|
-
// query: result.query,
|
|
1423
|
-
// },
|
|
1424
|
-
// },
|
|
1425
|
-
// null,
|
|
1426
|
-
// 2
|
|
1427
|
-
// ),
|
|
1428
|
-
// },
|
|
1429
|
-
// ],
|
|
1430
|
-
// };
|
|
1431
|
-
// } catch (error) {
|
|
1432
|
-
// return {
|
|
1433
|
-
// content: [
|
|
1434
|
-
// {
|
|
1435
|
-
// type: 'text',
|
|
1436
|
-
// text: `Error creating J1QL from natural language: ${error instanceof Error ? error.message : 'Unknown error'}`,
|
|
1437
|
-
// },
|
|
1438
|
-
// ],
|
|
1439
|
-
// isError: true,
|
|
1440
|
-
// };
|
|
1441
|
-
// }
|
|
1442
|
-
// }
|
|
1443
|
-
// );
|
|
1444
1407
|
// Tool: Create dashboard widget
|
|
1445
1408
|
this.registerTool({
|
|
1446
1409
|
name: 'create-dashboard-widget',
|
|
@@ -1476,7 +1439,7 @@ class JupiterOneMcpServer {
|
|
|
1476
1439
|
text: JSON.stringify({
|
|
1477
1440
|
...widget,
|
|
1478
1441
|
dashboardUrl,
|
|
1479
|
-
}
|
|
1442
|
+
}),
|
|
1480
1443
|
},
|
|
1481
1444
|
],
|
|
1482
1445
|
};
|
|
@@ -1567,7 +1530,7 @@ class JupiterOneMcpServer {
|
|
|
1567
1530
|
content: [
|
|
1568
1531
|
{
|
|
1569
1532
|
type: 'text',
|
|
1570
|
-
text: JSON.stringify(updated
|
|
1533
|
+
text: JSON.stringify(updated),
|
|
1571
1534
|
},
|
|
1572
1535
|
],
|
|
1573
1536
|
};
|
|
@@ -1603,24 +1566,18 @@ class JupiterOneMcpServer {
|
|
|
1603
1566
|
.boolean()
|
|
1604
1567
|
.optional()
|
|
1605
1568
|
.describe('Include recently deleted information in the results'),
|
|
1606
|
-
deferredResponse: zod_1.z
|
|
1607
|
-
.enum(['DISABLED', 'FORCE'])
|
|
1608
|
-
.optional()
|
|
1609
|
-
.describe('Allows for a deferred response to be returned'),
|
|
1610
1569
|
flags: zod_1.z.record(zod_1.z.any()).optional().describe('Flags for query execution'),
|
|
1611
1570
|
scopeFilters: zod_1.z
|
|
1612
1571
|
.array(zod_1.z.record(zod_1.z.any()))
|
|
1613
1572
|
.optional()
|
|
1614
1573
|
.describe('Array of filters that define the desired vertex'),
|
|
1615
1574
|
},
|
|
1616
|
-
handler: async ({ query, variables, cursor, includeDeleted,
|
|
1575
|
+
handler: async ({ query, variables, cursor, includeDeleted, flags, scopeFilters }, client, validator) => {
|
|
1617
1576
|
try {
|
|
1618
1577
|
// Build flags object
|
|
1619
1578
|
const queryFlags = { ...flags };
|
|
1620
1579
|
if (typeof includeDeleted === 'boolean')
|
|
1621
1580
|
queryFlags.includeDeleted = includeDeleted;
|
|
1622
|
-
if (deferredResponse)
|
|
1623
|
-
queryFlags.deferredResponse = deferredResponse;
|
|
1624
1581
|
const result = await client.executeJ1qlQuery({
|
|
1625
1582
|
query,
|
|
1626
1583
|
variables,
|
|
@@ -1640,7 +1597,7 @@ class JupiterOneMcpServer {
|
|
|
1640
1597
|
content: [
|
|
1641
1598
|
{
|
|
1642
1599
|
type: 'text',
|
|
1643
|
-
text: JSON.stringify(enhancedResult
|
|
1600
|
+
text: JSON.stringify(enhancedResult),
|
|
1644
1601
|
},
|
|
1645
1602
|
],
|
|
1646
1603
|
};
|
|
@@ -1662,7 +1619,7 @@ class JupiterOneMcpServer {
|
|
|
1662
1619
|
content: [
|
|
1663
1620
|
{
|
|
1664
1621
|
type: 'text',
|
|
1665
|
-
text: JSON.stringify(results
|
|
1622
|
+
text: JSON.stringify(results),
|
|
1666
1623
|
},
|
|
1667
1624
|
],
|
|
1668
1625
|
};
|
|
@@ -1675,6 +1632,7 @@ class JupiterOneMcpServer {
|
|
|
1675
1632
|
text: `Error: ${error instanceof Error ? error.message : 'Unknown error'}`,
|
|
1676
1633
|
},
|
|
1677
1634
|
],
|
|
1635
|
+
isError: true,
|
|
1678
1636
|
};
|
|
1679
1637
|
}
|
|
1680
1638
|
},
|