File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments