Skip to content

Commit 224c786

Browse files
authored
Merge pull request #28 from VantaInc/add-all-get-endpoints
Add support for all GET endpoints in the Vanta API, with configurable tool list
2 parents 49c0dd5 + 9360778 commit 224c786

30 files changed

+3524
-541
lines changed

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,10 @@ node_modules/
139139
build/
140140

141141
# Claude Code generated files
142-
CLAUDE.md
142+
CLAUDE.md
143+
144+
# backup files
145+
*.bak*
146+
147+
# Mac filesystem
148+
*.DS_store

README.md

Lines changed: 151 additions & 23 deletions
Large diffs are not rendered by default.

src/config.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
const normalizeName = (name: string): string => name.trim().toLowerCase();
2+
3+
const enabledToolNames = [
4+
// Add tool names here to restrict the server to a subset of tools.
5+
// Leave the array empty to enable every tool.
6+
// Example:
7+
// "tests",
8+
// "list_test_entities",
9+
"tests",
10+
"list_test_entities",
11+
"people",
12+
"documents",
13+
"document_resources",
14+
"integrations",
15+
"integration_resources",
16+
"controls",
17+
"list_control_tests",
18+
"list_control_documents",
19+
"vulnerabilities",
20+
"frameworks",
21+
"list_framework_controls",
22+
"risks",
23+
].map(normalizeName);
24+
25+
export const enabledTools = new Set<string>(enabledToolNames);
26+
27+
export const hasEnabledToolFilter = enabledTools.size > 0;
28+
29+
export const isToolEnabled = (toolName: string): boolean => {
30+
if (!hasEnabledToolFilter) {
31+
return true;
32+
}
33+
return enabledTools.has(normalizeName(toolName));
34+
};
35+
36+
export const getEnabledToolNames = (): string[] => [...enabledTools];

src/eval/README.md

Lines changed: 109 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,75 @@ OPENAI_API_KEY="your_openai_api_key_here" node build/eval/eval.js
4040

4141
## Test Cases
4242

43-
The evaluation includes 11 test cases covering:
43+
The evaluation includes 66 test cases covering:
4444

4545
### **Tool Selection Tests**
4646

47-
- **AWS Security Review**: `get_tests` with AWS and NEEDS_ATTENTION filters
48-
- **SOC2 Compliance**: `get_tests` with SOC2 framework filter
49-
- **Entity Details**: `get_test_entities` for specific failing resources
50-
- **Maintenance Deactivation**: `deactivate_test_entity` for suppressing alerts
51-
- **Framework Listing**: `get_frameworks` for available frameworks
52-
- **Control Requirements**: `get_framework_controls` for specific framework details
53-
- **Status Percentage**: `get_frameworks` for completion percentages
54-
- **Control Listing**: `get_controls` for all security controls
55-
- **Control Tests**: `get_control_tests` for tests validating specific controls
47+
- **Framework Listing**: `frameworks` to list available compliance frameworks
48+
- **Framework Details**: `frameworks` with frameworkId for specific framework information
49+
- **Framework Controls**: `list_framework_controls` for control requirements in specific frameworks
50+
- **Control Listing**: `controls` to list all security controls
51+
- **Control Details**: `controls` with controlId for specific control information
52+
- **Control Tests**: `list_control_tests` for tests validating specific controls
53+
- **Library Controls**: `list_library_controls` for available Vanta library controls
54+
- **Control Documents**: `list_control_documents` for documents associated with controls
55+
- **Risk Listing**: `risks` to list all risk scenarios
56+
- **Risk Details**: `risks` with riskId for specific risk scenario information
57+
- **Test Listing**: `tests` to list all security tests
58+
- **Test Details**: `tests` with testId for specific test information
59+
- **Test Entities**: `list_test_entities` for resources tested by specific tests
60+
- **Integration Listing**: `integrations` to list connected integrations
61+
- **Integration Details**: `integrations` with integrationId for specific integration information
62+
- **Integration Resource Kinds**: `list_integration_resource_kinds` for available resource types
63+
- **Integration Resource Details**: `get_integration_resource_kind_details` for resource type schemas
64+
- **Integration Resources**: `list_integration_resources` for monitored resources
65+
- **Integration Resource Info**: `get_integration_resource` for specific resource details
66+
- **Vendor Listing**: `vendors` to list all vendors
67+
- **Vendor Details**: `vendors` with vendorId for specific vendor information
68+
- **Vendor Documents**: `list_vendor_documents` for vendor compliance documentation
69+
- **Vendor Findings**: `list_vendor_findings` for vendor security issues
70+
- **Vendor Security Reviews**: `list_vendor_security_reviews` for vendor assessments
71+
- **Vendor Security Review Details**: `get_vendor_security_review` for specific review information
72+
- **Vendor Security Review Documents**: `list_vendor_security_review_documents` for review documentation
73+
- **Document Listing**: `documents` to list all compliance documents
74+
- **Document Details**: `documents` with documentId for specific document information
75+
- **Document Controls**: `list_document_controls` for controls associated with documents
76+
- **Document Links**: `list_document_links` for external references in documents
77+
- **Document Uploads**: `list_document_uploads` for file uploads attached to documents
78+
- **Document Downloads**: `download_document_file` for intelligently downloading files (text content for readable files, metadata for binary files)
79+
- **Policy Listing**: `policies` to list all organizational policies
80+
- **Policy Details**: `policies` with policyId for specific policy information
81+
- **Discovered Vendors**: `list_discovered_vendors` for automatically discovered vendors
82+
- **Discovered Vendor Accounts**: `list_discovered_vendor_accounts` for detailed vendor account information
83+
- **Group Listing**: `groups` to list all organizational groups
84+
- **Group Details**: `groups` with groupId for specific group information
85+
- **Group Membership**: `list_group_people` for people in specific groups
86+
- **People Listing**: `people` to list all people in the organization
87+
- **Person Details**: `people` with personId for specific person information
88+
- **Vulnerability Listing**: `vulnerabilities` to list all detected vulnerabilities
89+
- **Vulnerability Details**: `vulnerabilities` with vulnerabilityId for specific vulnerability information
90+
- **Vulnerability Remediations**: `list_vulnerability_remediations` for tracking remediation efforts
91+
- **Vulnerable Assets**: `vulnerable_assets` to list assets affected by vulnerabilities
92+
- **Vulnerable Asset Details**: `vulnerable_assets` with vulnerableAssetId for specific asset vulnerability information
93+
- **Monitored Computers**: `monitored_computers` to list all computers being monitored for compliance
94+
- **Computer Details**: `monitored_computers` with monitoredComputerId for specific computer information
95+
- **Vendor Risk Attributes**: `list_vendor_risk_attributes` for available risk assessment criteria
96+
- **Trust Center Configuration**: `get_trust_center` for Trust Center settings and branding
97+
- **Trust Center Access Requests**: `trust_center_access_requests` for managing customer access (list or get specific)
98+
- **Trust Center Analytics**: `list_trust_center_viewer_activity_events` for engagement tracking
99+
- **Control Categories**: `trust_center_control_categories` for compliance organization (list or get specific)
100+
- **Published Controls**: `trust_center_controls` for public compliance controls (list or get specific)
101+
- **Trust Center FAQs**: `trust_center_faqs` for customer information (list or get specific)
102+
- **Trust Center Resources**: `list_trust_center_resources` for downloadable materials
103+
- **Resource Documents**: `get_trust_center_document` for specific document details
104+
- **Resource Media**: `get_trust_center_resource_media` for downloading Trust Center files
105+
- **Trust Center Subprocessors**: `trust_center_subprocessors` for third-party service providers (list or get specific)
106+
- **Trust Center Updates**: `trust_center_updates` for compliance status changes (list or get specific)
107+
- **Trust Center Viewers**: `trust_center_viewers` for access management (list or get specific)
108+
- **Trust Center Subscribers**: `get_trust_center_subscriber` for subscriber details
109+
- **Trust Center Subscriber Groups**: `trust_center_subscriber_groups` for subscriber organization (list or get specific)
110+
- **Trust Center Historical Access**: `list_trust_center_historical_access_requests` for audit tracking
111+
- **Trust Center All Subscribers**: `list_trust_center_subscribers` for communication management
56112

