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

Function validate_structured

src/workflow/structured.py:31–37  ·  view source on GitHub ↗

Validate ``obj`` against ``schema``; return ``(ok, error_message)``.

(obj: Any, schema: Mapping[str, Any])

Source from the content-addressed store, hash-verified

29
30
31def validate_structured(obj: Any, schema: Mapping[str, Any]) -> tuple[bool, Optional[str]]:
32 """Validate ``obj`` against ``schema``; return ``(ok, error_message)``."""
33 try:
34 validate_json_schema(obj, schema, root_name="output")
35 return True, None
36 except ToolInputError as exc:
37 return False, str(exc)
38
39
40@dataclass

Calls 1

validate_json_schemaFunction · 0.90