restore server-side validation for tools returning structuredContent without outputSchema
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
6b680ca18a
commit
39b2f65434
1 changed files with 8 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue