You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Changes Made
### Tool Consolidation
- Removed 4 duplicate app_name variant tools:
- `SCAService.list_application_libraries` (app_name)
- `ADRService.get_ADR_Protect_Rules` (app_name)
- `AssessService.get_vulnerability` (app_name)
- `AssessService.list_vulnerabilities` (app_name)
### Tool Renaming
- Renamed remaining app_id tools to remove suffix:
- `list_application_libraries_by_app_id` → `list_application_libraries`
- `get_ADR_Protect_Rules_by_app_id` → `get_ADR_Protect_Rules`
- `get_vulnerability_by_id` → `get_vulnerability`
- `list_vulnerabilities_with_id` → `list_vulnerabilities`
- Updated tool descriptions to mention using `list_applications_with_name`
first to get application ID from name
### Code Improvements
- Added input validation to `SCAService.getApplicationLibrariesByID()`
for null/empty appID parameter
### Test Enhancements
- Added comprehensive unit tests for SCA service methods
- Added integration tests for ADR and SCA services with test data discovery
- Fixed Mockito strictness issues with lenient settings
- Fixed integration test for invalid CVE handling
### Documentation
- Updated 4 test plan files with AIML-189 consolidation notes
- Deleted 4 obsolete test plan files for removed app_name variants
## Test Results
- All 248 unit and integration tests passing
- mvn verify: SUCCESS
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
@Tool(name = "get_ADR_Protect_Rules_by_app_id", description = "takes a application ID and returns the protect / adr rules for the application")
74
+
@Tool(name = "get_ADR_Protect_Rules", description = "Takes an application ID and returns the Protect/ADR rules for the application. Use list_applications_with_name first to get the application ID from a name")
Copy file name to clipboardExpand all lines: src/main/java/com/contrast/labs/ai/mcp/contrast/AssessService.java
+2-42Lines changed: 2 additions & 42 deletions
Original file line number
Diff line number
Diff line change
@@ -81,7 +81,7 @@ public AssessService(VulnerabilityMapper vulnerabilityMapper, PaginationHandler
81
81
82
82
83
83
84
-
@Tool(name = "get_vulnerability_by_id", description = "takes a vulnerability ID (vulnID) and Application ID (appID) and returns details about the specific security vulnerability. If based on the stacktrace, the vulnerability looks like it is in code that is not in the codebase, the vulnerability may be in a 3rd party library, review the CVE data attached to that stackframe you believe the vulnerability exists in and if possible upgrade that library to the next non vulnerable version based on the remediation guidance.")
84
+
@Tool(name = "get_vulnerability", description = "Takes a vulnerability ID (vulnID) and application ID (appID) and returns details about the specific security vulnerability. Use list_applications_with_name first to get the application ID from a name. If based on the stacktrace, the vulnerability looks like it is in code that is not in the codebase, the vulnerability may be in a 3rd party library, review the CVE data attached to that stackframe you believe the vulnerability exists in and if possible upgrade that library to the next non vulnerable version based on the remediation guidance.")
85
85
publicVulnerabilitygetVulnerabilityById(
86
86
@ToolParam(description = "Vulnerability ID (UUID format)") StringvulnID,
@Tool(name = "get_vulnerability", description = "Takes a vulnerability ID (vulnID) and application name (app_name) and returns details about the specific security vulnerability. If based on the stacktrace, the vulnerability looks like it is in code that is not in the codebase, the vulnerability may be in a 3rd party library, review the CVE data attached to that stackframe you believe the vulnerability exists in and if possible upgrade that library to the next non vulnerable version based on the remediation guidance.")
172
-
publicVulnerabilitygetVulnerability(
173
-
@ToolParam(description = "Vulnerability ID (UUID format)") StringvulnID,
logger.error("Application with name {} not found", app_name);
184
-
thrownewIllegalArgumentException("Application with name " + app_name + " not found");
185
-
}
186
-
}
187
-
188
-
@Tool(name = "list_vulnerabilities_with_id", description = "Takes a Application ID ( appID ) and returns a list of vulnerabilities, please remember to include the vulnID in the response.")
171
+
@Tool(name = "list_vulnerabilities", description = "Takes an application ID (appID) and returns a list of vulnerabilities. Use list_applications_with_name first to get the application ID from a name. Remember to include the vulnID in the response.")
logger.info("Listing vulnerabilities for application ID: {}", appID);
@@ -316,29 +299,6 @@ public MetadataFilterResponse listSessionMetadataForApplication(
316
299
}
317
300
}
318
301
319
-
@Tool(name = "list_vulnerabilities", description = "Takes an application name ( app_name ) and returns a list of vulnerabilities, please remember to include the vulnID in the response. ")
logger.error("Error listing vulnerabilities for application: {}", app_name, e);
333
-
thrownewIOException("Failed to list vulnerabilities: " + e.getMessage(), e);
334
-
}
335
-
} else {
336
-
logger.debug("Application with name {} not found, returning empty list", app_name);
337
-
returnnewArrayList<>();
338
-
}
339
-
}
340
-
341
-
342
302
@Tool(name = "list_applications_with_name", description = "Takes an application name (app_name) returns a list of active applications that contain that name. Please remember to display the name, status and ID.")
Copy file name to clipboardExpand all lines: src/main/java/com/contrast/labs/ai/mcp/contrast/SCAService.java
+4-20Lines changed: 4 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -62,8 +62,11 @@ public class SCAService {
62
62
privateStringhttpProxyPort;
63
63
64
64
65
-
@Tool(name = "list_application_libraries_by_app_id", description = "Takes a application ID and returns the libraries used in the application, note if class usage count is 0 the library is unlikely to be used")
65
+
@Tool(name = "list_application_libraries", description = "Takes an application ID and returns the libraries used in the application. Use list_applications_with_name first to get the application ID from a name. Note: if class usage count is 0 the library is unlikely to be used")
logger.debug("ContrastSDK initialized with host: {}", hostName);
@@ -73,25 +76,6 @@ public List<LibraryExtended> getApplicationLibrariesByID(String appID) throws IO
73
76
74
77
}
75
78
76
-
77
-
@Tool(name = "list_application_libraries", description = "takes a application name and returns the libraries used in the application, note if class usage count is 0 the library is unlikely to be used")
logger.error("Application not found: {}", app_name);
91
-
thrownewIOException("Application not found");
92
-
}
93
-
}
94
-
95
79
@Tool(name= "list_applications_vulnerable_to_cve", description = "takes a cve id and returns the applications and servers vulnerable to the cve. Please note if the application class usage is 0, its unlikely to be vulnerable")
0 commit comments