Skip to content

Commit cce56d7

Browse files
cogeorclaude
andcommitted
revert: drop validateToolOutput drive-by, leave to #2106
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 1ee0be6 commit cce56d7

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

src/server/mcp.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -306,11 +306,8 @@ export class McpServer {
306306
}
307307

308308
// if the tool has an output schema, validate structured content
309-
// Same fallback as validateToolInput: when normalizeObjectSchema returns undefined
310-
// (wrapped schema), parse against the original to avoid passing undefined into safeParseAsync.
311-
const outputObj = normalizeObjectSchema(tool.outputSchema);
312-
const schemaToParse = outputObj ?? (tool.outputSchema as AnySchema);
313-
const parseResult = await safeParseAsync(schemaToParse, result.structuredContent);
309+
const outputObj = normalizeObjectSchema(tool.outputSchema) as AnyObjectSchema;
310+
const parseResult = await safeParseAsync(outputObj, result.structuredContent);
314311
if (!parseResult.success) {
315312
const error = 'error' in parseResult ? parseResult.error : 'Unknown error';
316313
const errorMessage = getParseErrorMessage(error);

0 commit comments

Comments
 (0)