@rad-security/mcp-server 0.0.46 → 0.0.47-2.gb9dd8b4
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/dist/apiPath.d.ts +31 -0
- package/dist/apiPath.js +58 -0
- package/dist/apiPath.js.map +1 -0
- package/dist/client.js +3 -1
- package/dist/client.js.map +1 -1
- package/dist/index.js +67 -55
- package/dist/index.js.map +1 -1
- package/dist/operations/audit.d.ts +1 -17
- package/dist/operations/audit.js +2 -1
- package/dist/operations/audit.js.map +1 -1
- package/dist/operations/clusters.d.ts +2 -12
- package/dist/operations/clusters.js +3 -2
- package/dist/operations/clusters.js.map +1 -1
- package/dist/operations/containers.d.ts +2 -16
- package/dist/operations/containers.js +3 -2
- package/dist/operations/containers.js.map +1 -1
- package/dist/operations/custom-workflows.d.ts +5 -59
- package/dist/operations/custom-workflows.js +6 -5
- package/dist/operations/custom-workflows.js.map +1 -1
- package/dist/operations/cve-dispositions.d.ts +8 -24
- package/dist/operations/cve-dispositions.js +4 -3
- package/dist/operations/cve-dispositions.js.map +1 -1
- package/dist/operations/dashboards.d.ts +10 -68
- package/dist/operations/dashboards.js +11 -10
- package/dist/operations/dashboards.js.map +1 -1
- package/dist/operations/findings.d.ts +32 -38
- package/dist/operations/findings.js +3 -2
- package/dist/operations/findings.js.map +1 -1
- package/dist/operations/images.d.ts +4 -30
- package/dist/operations/images.js +6 -5
- package/dist/operations/images.js.map +1 -1
- package/dist/operations/inbox.d.ts +3 -23
- package/dist/operations/inbox.js +5 -4
- package/dist/operations/inbox.js.map +1 -1
- package/dist/operations/integrations.d.ts +1 -7
- package/dist/operations/integrations.js +2 -1
- package/dist/operations/integrations.js.map +1 -1
- package/dist/operations/knowledge-base.d.ts +8 -50
- package/dist/operations/knowledge-base.js +7 -6
- package/dist/operations/knowledge-base.js.map +1 -1
- package/dist/operations/kubeobject.d.ts +3 -21
- package/dist/operations/kubeobject.js +3 -2
- package/dist/operations/kubeobject.js.map +1 -1
- package/dist/operations/radql.d.ts +56 -122
- package/dist/operations/radql.js +7 -6
- package/dist/operations/radql.js.map +1 -1
- package/dist/operations/runtime.d.ts +5 -19
- package/dist/operations/runtime.js +6 -5
- package/dist/operations/runtime.js.map +1 -1
- package/dist/operations/workflows.d.ts +6 -32
- package/dist/operations/workflows.js +8 -7
- package/dist/operations/workflows.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +8 -6
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Request-path construction for the RAD Security API.
|
|
3
|
+
*
|
|
4
|
+
* Tool arguments and the configured account id are interpolated into request paths. Interpolated
|
|
5
|
+
* raw, a value does not necessarily stay one path segment: `/`, `..`, `?` and `#` all have meaning
|
|
6
|
+
* in a URL, and `new URL()` resolves them before the request is sent. An argument could therefore
|
|
7
|
+
* move a call to an endpoint the operation never intended — carrying the server's own credentials.
|
|
8
|
+
*
|
|
9
|
+
* These helpers make that structurally impossible: segments are encoded as they are interpolated,
|
|
10
|
+
* and the single place every request passes through refuses a path that still looks dangerous.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Build an API path, percent-encoding every interpolated value as one path segment.
|
|
14
|
+
*
|
|
15
|
+
* Used as a tagged template:
|
|
16
|
+
*
|
|
17
|
+
* apiPath`/accounts/${accountId}/images/${digest}/scans`
|
|
18
|
+
*
|
|
19
|
+
* `encodeURIComponent` leaves ordinary identifiers (letters, digits, `-`, `_`, `.`, `~`) untouched,
|
|
20
|
+
* so the bytes on the wire change only for values that were never a valid single segment.
|
|
21
|
+
*/
|
|
22
|
+
export declare function apiPath(strings: TemplateStringsArray, ...values: unknown[]): string;
|
|
23
|
+
/**
|
|
24
|
+
* Reject a request path that can still leave the endpoint the caller asked for.
|
|
25
|
+
*
|
|
26
|
+
* The backstop to `apiPath`: operations are expected to build paths with it, but this is the one
|
|
27
|
+
* place every request passes through, so a site that forgets — or one added later — cannot quietly
|
|
28
|
+
* reintroduce the problem. Query parameters belong in `makeRequest`'s `params` argument, which is
|
|
29
|
+
* why a `?` here is treated as injection rather than as a legitimate query string.
|
|
30
|
+
*/
|
|
31
|
+
export declare function assertSafeEndpoint(endpoint: string): void;
|
package/dist/apiPath.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Request-path construction for the RAD Security API.
|
|
3
|
+
*
|
|
4
|
+
* Tool arguments and the configured account id are interpolated into request paths. Interpolated
|
|
5
|
+
* raw, a value does not necessarily stay one path segment: `/`, `..`, `?` and `#` all have meaning
|
|
6
|
+
* in a URL, and `new URL()` resolves them before the request is sent. An argument could therefore
|
|
7
|
+
* move a call to an endpoint the operation never intended — carrying the server's own credentials.
|
|
8
|
+
*
|
|
9
|
+
* These helpers make that structurally impossible: segments are encoded as they are interpolated,
|
|
10
|
+
* and the single place every request passes through refuses a path that still looks dangerous.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Build an API path, percent-encoding every interpolated value as one path segment.
|
|
14
|
+
*
|
|
15
|
+
* Used as a tagged template:
|
|
16
|
+
*
|
|
17
|
+
* apiPath`/accounts/${accountId}/images/${digest}/scans`
|
|
18
|
+
*
|
|
19
|
+
* `encodeURIComponent` leaves ordinary identifiers (letters, digits, `-`, `_`, `.`, `~`) untouched,
|
|
20
|
+
* so the bytes on the wire change only for values that were never a valid single segment.
|
|
21
|
+
*/
|
|
22
|
+
export function apiPath(strings, ...values) {
|
|
23
|
+
let path = strings[0] ?? "";
|
|
24
|
+
for (let i = 0; i < values.length; i++) {
|
|
25
|
+
path += encodeSegment(values[i]) + (strings[i + 1] ?? "");
|
|
26
|
+
}
|
|
27
|
+
return path;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Encode one path segment. A missing or empty value is a caller bug — unencoded it would produce
|
|
31
|
+
* `/accounts//images` or a literal `undefined` in the path — so it fails here, where the message
|
|
32
|
+
* names the problem, rather than as a puzzling 404 from the API.
|
|
33
|
+
*/
|
|
34
|
+
function encodeSegment(value) {
|
|
35
|
+
if (value === undefined || value === null || String(value) === "") {
|
|
36
|
+
throw new Error("Cannot build an API path: a required path segment is missing");
|
|
37
|
+
}
|
|
38
|
+
return encodeURIComponent(String(value));
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Reject a request path that can still leave the endpoint the caller asked for.
|
|
42
|
+
*
|
|
43
|
+
* The backstop to `apiPath`: operations are expected to build paths with it, but this is the one
|
|
44
|
+
* place every request passes through, so a site that forgets — or one added later — cannot quietly
|
|
45
|
+
* reintroduce the problem. Query parameters belong in `makeRequest`'s `params` argument, which is
|
|
46
|
+
* why a `?` here is treated as injection rather than as a legitimate query string.
|
|
47
|
+
*/
|
|
48
|
+
export function assertSafeEndpoint(endpoint) {
|
|
49
|
+
const unsafe = !endpoint.startsWith("/") ||
|
|
50
|
+
endpoint.includes("?") ||
|
|
51
|
+
endpoint.includes("#") ||
|
|
52
|
+
endpoint.includes("\\") ||
|
|
53
|
+
endpoint.split("/").includes("..");
|
|
54
|
+
if (unsafe) {
|
|
55
|
+
throw new Error(`Refusing to request a malformed API path: ${JSON.stringify(endpoint)}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=apiPath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiPath.js","sourceRoot":"","sources":["../src/apiPath.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;;;;;GASG;AACH,MAAM,UAAU,OAAO,CAAC,OAA6B,EAAE,GAAG,MAAiB;IACzE,IAAI,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAE5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,IAAI,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC5D,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,SAAS,aAAa,CAAC,KAAc;IACnC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;QAClE,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAC;IAClF,CAAC;IAED,OAAO,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAgB;IACjD,MAAM,MAAM,GACV,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC;QACzB,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC;QACtB,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC;QACtB,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC;QACvB,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAErC,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,6CAA6C,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC3F,CAAC;AACH,CAAC"}
|
package/dist/client.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { logger } from "./logger.js";
|
|
2
|
+
import { apiPath, assertSafeEndpoint } from "./apiPath.js";
|
|
2
3
|
const USER_AGENT = `rad-security/mcp-server`;
|
|
3
4
|
/**
|
|
4
5
|
* Thrown when a per-request credential (e.g. an inbound Authorization header)
|
|
@@ -96,7 +97,7 @@ export class RadSecurityClient {
|
|
|
96
97
|
if (!this.accountId) {
|
|
97
98
|
throw new Error("Cannot fetch tenant ID without an account ID. Set RAD_SECURITY_ACCOUNT_ID or RAD_SECURITY_TENANT_ID.");
|
|
98
99
|
}
|
|
99
|
-
const accountData = await this.makeRequest(`/accounts/${this.accountId}`);
|
|
100
|
+
const accountData = await this.makeRequest(apiPath `/accounts/${this.accountId}`);
|
|
100
101
|
if (!accountData || !accountData.parent_id) {
|
|
101
102
|
throw new Error(`No parent_id found for account: ${this.accountId}`);
|
|
102
103
|
}
|
|
@@ -165,6 +166,7 @@ export class RadSecurityClient {
|
|
|
165
166
|
else {
|
|
166
167
|
headers["Cookie"] = `ory_kratos_session=${token}`;
|
|
167
168
|
}
|
|
169
|
+
assertSafeEndpoint(endpoint);
|
|
168
170
|
const url = new URL(`${this.getBaseUrl()}${endpoint}`);
|
|
169
171
|
if (params) {
|
|
170
172
|
Object.entries(params).forEach(([key, value]) => {
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAE3D,MAAM,UAAU,GAAG,yBAAyB,CAAC;AAE7C;;;GAGG;AACH,MAAM,OAAO,eAAgB,SAAQ,KAAK;IACxC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF;AAQD,MAAM,OAAO,iBAAiB;IACpB,YAAY,CAAS;IACrB,WAAW,CAAS;IACpB,SAAS,CAAS;IAClB,OAAO,CAAS;IAChB,SAAS,CAAS;IAClB,QAAQ,CAAS;IACjB,UAAU,GAA2C,IAAI,CAA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CAAC;YACxC,MAAM,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,oBAAoB,CAAC,CAAC;YACxE,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,iBAAiB,CAAC,QAAkB;QAChD,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACzD,IAAI,WAAW,EAAE,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC;YAC9C,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;QACzB,CAAC;QACD,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;CACF"}
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,6 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
|
|
4
4
|
import cors from "cors";
|
|
5
5
|
import { SSEServerTransport } from "@modelcontextprotocol/sdk/server/sse.js";
|
|
6
6
|
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
7
|
-
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
8
7
|
import { z } from "zod";
|
|
9
8
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
10
9
|
import express from "express";
|
|
@@ -26,6 +25,19 @@ import * as dashboards from "./operations/dashboards.js";
|
|
|
26
25
|
import * as integrations from "./operations/integrations.js";
|
|
27
26
|
import { VERSION } from "./version.js";
|
|
28
27
|
import { logger } from "./logger.js";
|
|
28
|
+
// Tool input schemas: what clients may send, so fields with defaults stay optional.
|
|
29
|
+
// Objects stay closed (additionalProperties: false), as they were with zod-to-json-schema.
|
|
30
|
+
function toolInputSchema(schema) {
|
|
31
|
+
return z.toJSONSchema(schema, {
|
|
32
|
+
target: "draft-7",
|
|
33
|
+
io: "input",
|
|
34
|
+
override: (ctx) => {
|
|
35
|
+
if (ctx.jsonSchema.type === "object" && ctx.jsonSchema.additionalProperties === undefined) {
|
|
36
|
+
ctx.jsonSchema.additionalProperties = false;
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
}
|
|
29
41
|
// Parse toolkit filters from environment variables
|
|
30
42
|
function parseToolkitFilters() {
|
|
31
43
|
const includeEnv = process.env.INCLUDE_TOOLKITS;
|
|
@@ -107,13 +119,13 @@ async function newServer(client, toolkitFilters) {
|
|
|
107
119
|
name: "list_containers",
|
|
108
120
|
annotations: { title: "List Containers", readOnlyHint: true },
|
|
109
121
|
description: "List containers secured by RAD Security with optional filtering by image name, image digest, namespace, cluster_id, or free text search",
|
|
110
|
-
inputSchema:
|
|
122
|
+
inputSchema: toolInputSchema(containers.ListContainersSchema),
|
|
111
123
|
},
|
|
112
124
|
{
|
|
113
125
|
name: "get_container_details",
|
|
114
126
|
annotations: { title: "Get Container Details", readOnlyHint: true },
|
|
115
127
|
description: "Get detailed information about a container secured by RAD Security",
|
|
116
|
-
inputSchema:
|
|
128
|
+
inputSchema: toolInputSchema(containers.GetContainerDetailsSchema),
|
|
117
129
|
},
|
|
118
130
|
]
|
|
119
131
|
: []),
|
|
@@ -124,13 +136,13 @@ async function newServer(client, toolkitFilters) {
|
|
|
124
136
|
name: "list_clusters",
|
|
125
137
|
annotations: { title: "List Clusters", readOnlyHint: true },
|
|
126
138
|
description: "List Kubernetes clusters managed by RAD Security",
|
|
127
|
-
inputSchema:
|
|
139
|
+
inputSchema: toolInputSchema(clusters.ListClustersSchema),
|
|
128
140
|
},
|
|
129
141
|
{
|
|
130
142
|
name: "get_cluster_details",
|
|
131
143
|
annotations: { title: "Get Cluster Details", readOnlyHint: true },
|
|
132
144
|
description: "Get detailed information about a specific Kubernetes cluster managed by RAD Security",
|
|
133
|
-
inputSchema:
|
|
145
|
+
inputSchema: toolInputSchema(clusters.GetClusterDetailsSchema),
|
|
134
146
|
},
|
|
135
147
|
]
|
|
136
148
|
: []),
|
|
@@ -141,7 +153,7 @@ async function newServer(client, toolkitFilters) {
|
|
|
141
153
|
name: "who_shelled_into_pod",
|
|
142
154
|
annotations: { title: "Who Shelled Into Pod", readOnlyHint: true },
|
|
143
155
|
description: "Get k8s audit logs with information about users who shelled into a pod",
|
|
144
|
-
inputSchema:
|
|
156
|
+
inputSchema: toolInputSchema(audit.WhoShelledIntoPodSchema),
|
|
145
157
|
},
|
|
146
158
|
]
|
|
147
159
|
: []),
|
|
@@ -152,43 +164,43 @@ async function newServer(client, toolkitFilters) {
|
|
|
152
164
|
name: "list_images",
|
|
153
165
|
annotations: { title: "List Images", readOnlyHint: true },
|
|
154
166
|
description: "List container images with optional filtering by page, page size, sort, and search query",
|
|
155
|
-
inputSchema:
|
|
167
|
+
inputSchema: toolInputSchema(images.ListImagesSchema),
|
|
156
168
|
},
|
|
157
169
|
{
|
|
158
170
|
name: "list_image_vulnerabilities",
|
|
159
171
|
annotations: { title: "List Image Vulnerabilities", readOnlyHint: true },
|
|
160
172
|
description: "List vulnerabilities in a container image with optional filtering by severity",
|
|
161
|
-
inputSchema:
|
|
173
|
+
inputSchema: toolInputSchema(images.ListImageVulnerabilitiesSchema),
|
|
162
174
|
},
|
|
163
175
|
{
|
|
164
176
|
name: "get_top_vulnerable_images",
|
|
165
177
|
annotations: { title: "Get Top Vulnerable Images", readOnlyHint: true },
|
|
166
178
|
description: "Get the most vulnerable images from your account",
|
|
167
|
-
inputSchema:
|
|
179
|
+
inputSchema: toolInputSchema(z.object({})),
|
|
168
180
|
},
|
|
169
181
|
{
|
|
170
182
|
name: "get_image_sbom",
|
|
171
183
|
annotations: { title: "Get Image SBOM", readOnlyHint: true },
|
|
172
184
|
description: "Get the SBOM of a container image",
|
|
173
|
-
inputSchema:
|
|
185
|
+
inputSchema: toolInputSchema(images.GetImageSBOMSchema),
|
|
174
186
|
},
|
|
175
187
|
{
|
|
176
188
|
name: "ignore_cve",
|
|
177
189
|
annotations: { title: "Ignore CVE", readOnlyHint: false, destructiveHint: false },
|
|
178
190
|
description: "Ignore a CVE for this account so it no longer appears in vulnerability reporting. Use for confirmed false positives, accepted risks, or won't-fix decisions. Do NOT use for remediated CVEs — those drop off automatically on the next scan.",
|
|
179
|
-
inputSchema:
|
|
191
|
+
inputSchema: toolInputSchema(cveDispositions.ignoreCveSchema),
|
|
180
192
|
},
|
|
181
193
|
{
|
|
182
194
|
name: "unignore_cve",
|
|
183
195
|
annotations: { title: "Unignore CVE", readOnlyHint: false, destructiveHint: true },
|
|
184
196
|
description: "Remove an account-wide CVE disposition, restoring the CVE to vulnerability reporting.",
|
|
185
|
-
inputSchema:
|
|
197
|
+
inputSchema: toolInputSchema(cveDispositions.unignoreCveSchema),
|
|
186
198
|
},
|
|
187
199
|
{
|
|
188
200
|
name: "list_cve_dispositions",
|
|
189
201
|
annotations: { title: "List CVE Dispositions", readOnlyHint: true },
|
|
190
202
|
description: "List active CVE dispositions (ignored / false positive) for this account, with reason and author.",
|
|
191
|
-
inputSchema:
|
|
203
|
+
inputSchema: toolInputSchema(cveDispositions.listCveDispositionsSchema),
|
|
192
204
|
},
|
|
193
205
|
]
|
|
194
206
|
: []),
|
|
@@ -199,13 +211,13 @@ async function newServer(client, toolkitFilters) {
|
|
|
199
211
|
name: "get_k8s_resource_details",
|
|
200
212
|
annotations: { title: "Get Kubernetes Resource Details", readOnlyHint: true },
|
|
201
213
|
description: "Get the latest manifest of a Kubernetes resource",
|
|
202
|
-
inputSchema:
|
|
214
|
+
inputSchema: toolInputSchema(kubeobject.GetKubernetesResourceDetailsSchema),
|
|
203
215
|
},
|
|
204
216
|
{
|
|
205
217
|
name: "list_k8s_resources",
|
|
206
218
|
annotations: { title: "List Kubernetes Resources", readOnlyHint: true },
|
|
207
219
|
description: "List Kubernetes resources with optional filtering by namespace, resource types, and cluster",
|
|
208
|
-
inputSchema:
|
|
220
|
+
inputSchema: toolInputSchema(kubeobject.ListKubernetesResourcesSchema),
|
|
209
221
|
},
|
|
210
222
|
]
|
|
211
223
|
: []),
|
|
@@ -216,19 +228,19 @@ async function newServer(client, toolkitFilters) {
|
|
|
216
228
|
name: "get_containers_process_trees",
|
|
217
229
|
annotations: { title: "Get Container Process Trees", readOnlyHint: true },
|
|
218
230
|
description: "Get process trees for multiple containers",
|
|
219
|
-
inputSchema:
|
|
231
|
+
inputSchema: toolInputSchema(runtime.GetContainersProcessTreesSchema),
|
|
220
232
|
},
|
|
221
233
|
{
|
|
222
234
|
name: "get_containers_baselines",
|
|
223
235
|
annotations: { title: "Get Container Baselines", readOnlyHint: true },
|
|
224
236
|
description: "Get runtime baselines for multiple containers",
|
|
225
|
-
inputSchema:
|
|
237
|
+
inputSchema: toolInputSchema(runtime.GetContainersBaselinesSchema),
|
|
226
238
|
},
|
|
227
239
|
{
|
|
228
240
|
name: "get_container_llm_analysis",
|
|
229
241
|
annotations: { title: "Get Container LLM Analysis", readOnlyHint: true },
|
|
230
242
|
description: "Get LLM analysis of a container's process tree",
|
|
231
|
-
inputSchema:
|
|
243
|
+
inputSchema: toolInputSchema(runtime.GetContainerLLMAnalysisSchema),
|
|
232
244
|
},
|
|
233
245
|
]
|
|
234
246
|
: []),
|
|
@@ -239,13 +251,13 @@ async function newServer(client, toolkitFilters) {
|
|
|
239
251
|
name: "list_security_findings",
|
|
240
252
|
annotations: { title: "List Security Findings", readOnlyHint: true },
|
|
241
253
|
description: "List security findings with optional filtering by types, severities, sources, and status",
|
|
242
|
-
inputSchema:
|
|
254
|
+
inputSchema: toolInputSchema(findings.listFindingsSchema),
|
|
243
255
|
},
|
|
244
256
|
{
|
|
245
257
|
name: "update_security_finding_status",
|
|
246
258
|
annotations: { title: "Update Security Finding Status", readOnlyHint: false, destructiveHint: false },
|
|
247
259
|
description: "Update the status of a security finding",
|
|
248
|
-
inputSchema:
|
|
260
|
+
inputSchema: toolInputSchema(findings.updateFindingStatusSchema),
|
|
249
261
|
},
|
|
250
262
|
]
|
|
251
263
|
: []),
|
|
@@ -256,19 +268,19 @@ async function newServer(client, toolkitFilters) {
|
|
|
256
268
|
name: "mark_inbox_item_as_false_positive",
|
|
257
269
|
annotations: { title: "Mark Inbox Item as False Positive", readOnlyHint: false, destructiveHint: false },
|
|
258
270
|
description: "Mark an inbox item as a false positive with a reason",
|
|
259
|
-
inputSchema:
|
|
271
|
+
inputSchema: toolInputSchema(inbox.MarkInboxItemAsFalsePositiveSchema),
|
|
260
272
|
},
|
|
261
273
|
{
|
|
262
274
|
name: "list_inbox_items",
|
|
263
275
|
annotations: { title: "List Inbox Items", readOnlyHint: true },
|
|
264
276
|
description: "List inbox items with optional filtering by any field. Multiple filters can be combined eg. 'search:cve-2024-12345 and severity:high'",
|
|
265
|
-
inputSchema:
|
|
277
|
+
inputSchema: toolInputSchema(inbox.ListInboxItemsSchema),
|
|
266
278
|
},
|
|
267
279
|
{
|
|
268
280
|
name: "get_inbox_item_details",
|
|
269
281
|
annotations: { title: "Get Inbox Item Details", readOnlyHint: true },
|
|
270
282
|
description: "Get detailed information about a specific inbox item",
|
|
271
|
-
inputSchema:
|
|
283
|
+
inputSchema: toolInputSchema(inbox.GetInboxItemDetailsSchema),
|
|
272
284
|
},
|
|
273
285
|
]
|
|
274
286
|
: []),
|
|
@@ -279,37 +291,37 @@ async function newServer(client, toolkitFilters) {
|
|
|
279
291
|
name: "list_workflows",
|
|
280
292
|
annotations: { title: "List Workflows", readOnlyHint: true },
|
|
281
293
|
description: "List all workflows",
|
|
282
|
-
inputSchema:
|
|
294
|
+
inputSchema: toolInputSchema(workflows.ListWorkflowsSchema),
|
|
283
295
|
},
|
|
284
296
|
{
|
|
285
297
|
name: "get_workflow",
|
|
286
298
|
annotations: { title: "Get Workflow", readOnlyHint: true },
|
|
287
299
|
description: "Get detailed information about a specific workflow by ID. It contains the workflow definition, default arguments, and schema how to run the workflow",
|
|
288
|
-
inputSchema:
|
|
300
|
+
inputSchema: toolInputSchema(workflows.GetWorkflowSchema),
|
|
289
301
|
},
|
|
290
302
|
{
|
|
291
303
|
name: "list_workflow_runs",
|
|
292
304
|
annotations: { title: "List Workflow Runs", readOnlyHint: true },
|
|
293
305
|
description: "List workflow runs with optional filtering by workflow ID",
|
|
294
|
-
inputSchema:
|
|
306
|
+
inputSchema: toolInputSchema(workflows.ListWorkflowRunsSchema),
|
|
295
307
|
},
|
|
296
308
|
{
|
|
297
309
|
name: "get_workflow_run",
|
|
298
310
|
annotations: { title: "Get Workflow Run", readOnlyHint: true },
|
|
299
311
|
description: "Get detailed information about a specific workflow run",
|
|
300
|
-
inputSchema:
|
|
312
|
+
inputSchema: toolInputSchema(workflows.GetWorkflowRunSchema),
|
|
301
313
|
},
|
|
302
314
|
{
|
|
303
315
|
name: "run_workflow",
|
|
304
316
|
annotations: { title: "Run Workflow", readOnlyHint: false, destructiveHint: true },
|
|
305
317
|
description: "Run a workflow with optional argument overrides",
|
|
306
|
-
inputSchema:
|
|
318
|
+
inputSchema: toolInputSchema(workflows.RunWorkflowSchema),
|
|
307
319
|
},
|
|
308
320
|
{
|
|
309
321
|
name: "list_workflow_schedules",
|
|
310
322
|
annotations: { title: "List Workflow Schedules", readOnlyHint: true },
|
|
311
323
|
description: "List workflow schedules with optional filtering by workflow ID",
|
|
312
|
-
inputSchema:
|
|
324
|
+
inputSchema: toolInputSchema(workflows.ListWorkflowSchedulesSchema),
|
|
313
325
|
},
|
|
314
326
|
]
|
|
315
327
|
: []),
|
|
@@ -325,13 +337,13 @@ async function newServer(client, toolkitFilters) {
|
|
|
325
337
|
name: "create_custom_workflow",
|
|
326
338
|
annotations: { title: "Create Automation", readOnlyHint: false, destructiveHint: false },
|
|
327
339
|
description: "Create a new automation (a Windmill workflow) from a YAML definition. Pass the YAML document itself as a string, not a file path. It is validated server-side before deployment; on failure nothing is deployed and the errors are returned. Returns the new automation WITHOUT echoing the definition back — use `id` from the result when referring to it, and `get_workflow` if you need to read the definition.",
|
|
328
|
-
inputSchema:
|
|
340
|
+
inputSchema: toolInputSchema(customWorkflows.CreateCustomWorkflowSchema),
|
|
329
341
|
},
|
|
330
342
|
{
|
|
331
343
|
name: "update_custom_workflow",
|
|
332
344
|
annotations: { title: "Update Automation", readOnlyHint: false, destructiveHint: false },
|
|
333
345
|
description: "Update an existing automation with new YAML. Only automations created via create_custom_workflow can be updated. Returns the updated automation without echoing the definition back.",
|
|
334
|
-
inputSchema:
|
|
346
|
+
inputSchema: toolInputSchema(customWorkflows.UpdateCustomWorkflowSchema),
|
|
335
347
|
},
|
|
336
348
|
{
|
|
337
349
|
name: "add_workflow_schedule",
|
|
@@ -339,21 +351,21 @@ async function newServer(client, toolkitFilters) {
|
|
|
339
351
|
description: "Add a cron-based schedule to an automation so it runs automatically at the specified times. " +
|
|
340
352
|
"This ADDS a schedule; to change when an automation runs, use update_workflow_schedule instead, " +
|
|
341
353
|
"or the automation will fire at both the old time and the new one.",
|
|
342
|
-
inputSchema:
|
|
354
|
+
inputSchema: toolInputSchema(customWorkflows.AddWorkflowScheduleSchema),
|
|
343
355
|
},
|
|
344
356
|
{
|
|
345
357
|
name: "update_workflow_schedule",
|
|
346
358
|
annotations: { title: "Update Automation Schedule", readOnlyHint: false, destructiveHint: false },
|
|
347
359
|
description: "Change an existing schedule's cron expression or timezone. Use this to move when an " +
|
|
348
360
|
"automation runs. Get the schedule_id from list_workflow_schedules.",
|
|
349
|
-
inputSchema:
|
|
361
|
+
inputSchema: toolInputSchema(customWorkflows.UpdateWorkflowScheduleSchema),
|
|
350
362
|
},
|
|
351
363
|
{
|
|
352
364
|
name: "delete_workflow_schedule",
|
|
353
365
|
annotations: { title: "Delete Automation Schedule", readOnlyHint: false, destructiveHint: true },
|
|
354
366
|
description: "Remove a schedule from an automation so it stops running on that cadence. The automation " +
|
|
355
367
|
"itself is not deleted. Get the schedule_id from list_workflow_schedules.",
|
|
356
|
-
inputSchema:
|
|
368
|
+
inputSchema: toolInputSchema(customWorkflows.DeleteWorkflowScheduleSchema),
|
|
357
369
|
},
|
|
358
370
|
]
|
|
359
371
|
: []),
|
|
@@ -364,37 +376,37 @@ async function newServer(client, toolkitFilters) {
|
|
|
364
376
|
name: "search_knowledge_base",
|
|
365
377
|
annotations: { title: "Search Knowledge Base", readOnlyHint: true },
|
|
366
378
|
description: "Search your organization's knowledge base to find relevant uploaded documents, procedures, reports, and other content using natural language queries",
|
|
367
|
-
inputSchema:
|
|
379
|
+
inputSchema: toolInputSchema(knowledgeBase.SearchKnowledgeBaseSchema),
|
|
368
380
|
},
|
|
369
381
|
{
|
|
370
382
|
name: "list_knowledge_base_collections",
|
|
371
383
|
annotations: { title: "List Knowledge Base Collections", readOnlyHint: true },
|
|
372
384
|
description: "List all collections in your organization's knowledge base. Collections are used to organize and categorize documents",
|
|
373
|
-
inputSchema:
|
|
385
|
+
inputSchema: toolInputSchema(knowledgeBase.ListCollectionsSchema),
|
|
374
386
|
},
|
|
375
387
|
{
|
|
376
388
|
name: "list_knowledge_base_documents",
|
|
377
389
|
annotations: { title: "List Knowledge Base Documents", readOnlyHint: true },
|
|
378
390
|
description: "List documents in your organization's knowledge base with optional filtering by collections, file type, or status",
|
|
379
|
-
inputSchema:
|
|
391
|
+
inputSchema: toolInputSchema(knowledgeBase.ListDocumentsSchema),
|
|
380
392
|
},
|
|
381
393
|
{
|
|
382
394
|
name: "query_knowledge_base_document",
|
|
383
395
|
annotations: { title: "Query Knowledge Base Document", readOnlyHint: true },
|
|
384
396
|
description: "Query a CSV document from the knowledge base using natural language. IMPORTANT: This tool ONLY works with CSV documents. Use list_knowledge_base_documents with filters='file_type:csv' to find CSV document IDs (search_knowledge_base results also contain document IDs). Results are returned as a markdown table",
|
|
385
|
-
inputSchema:
|
|
397
|
+
inputSchema: toolInputSchema(knowledgeBase.StructuredQueryDocumentSchema),
|
|
386
398
|
},
|
|
387
399
|
{
|
|
388
400
|
name: "get_knowledge_base_document_content",
|
|
389
401
|
annotations: { title: "Get Knowledge Base Document Content", readOnlyHint: true },
|
|
390
402
|
description: "Get the FULL text content of a knowledge base document (extracted text for PDF/DOCX, the raw file for markdown/plaintext/CSV). Use this to read or analyze a whole document rather than the excerpts search_knowledge_base returns. Find document IDs via list_knowledge_base_documents or search_knowledge_base results",
|
|
391
|
-
inputSchema:
|
|
403
|
+
inputSchema: toolInputSchema(knowledgeBase.GetDocumentContentSchema),
|
|
392
404
|
},
|
|
393
405
|
{
|
|
394
406
|
name: "get_knowledge_base_document_download_url",
|
|
395
407
|
annotations: { title: "Get Knowledge Base Document Download URL", readOnlyHint: true },
|
|
396
408
|
description: "Get a time-limited download URL for the ORIGINAL document file (any format, including PDF/DOCX binaries). Use when you need the original file itself — e.g. to fetch it into a sandbox for structural parsing (tables, layout), or when get_knowledge_base_document_content reports no text available. For reading text, prefer get_knowledge_base_document_content",
|
|
397
|
-
inputSchema:
|
|
409
|
+
inputSchema: toolInputSchema(knowledgeBase.GetDocumentDownloadUrlSchema),
|
|
398
410
|
},
|
|
399
411
|
]
|
|
400
412
|
: []),
|
|
@@ -405,19 +417,19 @@ async function newServer(client, toolkitFilters) {
|
|
|
405
417
|
name: "radql_list_data_types",
|
|
406
418
|
annotations: { title: "RadQL: List Data Types", readOnlyHint: true },
|
|
407
419
|
description: "List all available RadQL data types (discovery). ALWAYS call this FIRST before using other RadQL tools to discover what data is available to query. Returns data types like 'containers', 'kubernetes_resources', 'inbox_items', 'cloud_resources', 'cloud_benchmarks', 'cloud_benchmark_summaries', etc. with descriptions.",
|
|
408
|
-
inputSchema:
|
|
420
|
+
inputSchema: toolInputSchema(radql.RadQLListDataTypesSchema),
|
|
409
421
|
},
|
|
410
422
|
{
|
|
411
423
|
name: "radql_get_type_metadata",
|
|
412
424
|
annotations: { title: "RadQL: Get Type Metadata", readOnlyHint: true },
|
|
413
425
|
description: "Get schema/metadata for a specific RadQL data type. Shows available fields, data types, which fields can be filtered/searched, and provides query examples. Call this AFTER radql_list_data_types to understand how to query a specific data type.",
|
|
414
|
-
inputSchema:
|
|
426
|
+
inputSchema: toolInputSchema(radql.RadQLGetTypeMetadataSchema),
|
|
415
427
|
},
|
|
416
428
|
{
|
|
417
429
|
name: "radql_list_filter_values",
|
|
418
430
|
annotations: { title: "RadQL: List Filter Values", readOnlyHint: true },
|
|
419
431
|
description: "List possible values for a filter field (e.g., namespace list, cluster list, severity values). Useful for building dynamic filters when you need to know available enum-like values. Call this when constructing filters that need specific values.",
|
|
420
|
-
inputSchema:
|
|
432
|
+
inputSchema: toolInputSchema(radql.RadQLListFilterValuesSchema),
|
|
421
433
|
},
|
|
422
434
|
{
|
|
423
435
|
name: "radql_query",
|
|
@@ -466,19 +478,19 @@ OK to leave unquoted:
|
|
|
466
478
|
- Simple wildcards: name:nginx*
|
|
467
479
|
|
|
468
480
|
For complete schema: call radql_get_type_metadata with target data_type`,
|
|
469
|
-
inputSchema:
|
|
481
|
+
inputSchema: toolInputSchema(radql.RadQLQuerySchema),
|
|
470
482
|
},
|
|
471
483
|
{
|
|
472
484
|
name: "radql_query_builder",
|
|
473
485
|
annotations: { title: "RadQL: Query Builder", readOnlyHint: true },
|
|
474
486
|
description: "Helper tool to build RadQL queries programmatically from structured conditions. Useful when you need to construct complex filter or stats queries from structured inputs.",
|
|
475
|
-
inputSchema:
|
|
487
|
+
inputSchema: toolInputSchema(radql.RadQLQueryBuilderSchema),
|
|
476
488
|
},
|
|
477
489
|
{
|
|
478
490
|
name: "radql_batch_query",
|
|
479
491
|
annotations: { title: "RadQL: Batch Query", readOnlyHint: true },
|
|
480
492
|
description: "Execute multiple RadQL queries in parallel for efficiency. Useful for fetching related data from different data types simultaneously (e.g., container details + vulnerabilities + network connections).",
|
|
481
|
-
inputSchema:
|
|
493
|
+
inputSchema: toolInputSchema(radql.RadQLBatchQuerySchema),
|
|
482
494
|
},
|
|
483
495
|
]
|
|
484
496
|
: []),
|
|
@@ -489,13 +501,13 @@ For complete schema: call radql_get_type_metadata with target data_type`,
|
|
|
489
501
|
name: "list_widget_templates",
|
|
490
502
|
annotations: { title: "List Widget Templates", readOnlyHint: true },
|
|
491
503
|
description: "List widget templates with optional filtering by visualization type and category",
|
|
492
|
-
inputSchema:
|
|
504
|
+
inputSchema: toolInputSchema(dashboards.ListWidgetTemplatesSchema),
|
|
493
505
|
},
|
|
494
506
|
{
|
|
495
507
|
name: "get_widget_template",
|
|
496
508
|
annotations: { title: "Get Widget Template", readOnlyHint: true },
|
|
497
509
|
description: "Get detailed information about a specific widget template",
|
|
498
|
-
inputSchema:
|
|
510
|
+
inputSchema: toolInputSchema(dashboards.GetWidgetTemplateSchema),
|
|
499
511
|
},
|
|
500
512
|
{
|
|
501
513
|
name: "list_dashboard_templates",
|
|
@@ -504,37 +516,37 @@ For complete schema: call radql_get_type_metadata with target data_type`,
|
|
|
504
516
|
"given area (containers, images, runtime, compliance, findings). Returns id, " +
|
|
505
517
|
"title, description and category WITHOUT the rows — call get_dashboard_template " +
|
|
506
518
|
"with the id to read a definition and copy its widgets and queries.",
|
|
507
|
-
inputSchema:
|
|
519
|
+
inputSchema: toolInputSchema(dashboards.ListDashboardTemplatesSchema),
|
|
508
520
|
},
|
|
509
521
|
{
|
|
510
522
|
name: "get_dashboard_template",
|
|
511
523
|
annotations: { title: "Get Dashboard Template", readOnlyHint: true },
|
|
512
524
|
description: "Get detailed information about a specific dashboard template",
|
|
513
|
-
inputSchema:
|
|
525
|
+
inputSchema: toolInputSchema(dashboards.GetDashboardTemplateSchema),
|
|
514
526
|
},
|
|
515
527
|
{
|
|
516
528
|
name: "list_dashboards",
|
|
517
529
|
annotations: { title: "List Dashboards", readOnlyHint: true },
|
|
518
530
|
description: "List dashboards for the account",
|
|
519
|
-
inputSchema:
|
|
531
|
+
inputSchema: toolInputSchema(dashboards.ListDashboardsSchema),
|
|
520
532
|
},
|
|
521
533
|
{
|
|
522
534
|
name: "get_dashboard",
|
|
523
535
|
annotations: { title: "Get Dashboard", readOnlyHint: true },
|
|
524
536
|
description: "Get detailed information about a specific dashboard",
|
|
525
|
-
inputSchema:
|
|
537
|
+
inputSchema: toolInputSchema(dashboards.GetDashboardSchema),
|
|
526
538
|
},
|
|
527
539
|
{
|
|
528
540
|
name: "create_dashboard",
|
|
529
541
|
annotations: { title: "Create Dashboard", readOnlyHint: false, destructiveHint: false },
|
|
530
542
|
description: "Create a dashboard for the account. Build `rows` from the widget templates (list_widget_templates / get_widget_template) so the visualization and query shapes are valid.",
|
|
531
|
-
inputSchema:
|
|
543
|
+
inputSchema: toolInputSchema(dashboards.CreateDashboardSchema),
|
|
532
544
|
},
|
|
533
545
|
{
|
|
534
546
|
name: "update_dashboard",
|
|
535
547
|
annotations: { title: "Update Dashboard", readOnlyHint: false, destructiveHint: false },
|
|
536
548
|
description: "Update an existing dashboard. Omitted fields are left unchanged, so a small edit (a title, one row) does not require resending the whole dashboard.",
|
|
537
|
-
inputSchema:
|
|
549
|
+
inputSchema: toolInputSchema(dashboards.UpdateDashboardSchema),
|
|
538
550
|
},
|
|
539
551
|
]
|
|
540
552
|
: []),
|
|
@@ -545,7 +557,7 @@ For complete schema: call radql_get_type_metadata with target data_type`,
|
|
|
545
557
|
name: "list_external_integrations",
|
|
546
558
|
annotations: { title: "List External Integrations", readOnlyHint: true },
|
|
547
559
|
description: "List external integrations configured for the tenant (e.g., Slack, AWS CloudTrail, Okta). Returns integration details including capabilities, configuration, mcp support and sync status.",
|
|
548
|
-
inputSchema:
|
|
560
|
+
inputSchema: toolInputSchema(integrations.ListExternalIntegrationsSchema),
|
|
549
561
|
},
|
|
550
562
|
]
|
|
551
563
|
: []),
|