From 39b2f654349f5e7196829720f956f1ad71d446cf Mon Sep 17 00:00:00 2001 From: Basil Hosmer Date: Thu, 15 May 2025 09:57:20 -0400 Subject: [PATCH] restore server-side validation for tools returning structuredContent without outputSchema Co-Authored-By: Claude --- src/server/mcp.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/server/mcp.ts b/src/server/mcp.ts index e0de538a..a5f2d0f1 100644 --- a/src/server/mcp.ts +++ b/src/server/mcp.ts @@ -226,6 +226,14 @@ export class McpServer { `Tool ${request.params.name} has no outputSchema and must return content`, ); } + + // If structuredContent is provided, it's an error + if (result.structuredContent) { + throw new McpError( + ErrorCode.InternalError, + `Tool ${request.params.name} has no outputSchema but returned structuredContent`, + ); + } } return result;