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: grll/mcpadapt
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.1.9
Choose a base ref
...
head repository: grll/mcpadapt
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.1.10
Choose a head ref
  • 3 commits
  • 7 files changed
  • 4 contributors

Commits on Jun 1, 2025

  1. fix: Add support for list-type JSON Schema fields in modeling.py (#37)

    * fix: Add support for list-type JSON Schema fields in modeling.py
    
    Problem:
    - JSON Schema allows specifying multiple types using array notation: {"type": ["string", "number"]}
    - This is valid per JSON Schema specification, and common in real-world schemas
    - The mcpadapt modeling.py module failed with "unhashable type: 'list'" when processing such schemas
    - Error occurs in get_field_type() when attempting to use a list as a dictionary key
    
    Solution:
    - Enhanced get_field_type() to properly handle list-type JSON Schema types
    - Added special case to detect when json_type is a list
    - Implemented conversion of list-type to Python Union types
    - For single-item lists, extract and use the single type
    - For multi-item lists, create a Union of all mapped types
    - Preserves original behavior for all other schema types
    
    This fix ensures compatibility with JSON Schema that use the array notation for
    specifying multiple allowed types for a field, which is a common pattern in the
    JSON Schema ecosystem. The fix is backwards compatible and follows the expected
    behavior of properly converting JSON Schema types to their Python equivalents.
    
    * test: Add dedicated test for JSON Schema list-type handling
    
    This commit adds a comprehensive test suite for validating the fix for JSON Schema
    array notation in type fields (e.g., "type": ["string", "number"]).
    
    Key additions:
    - New test file tests/test_modeling.py with multiple test scenarios:
      - Direct test against modeling.py to verify handling of list-type JSON Schema fields
      - Tests for array-type fields with multiple primitive types
      - Specific tests for handling of null types in array notation
      - Inspection utility to examine actual schema structure in MCP tools
    
    The tests are designed to:
    1. Verify the fix works correctly for all edge cases
    2. Provide clear diagnostics when the bug is present
    3. Demonstrate proper handling of various JSON Schema type patterns
    4. Ensure consistent behavior with the existing anyOf implementation
    
    The test handles both the "happy path" (with fix) and failure path (without fix),
    making it valuable for preventing regressions. It also improves null type handling
    to be consistent with how the codebase already handles nulls in anyOf constructs.
    
    This testing approach validates that our implementation correctly supports the
    JSON Schema specification, which allows multiple types to be specified either
    via array notation or anyOf constructs.
    
    * fix: Address PR #37 review feedback on JSON Schema list-type handling
    
    - Extended JSON Schema array notation fix to langchain_adapter.py
    - Added support for both array notation ("type": ["string", "number"])
      and anyOf structures in LangChain adapter
    - Reorganized tests per reviewer feedback:
      * Moved simplified direct test to tests/utils/test_modeling.py
      * Added E2E test to test_langchain_adapter.py
      * Removed redundant test file
    
    This commit ensures consistent handling of JSON Schema list-type fields
    across all adapters and addresses all feedback from the PR review.
    
    ---------
    
    Co-authored-by: Sakthi Kannan <[email protected]>
    sakthikannan25 and Sakthi Kannan authored Jun 1, 2025
    Configuration menu
    Copy the full SHA
    8b914ac View commit details
    Browse the repository at this point in the history

Commits on Jun 14, 2025

  1. Pass client_session_timeout through from MCPAdapt (#51)

    * Pass client_session_timeout through from MCPAdapt
    
    Follow up from #35
    
    * Add tests for timeout parameters
    
    - Add test for connect_timeout that verifies TimeoutError is raised when server starts slowly
    - Add test for client_session_timeout_seconds parameter propagation and storage
    - Tests run quickly using 1-2 second timeouts for fast execution
    
    * ruff format
    
    ---------
    
    Co-authored-by: Guillaume Raille <[email protected]>
    njbrake and grll authored Jun 14, 2025
    Configuration menu
    Copy the full SHA
    bfd000f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f7feea7 View commit details
    Browse the repository at this point in the history
Loading