Helpers for unwrapping results of adt-ls's own (federated) MCP tools.
A federated tool returns a full MCP CallToolResult: { content:[{text}], structuredContent?, isError? }. The content[0].text is the tool's complete JSON
payload; structuredContent is an OUTPUT-SCHEMA-projected view that can be LOSSY
(e.g. abap_business_services-fetch_services omits odataVersion from
structuredContent but keeps it in the text). So we prefer the parsed full text and
fall back to structuredContent, then raw text — giving callers the complete payload
instead of the doubly-wrapped envelope.
Helpers for unwrapping results of adt-ls's own (federated) MCP tools.
A federated tool returns a full MCP CallToolResult:
{ content:[{text}], structuredContent?, isError? }. Thecontent[0].textis the tool's complete JSON payload;structuredContentis an OUTPUT-SCHEMA-projected view that can be LOSSY (e.g.abap_business_services-fetch_servicesomitsodataVersionfrom structuredContent but keeps it in the text). So we prefer the parsed full text and fall back to structuredContent, then raw text — giving callers the complete payload instead of the doubly-wrapped envelope.