57113
### **Negative Tests**
58114

@@ -65,20 +121,26 @@ The evaluation includes 11 test cases covering:
65121
🧪 Vanta MCP Server Tool Evaluation
66122
====================================
67123
68-
📝 Test: Should call get_tests with AWS filter and NEEDS_ATTENTION status
69-
💬 Prompt: "What security issues do I have in my AWS infrastructure?"
70-
🎯 Expected Tool: get_tests
71-
✅ PASS: Correctly called get_tests
124+
📝 Test: Should call frameworks to list available frameworks
125+
💬 Prompt: "What compliance frameworks are we tracking?"
126+
🎯 Expected Tool: frameworks
127+
✅ PASS: Correctly called frameworks
128+
✅ Parameters match expected values
129+
📋 Called with: {}
130+
131+
📝 Test: Should call controls with controlId for specific control details
132+
💬 Prompt: "Get details for control ID data-protection-2"
133+
🎯 Expected Tool: controls
134+
✅ PASS: Correctly called controls
72135
✅ Parameters match expected values
73136
📋 Called with: {
74-
"statusFilter": "NEEDS_ATTENTION",
75-
"integrationFilter": "aws"
137+
"controlId": "data-protection-2"
76138
}
77139
78140
📊 Final Results
79141
================
80-
✅ Passed: 11/11 tests
81-
❌ Failed: 0/11 tests
142+
✅ Passed: 66/66 tests
143+
❌ Failed: 0/66 tests
82144
📈 Success Rate: 100%
83145
🎉 All tests passed! Tool calling behavior is working correctly.
84146
```
@@ -101,6 +163,33 @@ The evaluation includes 11 test cases covering:
101163
- No tool was called when one was expected
102164
- Tool was called when none should be
103165

166+
## Consolidated Tool Architecture
167+
168+
The Vanta MCP Server uses a **consolidated tool pattern** where many tools can handle both list and get-by-ID operations:
169+
170+
### **Consolidated Tools** (53 total)
171+
172+
These tools accept an optional ID parameter:
173+
174+
- **Without ID**: Lists all resources with optional filtering and pagination
175+
- **With ID**: Returns the specific resource details
176+
177+
Examples:
178+
179+
- `frameworks` - Lists all frameworks OR get specific framework with `frameworkId`
180+
- `controls` - Lists all controls OR get specific control with `controlId`
181+
- `vendors` - Lists all vendors OR get specific vendor with `vendorId`
182+
- `documents` - Lists all documents OR get specific document with `documentId`
183+
184+
### **Specialized Tools**
185+
186+
Some tools remain separate for specific operations:
187+
188+
- `list_control_tests` - Lists tests for a control
189+
- `list_framework_controls` - Lists controls in a framework
190+
- `download_document_file` - Downloads document files
191+
- `get_integration_resource` - Gets specific integration resources
192+
104193
## Customizing Tests
105194

106195
To add new test cases, edit `eval.ts` and add to the `testCases` array:
@@ -159,5 +248,6 @@ This evaluation system helps ensure that:
159248
- **Real-world prompts** trigger the correct tools
160249
- **Parameter passing** works as expected
161250
- **Scope boundaries** are respected (no tools called for non-compliance queries)
251+
- **Consolidated architecture** works effectively (LLMs understand optional ID parameters)
162252

163-
The goal is to maintain high confidence that AI assistants will use the Vanta MCP Server correctly for compliance and security management tasks.
253+
The goal is to maintain high confidence that AI assistants will use the Vanta MCP Server correctly for compliance and security management tasks, taking advantage of the intelligent consolidated tool pattern for optimal efficiency.

0 commit comments

Comments
 (0)