CallToolResult.forVersion

Return a copy of this CallToolResult with any fields newer than the negotiated protocol version stripped, so the wire output stays valid for the peer's version. structuredContent was introduced by 2025-06-18: the 2025-03-26 and 2024-11-05 tool-result shapes are content[] + isError only, with no structuredContent. It is therefore emitted only when the negotiated version is >= 2025-06-18 and dropped for every earlier version. The content text mirror (which the reflection layer populates alongside structuredContent) is valid in all versions and is preserved. Mirrors Tool.forVersion.

struct CallToolResult
const @safe
forVersion