From 7149a8485e5c344f91f43c684a296ec4e2c820c1 Mon Sep 17 00:00:00 2001 From: Admin Date: Tue, 29 Sep 2026 06:18:22 +0000 Subject: [PATCH] Sync MCP structured result compatibility fix --- src/mcp.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mcp.ts b/src/mcp.ts index 2133c7e..fee8462 100644 --- a/src/mcp.ts +++ b/src/mcp.ts @@ -93,9 +93,14 @@ const tools = [ ]; function result(data: unknown) { + const structuredContent = + data !== null && typeof data === "object" && !Array.isArray(data) + ? data as Record + : { items: data }; + return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }], - structuredContent: data + structuredContent }; }