INNER CODE UNIT · Python
_fill_args_from_schema
kevinpbuckley/VibeUE · Content/Python/vibeue.py:144
def _fill_args_from_schema(tool_schema, args):
"""Fill missing params so bare calls work (issue #545): optional params always; required params
when a neutral value is synthesizable (default, enum, object, bool/number/array — the classes
the engine toolsets over-declare as required). Required STRINGS with no default stay caller's
responsibility — but they are reported in ONE error naming all of them, with the full schema,
instead of the engine's one-param-per-attempt loop."""
input_schema = (tool_schema.get("inputSchema") or tool_schema.get("input_schema")
or tool_schema.get("parameters") or {})
input_schema = _parse_schema_entry(input_schema) or {}
properties = input_schema.get("properties") or {}
required = set(input_schema.get("required") or [])
missing_required = []
for name in sorted(required):
if name in args:
continue
prop = _parse_schema_entry(properties.get(name)) or {}
if "default" in prop or prop.get("enum") or prop.get("type") in (