From b31841eec06180a84c003fad5d5041da2c070815 Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Thu, 27 Aug 2026 08:17:47 +0200 Subject: [PATCH] docs(core): document String structuredContent parsing in JsonSchemaValidator --- .../json/schema/JsonSchemaValidator.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mcp-core/src/main/java/io/modelcontextprotocol/json/schema/JsonSchemaValidator.java b/mcp-core/src/main/java/io/modelcontextprotocol/json/schema/JsonSchemaValidator.java index 7eed339..6e89ab7 100644 --- a/mcp-core/src/main/java/io/modelcontextprotocol/json/schema/JsonSchemaValidator.java +++ b/mcp-core/src/main/java/io/modelcontextprotocol/json/schema/JsonSchemaValidator.java @@ -57,6 +57,11 @@ public interface JsonSchemaValidator { /** * Validates the structured content against the provided JSON schema. + *

+ * If {@code structuredContent} is a {@link String}, it is treated as a serialized + * JSON document and parsed before validation; quote embedded strings accordingly (for + * example {@code "\"red\""} for the JSON string value {@code red}). Any other type is + * converted to its JSON representation directly. * @param schema The JSON schema to validate against. * @param structuredContent The structured content to validate. * @return A ValidationResponse indicating whether the validation was successful or