{"id":"json-schema-valid-items-filter","version":"1.0.0","description":"Keep only the JSON records that pass (or fail) one Draft 2020-12 subset schema; returns kept records and index lists.","supported_operations":["drop generated records that do not match the json schema","keep only schema valid items from a list of llm outputs","split records into schema passing and failing indexes","return the records that fail a draft 2020-12 schema for regeneration","filter a json array by json schema conformance","סינון רשומות לפי JSON Schema, keep valid"],"unsupported_operations":["error details per record (use json-schema-batch-validate)","repairing records so they pass","pattern, patternProperties, propertyNames, contains, if/then/else, dependent*, unevaluated* keywords","remote or anchor $ref resolution"],"semantics":["Same compiled schema subset as json-schema-batch-validate (identical supported keywords, annotations and unsupported_input refusals); each record is classified with flag evaluation that stops at its first failure.","keep is \"valid\" when omitted. Output {kept_count, dropped_count, kept_indexes, dropped_indexes, items}: items are copies of the kept records in input order (-0 becomes 0, own \"__proto__\" members stay data); both index lists are ascending 0-based positions and together cover every input position exactly once.","Record equality never matters: duplicates are kept or dropped independently by position.","Bounds: input 131072 bytes; 1000 items; the schema and each record nested at most 32 levels (max_value_depth; a scalar is 0, [] or {} is 1); 64 nested subschema applications; 50000 work units for the whole batch (same unit definition as json-schema-batch-validate, where flag evaluation stops at the first failure). Exceeding any is limit_exceeded.","No output cap is declared: kept records are copies of input records and the index lists hold at most 1000 numbers below 1000, so output is at most max_input_bytes + 4200 bytes."],"limits":{"max_input_bytes":131072,"max_items":1000,"max_value_depth":32,"max_evaluation_depth":64,"max_evaluation_work":50000},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["schema","items"],"properties":{"schema":{"description":"JSON Schema 2020-12 document (object or boolean) within the supported subset"},"items":{"type":"array","maxItems":1000,"items":{"description":"One JSON record"}},"keep":{"type":"string","enum":["valid","invalid"]}}},"output_schema":{"type":"object","additionalProperties":false,"required":["kept_count","dropped_count","kept_indexes","dropped_indexes","items"],"properties":{"kept_count":{"type":"integer","minimum":0,"maximum":1000},"dropped_count":{"type":"integer","minimum":0,"maximum":1000},"kept_indexes":{"type":"array","maxItems":1000,"items":{"type":"integer","minimum":0}},"dropped_indexes":{"type":"array","maxItems":1000,"items":{"type":"integer","minimum":0}},"items":{"type":"array","maxItems":1000,"items":{"description":"A kept record"}}}},"examples":[{"input":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","minLength":1}}},"items":[{"name":"Ada"},{"name":""},{"title":"x"},{"name":"Grace"}]},"output":{"kept_count":2,"dropped_count":2,"kept_indexes":[0,3],"dropped_indexes":[1,2],"items":[{"name":"Ada"},{"name":"Grace"}]}},{"input":{"schema":{"type":"integer"},"items":[1,2.5,"x"],"keep":"invalid"},"output":{"kept_count":2,"dropped_count":1,"kept_indexes":[1,2],"dropped_indexes":[0],"items":[2.5,"x"]}}],"execute_url":"/v1/tools/json-schema-valid-items-filter/versions/1.0.0/execute"}