@cloudgrid-io/mcp 0.19.0 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/tools.js +11 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudgrid-io/mcp",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.1",
|
|
4
4
|
"description": "MCP server for CloudGrid. Three editions: a local stdio server (full toolset), a hosted web server (light, CLI-free toolset), and a public docs server (search_cloudgrid_documentation) over MCP Streamable HTTP.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/src/tools.js
CHANGED
|
@@ -2101,8 +2101,17 @@ async function readInspirationSourceViaApi(ctx, { entityId, slug, grid }) {
|
|
|
2101
2101
|
{ method: "GET", headers, signal: AbortSignal.timeout(15_000) },
|
|
2102
2102
|
);
|
|
2103
2103
|
if (!res.ok) continue;
|
|
2104
|
-
|
|
2105
|
-
|
|
2104
|
+
// The route (GET /v2/inspirations/:seg/source) serves the RAW HTML bytes
|
|
2105
|
+
// as text/html — NOT a JSON { html } envelope. Read the body as text.
|
|
2106
|
+
// (Tolerate a JSON { html } shape too, in case a variant ever returns it.)
|
|
2107
|
+
const ct = (res.headers.get("content-type") || "").toLowerCase();
|
|
2108
|
+
if (ct.includes("application/json")) {
|
|
2109
|
+
const data = await res.json().catch(() => null);
|
|
2110
|
+
if (data && typeof data.html === "string") return data.html;
|
|
2111
|
+
continue;
|
|
2112
|
+
}
|
|
2113
|
+
const html = await res.text().catch(() => null);
|
|
2114
|
+
if (typeof html === "string" && html.length > 0) return html;
|
|
2106
2115
|
} catch {
|
|
2107
2116
|
// try the next attempt, then the public-fetch fallback
|
|
2108
2117
|
}
|