Skip to content

Commit 9360778

Browse files
Add and clarify optional parameters for tools
1 parent 0d7dd07 commit 9360778

File tree

7 files changed

+114
-30
lines changed

7 files changed

+114
-30
lines changed

src/operations/common/descriptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This file provides centralized, consistent descriptions for commonly used parameters
33
// across all operations files, ensuring uniformity and maintainability.
44

5-
export const PAGE_SIZE_DESCRIPTION = `Controls the maximum number of tests returned in a single response.
5+
export const PAGE_SIZE_DESCRIPTION = `Controls the maximum number of results returned in a single response.
66
Allowed values: 1–100. Default is 10.`;
77

88
export const PAGE_CURSOR_DESCRIPTION = `A marker or pointer telling the API where to start fetching items for the

src/operations/documents.ts

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,27 @@ import {
1313
} from "./common/imports.js";
1414

1515
// 2. Input Schemas
16-
const DocumentsInput = createConsolidatedSchema({
17-
paramName: "documentId",
18-
description: DOCUMENT_ID_DESCRIPTION,
19-
resourceName: "document",
20-
});
16+
const DocumentsInput = createConsolidatedSchema(
17+
{
18+
paramName: "documentId",
19+
description: DOCUMENT_ID_DESCRIPTION,
20+
resourceName: "document",
21+
},
22+
{
23+
frameworkMatchesAny: z
24+
.array(z.string())
25+
.describe(
26+
"Filter documents by framework IDs. Returns documents that belong to any of the specified frameworks, e.g. ['soc2', 'iso27001', 'hipaa']",
27+
)
28+
.optional(),
29+
statusMatchesAny: z
30+
.array(z.string())
31+
.describe(
32+
"Filter documents by status. Possible values: Needs document, Needs update, Not relevant, OK.",
33+
)
34+
.optional(),
35+
},
36+
);
2137

