feat: add server-side support for tool outputSchema with backward compatibility

- Update McpServer to support registering tools with outputSchema
- Add automatic content generation from structuredContent for backward compatibility
- Add validation to ensure proper usage of structuredContent vs content
- Add comprehensive tests for outputSchema functionality
- Add example servers demonstrating structured output usage
- Update existing test to match new backward compatibility behavior

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Basil Hosmer 2025-05-07 18:51:13 -04:00
commit bb28098d81
No known key found for this signature in database

View file

@ -858,7 +858,8 @@ describe("tool()", () => {
);
expect(result.structuredContent).toBeDefined();
expect(result.content).toBeUndefined(); // Should not have content when structuredContent is used
// For backward compatibility, content is auto-generated from structuredContent
expect(result.content).toBeDefined();
const structuredContent = result.structuredContent as {
processedInput: string;