compare_validation_modes
Compare Pydantic validation modes to understand how model, TypeAdapter, strict, and JSON-vs-Python validation handle data differently.
Instructions
Compare model, TypeAdapter, strict, and JSON-vs-Python validation behavior.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | Yes | ||
| data | Yes |
Implementation Reference
- src/pydantic_mcp/tools.py:223-235 (handler)The handler function `compare_validation_modes` which executes the tool by resolving the target and building a validation comparison.
def compare_validation_modes( target: str, data: object, ) -> ToolResponse: """Compare model, TypeAdapter, strict, and JSON-vs-Python validation behavior.""" runtime_target = resolve_target( target, registry=REGISTRY, settings=SERVER_SETTINGS, ) response = build_validation_comparison(runtime_target, data=data) _record_response_errors("compare_validation_modes", target, response) return response