2238
const DocumentResourcesInput = z.object({
2339
documentId: z.string().describe(DOCUMENT_ID_DESCRIPTION),
@@ -48,7 +64,7 @@ export const DocumentsTool: Tool<typeof DocumentsInput> = {
4864
export const DocumentResourcesTool: Tool<typeof DocumentResourcesInput> = {
4965
name: "document_resources",
5066
description:
51-
"Access document-related resources including controls, links, and uploads. Specify resourceType to get the specific type of resource associated with a document. Use this to explore what controls are linked to a document, what external references exist, or what files are attached.",
67+
"Access document-related resources including controls, links (i.e. hyperlinks), and uploads. Specify resourceType to get the specific type of resource associated with a document. Use this to explore what controls are linked to a document, what external references exist, or what files are attached (including the download link for those files).",
5268
parameters: DocumentResourcesInput,
5369
};
5470

src/operations/integrations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const IntegrationResourcesInput = z.object({
2929
resourceKind: z
3030
.string()
3131
.describe(
32-
"Resource kind to operate on, e.g. 'ec2-instances' or specific resource kind identifier (required for get_kind_details, list_resources, get_resource)",
32+
"Resource kind to operate on, e.g. 'EC2Instance' or specific resource kind identifier (required for get_kind_details, list_resources, get_resource)",
3333
)
3434
.optional(),
3535
resourceId: z

src/operations/people.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,22 @@ import {
88
} from "./common/imports.js";
99

1010
// 2. Input Schemas
11-
const PeopleInput = createConsolidatedSchema({
12-
paramName: "personId",
13-
description:
14-
"Person ID to retrieve, e.g. 'person-123' or specific person identifier",
15-
resourceName: "person",
16-
});
11+
const PeopleInput = createConsolidatedSchema(
12+
{
13+
paramName: "personId",
14+
description:
15+
"Person ID to retrieve, e.g. 'person-123' or specific person identifier. If provided, returns the specific person, and no other parameters may be provided. If omitted, lists all people with optional filtering and pagination. ",
16+
resourceName: "person",
17+
},
18+
{
19+
taskStatusMatchesAny: z
20+
.array(z.string())
21+
.describe(
22+
"Filter people by task status. Possible values: COMPLETED (Task is completed), IN_PROGRESS (Task is in progress), FAILED (Task failed), NOT_STARTED (Task is not started)",
23+
)
24+
.optional(),
25+
},
26+
);
1727

1828
// 3. Tool Definitions
1929
export const PeopleTool: Tool<typeof PeopleInput> = {

src/operations/risks.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,30 @@ const RisksInput = createConsolidatedSchema(
1212
{
1313
paramName: "riskId",
1414
description:
15-
"Risk scenario ID to retrieve, e.g. 'risk-scenario-123' or specific risk identifier",
15+
"Risk scenario ID to retrieve, e.g. 'risk-scenario-123' or specific risk identifier. If provided, returns the specific risk scenario, and no other parameters may be provided. If omitted, lists all risk scenarios with optional filtering and pagination.",
1616
resourceName: "risk scenario",
1717
},
1818
{
1919
categoryMatchesAny: z
2020
.string()
2121
.optional()
2222
.describe(
23-
"Filter by risk category. Example: Access Control, Cryptography, Privacy, etc.",
23+
"Filter by risk category. Example: Access Control, Cryptography, Privacy, etc. Use 'Uncategorized' for risks that don't have a category.",
2424
),
25+
reviewStatusMatchesAny: z
26+
.array(z.string())
27+
.describe(
28+
"Filter risk scenarios by review status. Possible values: PENDING, APPROVED, REJECTED",
29+
)
30+
.optional(),
2531
},
2632
);
2733

2834
// 3. Tool Definitions
2935
export const RisksTool: Tool<typeof RisksInput> = {
3036
name: "risks",
3137
description:
32-
"Access risk scenarios in your Vanta account. Provide riskId to get a specific risk scenario, or omit to list all risks with optional category filtering. Returns risk details, assessments, and mitigation strategies for compliance reporting.",
38+
"Access risk scenarios in your Vanta account. Provide riskId to get a specific risk scenario, or omit to list all risks with optional filtering and pagination. Returns risk details, impact assessments, and mitigation strategies for compliance reporting.",
3339
parameters: RisksInput,
3440
};
3541

src/operations/tests.ts

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,30 @@ import {
1212
} from "./common/imports.js";
1313

1414
// 2. Input Schemas
15-
const TestsInput = createConsolidatedSchema({
16-
paramName: "testId",
17-
description:
18-
"Test ID to retrieve, e.g. 'test-123' or specific test identifier",
19-
resourceName: "test",
20-
});
15+
const TestsInput = createConsolidatedSchema(
16+
{
17+
paramName: "testId",
18+
description:
19+
"Test ID to retrieve, e.g. 'test-123' or specific test identifier. If provided, returns the specific test, and no other parameters may be provided. If omitted, lists all tests with optional filtering and pagination.",
20+
resourceName: "test",
21+
},
22+
{
23+
statusFilter: z
24+
.string()
25+
.describe(
26+
"Filter tests by test status. Possible values: OK (Test passed), DEACTIVATED (Test is deactivated), NEEDS_ATTENTION (Test failed), IN_PROGRESS (Test is in progress), INVALID (Test is invalid), NOT_APPLICABLE (Test is not applicable)",
27+
)
28+
.optional(),
29+
frameworkFilter: z
30+
.string()
31+
.describe("Filter tests by framework. Provide framework ID.")
32+
.optional(),
33+
integrationFilter: z
34+
.string()
35+
.describe("Filter tests by integration. Provide integration ID.")
36+
.optional(),
37+
},
38+
);
2139

2240
const ListTestEntitiesInput = createIdWithPaginationSchema({
2341
paramName: "testId",
@@ -29,7 +47,7 @@ const ListTestEntitiesInput = createIdWithPaginationSchema({
2947
export const TestsTool: Tool<typeof TestsInput> = {
3048
name: "tests",
3149
description:
32-
"Access security tests in your Vanta account. Provide testId to get a specific test, or omit to list all tests. Returns test IDs, names, types, schedules, current status, and detailed configuration for compliance monitoring.",
50+
"Access continuous monitoring tests in your Vanta account. Provide testId to get a specific test, or omit to list all tests. Returns test IDs, names, types, schedules, current status, and detailed configuration for compliance monitoring.",
3351
parameters: TestsInput,
3452
};
3553

src/operations/vulnerabilities.ts

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,46 @@ import {
88
} from "./common/imports.js";
99

1010
// 2. Input Schemas
11-
const VulnerabilitiesInput = createConsolidatedSchema({
12-
paramName: "vulnerabilityId",
13-
description:
14-
"Vulnerability ID to retrieve, e.g. 'vulnerability-123' or specific vulnerability identifier",
15-
resourceName: "vulnerability",
16-
});
11+
const VulnerabilitiesInput = createConsolidatedSchema(
12+
{
13+
paramName: "vulnerabilityId",
14+
description:
15+
"Vulnerability ID to retrieve, e.g. 'vulnerability-123' or specific vulnerability identifier. If provided, returns the specific vulnerability, and no other parameters may be provided. If omitted, lists all vulnerabilities with optional filtering and pagination.",
16+
resourceName: "vulnerability",
17+
},
18+
{
19+
externalVulnerabilityId: z
20+
.string()
21+
.describe(
22+
"Filter vulnerabilities by external vulnerability ID (e.g. CVE-2024-1234). Returns vulnerabilities that match the provided external vulnerability ID.",
23+
)
24+
.optional(),
25+
severity: z
26+
.string()
27+
.describe(
28+
"Filter vulnerabilities by severity. Possible values: LOW (Low severity), MEDIUM (Medium severity), HIGH (High severity), CRITICAL (Critical severity)",
29+
)
30+
.optional(),
31+
integrationId: z
32+
.string()
33+
.describe(
34+
"Filter vulnerabilities by integration ID. Returns vulnerabilities that are associated with the specified integration.",
35+
)
36+
.optional(),
37+
slaDeadlineAfter: z
38+
.string()
39+
.describe(
40+
"Filter vulnerabilities by SLA deadline after the specified date. Returns vulnerabilities that have an SLA deadline after the specified date. Date should be formatted as YYYY-MM-DD.",
41+
)
42+
.optional(),
43+
slaDeadlineBefore: z
44+
.string()
45+
.describe(
46+
"Filter vulnerabilities by SLA deadline before the specified date. Returns vulnerabilities that have an SLA deadline before the specified date. Date should be formatted as YYYY-MM-DD.",
47+
)
48+
.optional(),
49+
},
50+
);
1751

1852
// 3. Tool Definitions
1953
export const VulnerabilitiesTool: Tool<typeof VulnerabilitiesInput> = {

0 commit comments

Comments
 (0)