Use content instead of structuredContent in examples

Not all MCP clients support structuredContent in MCP tool results, so
examples now return data as JSON in content and parse it client-side.

Pattern used:
- Server: content: [{ type: "text", text: JSON.stringify(data) }]
- Client: JSON.parse(result.content!.filter(...).map(...).join(""))

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jonathan Hefner 2025-12-05 16:18:02 -06:00
commit 61cd4ed219

View file

@ -103,7 +103,13 @@ function CohortHeatmapInner({ app }: { app: App }) {
maxPeriods: 12,
},
});
setData(result.structuredContent as unknown as CohortData);
const text = result
.content!.filter(
(c): c is { type: "text"; text: string } => c.type === "text",
)
.map((c) => c.text)
.join("");
setData(JSON.parse(text) as CohortData);
} catch (e) {
console.error("Failed to fetch cohort data:", e);
} finally {