Raw upstream response payload (may contain data,
@context, and optionally dataQualityWarnings)
Optional extra data-quality warnings to merge into the response.
OptionalcustomEmptyReason: stringOptional human-readable reason to use instead
of the shared EMPTY_FEED_REASON when
items.length === 0. Useful when a specific
tool wants to surface a more descriptive message
while still preserving the upstream JSON-LD
payload (e.g. @context). When omitted the
default shared reason is used.
MCP-compliant ToolResult containing the uniform envelope
Wrap a successful upstream feed result in the uniform envelope.
The original payload (typically
{ data, '@context' }) is preserved verbatim and augmented with the uniform contract fields:statusis derived fromitems.lengthand warnings:"unavailable"whenitems.length === 0(covers the "HTTP 200 + empty array" upstream case);"degraded"when items are present and anydataQualityWarningsare present (either supplied viaresultor passed explicitly);"operational"when items are present and no warnings.datais normalized so that, after JSON serialization, consumers reading the backwards-compatibledatafield always see an array with the same contents asitems(structural equality across the wire, not referential identity).dataQualityWarningsfromresultare preserved and merged with any explicitly-supplied warnings (rather than clobbered). Whenstatusis"unavailable", the empty-feed reason is appended for backwards compatibility with consumers readingdataQualityWarnings.reasonis set wheneverstatus !== "operational".