Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: modelcontextprotocol/typescript-sdk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: modelcontextprotocol/typescript-sdk
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: basil/output_schema
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 4 commits
  • 16 files changed
  • 2 contributors

Commits on May 5, 2025

  1. Add support for outputSchema and optional content fields in tools

    - Add outputSchema field to Tool type and RegisteredTool interface
    - Make content field optional in CallToolResult
    - Update ListToolsRequestSchema handler to include outputSchema in tool list responses
    - Add support for structuredContent in tool results
    - Update examples to handle optional content field
    - Add tests for new outputSchema and structuredContent functionality
    - Update ToolCallback documentation to clarify when to use structuredContent vs content
    
    This change enables tools to define structured output schemas and return
    structured JSON content, providing better type safety and validation for
    tool outputs.
    
    🤖 Generated with [Claude Code](https://claude.ai/code)
    
    Co-Authored-By: Claude <noreply@anthropic.com>
    bhosmer-ant and Claude committed May 5, 2025
    Configuration menu
    Copy the full SHA
    a95df72 View commit details
    Browse the repository at this point in the history

Commits on May 6, 2025

  1. Add client-side validation for tool output schemas

    - Cache tool output schemas when listing tools
    - Validate structuredContent against outputSchema during callTool
    - Enforce that tools with outputSchema must return structuredContent
    - Add json-schema-to-zod dependency for schema conversion
    - Add comprehensive tests for validation scenarios
    
    🤖 Generated with [Claude Code](https://claude.ai/code)
    
    Co-Authored-By: Claude <noreply@anthropic.com>
    bhosmer-ant and Claude committed May 6, 2025
    Configuration menu
    Copy the full SHA
    bdefb9b View commit details
    Browse the repository at this point in the history
  2. feat: update TypeScript SDK to implement draft spec changes for struc…

    …tured tool output
    
    - Add outputSchema support to Tool interface with proper documentation
    - Split CallToolResult into structured and unstructured variants
    - Change structuredContent from string to object type
    - Add validation that tools without outputSchema cannot return structuredContent
    - Add validation that tools with outputSchema must return structuredContent
    - Update client to validate structured content as object (no JSON parsing)
    - Update tests to use object format for structuredContent
    - Add tests for new validation constraints
    - Update LATEST_PROTOCOL_VERSION to DRAFT-2025-v2
    
    🤖 Generated with [Claude Code](https://claude.ai/code)
    
    Co-Authored-By: Claude <noreply@anthropic.com>
    bhosmer-ant and Claude committed May 6, 2025
    Configuration menu
    Copy the full SHA
    f33eb09 View commit details
    Browse the repository at this point in the history

Commits on May 8, 2025

  1. feat: add server-side support for tool outputSchema with backward com…

    …patibility
    
    - 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>
    bhosmer-ant and Claude committed May 8, 2025
    Configuration menu
    Copy the full SHA
    3a83e40 View commit details
    Browse the repository at this point in the history
Loading