- Changed 'type': 'str' to 'type': 'string' for tab_id parameters
- Fixes JSON Schema draft 2020-12 validation error with Claude Code
- Added test case to validate JSON schema correctness
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Enhanced _json_schema_to_python_type to recursively handle array item types
- Arrays with ''items'' schema now properly return list[item_type] instead of plain list
- Supports nested types like list[str], list[float], and list[CustomModel]
- Added comprehensive test for array type inference in test_mcp_array_type_inference
This allows MCP tools with array parameters to have proper type hints and validation,
fixing issues where array parameters were losing their item type information.
Co-authored-by: Nick Sweeting <pirate@users.noreply.github.com>
- Call _configure_mcp_server_logging() at module level before any browser_use imports
- This ensures early log lines during import time are captured and redirected to stderr
- Remove redundant call from BrowserUseServer.__init__() since logging is already configured
Co-authored-by: Nick Sweeting <pirate@users.noreply.github.com>
- Fix test assertion: change assert result.success to assert result.success is not False
- Fix MCP parameter serialization: use model_dump(exclude_none=True) to exclude None values
- Fix pyright type checking errors: add proper type guards and use getattr for dynamic access
Co-authored-by: Nick Sweeting <pirate@users.noreply.github.com>
This fixes the issue where importing MCPClient would disable logging globally.
- Move logging configuration from module-level imports to BrowserUseServer.__init__()
- Add lazy import in __init__.py to avoid importing server module when only client is needed
- Create _configure_mcp_server_logging() function that only runs when server is actually used
- Environment variables now only set when BrowserUseServer is instantiated
Fixes#2449
Co-authored-by: Nick Sweeting <pirate@users.noreply.github.com>
- Add ConfigDict import from pydantic
- Fix default value handling for optional fields with proper type annotations
- Improve nested model creation with error handling and ConfigDict configuration
- Apply same improvements to main parameter model creation
Co-authored-by: Nick Sweeting <pirate@users.noreply.github.com>
- Modified _json_schema_to_python_type to recursively create nested Pydantic models for object types with properties
- Fixed issue where nested object properties were being lost during parameter processing
- Added test_mcp_nested_object_parameters to verify nested objects are properly preserved
- Updated MockMCPServer to include process_trace_update tool with nested object schema
Fixes#2453
Co-authored-by: Nick Sweeting <pirate@users.noreply.github.com>