ToolResult
The outcome of an McpTool.execute call. Exactly one of data / errorMessage is meaningful, selected by isSuccess. The protocol layer maps a result onto the MCP tools/call response: success becomes content, failure becomes an isError: true payload.
Construct via the success / error factories rather than the primary constructor.
Constructors
Properties
Failure description on error; null on success. See the error overloads for the prose vs. short-form (code: detail) conventions.
Functions
Marks the base64 string at data[dataKey] as an image of mimeType. Over MCP it is sent as an image content block and dataKey is left out of the JSON text and structuredContent, so the payload travels once and clients render it as a picture. data is unchanged, so in-process callers keep reading data[dataKey]. No-op if the key isn't a string.