Commit edb3567
Fix route coverage parameter validation for sessionMetadataValue
Add symmetric validation to reject sessionMetadataValue when provided
without sessionMetadataName. Previously, the tool silently ignored
sessionMetadataValue in this scenario, causing users to receive
unfiltered results without any indication of the misconfiguration.
Changes:
- Added validation check rejecting null/empty sessionMetadataName with
non-null sessionMetadataValue (mirrors existing reverse check)
- Updated @tool description with explicit note about parameter dependency
- Updated JavaDoc for both parameters stating "Must be provided with..."
- Updated @throws documentation to cover both validation directions
Testing:
- Added testGetRouteCoverage_SessionMetadataValue_WithoutName() test
- Added testGetRouteCoverage_SessionMetadataValue_WithEmptyName() test
- All 327 tests passing (26 RouteCoverageService tests)
Users now receive immediate, clear error messages instead of silently
incorrect results. AI models consuming the tool see explicit
documentation about the parameter dependency.
Addresses mcp-rlc.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent e9c43e7 commit edb3567
File tree
2 files changed
+46
-5
lines changed- src
- main/java/com/contrast/labs/ai/mcp/contrast
- test/java/com/contrast/labs/ai/mcp/contrast
2 files changed
+46
-5
lines changedLines changed: 13 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
82 | 90 | | |
83 | 91 | | |
84 | 92 | | |
| |||
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
314 | 347 | | |
315 | 348 | | |
316 | 349 | | |
| |||
0 commit comments