Class McpJsonString

java.lang.Object
com.soklet.McpJsonString
All Implemented Interfaces:
McpJsonValue

@ThreadSafe public final class McpJsonString extends Object implements McpJsonValue
An immutable JSON string.

Construction rejects unpaired UTF-16 surrogates with IllegalArgumentException and retains well-formed text exactly, without normalization or replacement. It does not guarantee that the value can be sent on the MCP wire. Production JSON independently limits decoded strings and their escaped tokens to 1,048,576 UTF-16 code units, excluding the surrounding quotes. For example, each newline consumes one decoded unit but two token units. Object member names have the same limits. The complete response is also limited to 4 MiB of UTF-8 JSON.

Author:
Mark Allen