Clarify tool validation error messages (#1023)

- DefaultJsonSchemaValidator now emits a neutral message;
- Call sites in ToolInputValidator and the server output handlers
  prepend their own context prefix,
- Integration test assertions strengthened accordingly.

Closes #986

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>

* address review comments

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>

* address review comments

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>

---------

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
This commit is contained in:
Christian Tzolov 2026-06-11 09:45:28 +02:00 • committed by GitHub
commit 99faac65f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -75,8 +75,7 @@ public class DefaultJsonSchemaValidator implements JsonSchemaValidator {
// Check if validation passed
if (!validationResult.isEmpty()) {
return ValidationResponse
.asInvalid("Validation failed: structuredContent does not match tool outputSchema. "
+ "Validation errors: " + validationResult);
.asInvalid("Validation failed: JSON schema validation errors: " + validationResult);
}
return ValidationResponse.asValid(jsonStructuredOutput.toString());