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

@ -182,6 +182,9 @@ class ToolInputValidationIntegrationTests {
assertThat(result.isError()).isTrue();
String errorMessage = ((TextContent) result.content().get(0)).text();
assertThat(errorMessage).startsWith("Tool (test-tool) input validation failed:");
assertThat(errorMessage).containsIgnoringCase("Validation failed");
assertThat(errorMessage).containsIgnoringCase("JSON schema validation errors");
assertThat(errorMessage).containsIgnoringCase(expectedErrorSubstring);
}
finally {