From c14d0467fd77e4f56dc45c5d4657d131c5fb5285 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 7eed33942..6e89ab70e 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 static ValidationResponse asInvalid(String message) { /** * 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