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.
Whether this result is an MRTR InputRequiredResult: the server needs the client to gather input (inputRequests) and retry the original tools/call with matching inputResponses, rather than a completed tool result.
Decode the MRTR (SEP-2322) requestState as JSON into T, the typed inverse of the server-side RequestContext.requestStateAs!T (the server encodes serializeToJson(state).toString()). Returns T.init when the server sent no state (requestState empty).
Decode structuredContent into a typed struct T. Mirrors ElicitResult.contentAs!T: returns T.init when structuredContent is not an object (e.g. unset, or a content-only tool result), so callers that opted into a typed output schema can read the result without re-deserializing by hand. The result comes from an untrusted/possibly non-conforming server, so — mirroring the inbound argsAs!T accessor — a deserialization failure on a shape that does not match T is mapped to invalidParams (rather than leaking a raw vibe exception); an McpException propagates unchanged.
Fluent setter for the result-level _meta object, e.g. CallToolResult([Content.makeText("ok")]).withMeta(m).
Build an error result (isError = true) carrying a single text content block describing the failure.
Build a CallToolResult whose structuredContent is value serialized via vibe's serializeToJson. When content is null it defaults to a single text block carrying the JSON string of value, mirroring the reflection layer's toToolResult behaviour so a structured result also has a human-readable content fallback for clients that ignore structuredContent.
Build a successful result carrying a single text content block.
Multi Round-Trip Requests (MRTR / SEP-2322): when the draft server needs more input to complete the call, it answers tools/call with an InputRequiredResult instead of a CallToolResult — a set of InputRequests the client must satisfy (via its sampling / elicitation / roots handlers) and resubmit. When non-empty, content is meaningless and the caller should gather input and retry the request with matching inputResponses. See isInputRequired.
MRTR (SEP-2322): the opaque, server-owned requestState carried on an InputRequiredResult. The client MUST echo it back verbatim (and MUST NOT inspect it) when retrying. Empty when the server sent none.
optional _meta object
Result of tools/call.