MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / validate_json_schema

Function validate_json_schema

src/tool_system/schema_validation.py:37–44  ·  view source on GitHub ↗
(value: Any, schema: Mapping[str, Any], *, root_name: str = "input")

Source from the content-addressed store, hash-verified

35
36
37def validate_json_schema(value: Any, schema: Mapping[str, Any], *, root_name: str = "input") -> None:
38 issues: list[ValidationIssue] = []
39 _validate(value, schema, path=root_name, issues=issues)
40 if issues:
41 rendered = "; ".join(f"{i.path}: {i.message}" for i in issues[:5])
42 if len(issues) > 5:
43 rendered += f"; (+{len(issues) - 5} more)"
44 raise ToolInputError(rendered)
45
46
47def _validate(value: Any, schema: Mapping[str, Any], *, path: str, issues: list[ValidationIssue]) -> None:

Callers 3

validate_structuredFunction · 0.90
dispatchMethod · 0.85

Calls 3

_validateFunction · 0.85
ToolInputErrorClass · 0.85
joinMethod · 0.80

Tested by

no test coverage detected