Skip to content

Commit 1363c86

Browse files
bhosmer-antclaude
andcommitted
restore server-side validation for tools returning structuredContent without outputSchema
Co-Authored-By: Claude <[email protected]>
1 parent 0f2d5c0 commit 1363c86

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/server/mcp.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,14 @@ export class McpServer {
226226
`Tool ${request.params.name} has no outputSchema and must return content`,
227227
);
228228
}
229+
230+
// If structuredContent is provided, it's an error
231+
if (result.structuredContent) {
232+
throw new McpError(
233+
ErrorCode.InternalError,
234+
`Tool ${request.params.name} has no outputSchema but returned structuredContent`,
235+
);
236+
}
229237
}
230238

231239
return result;

0 commit comments

Comments
 (0)