transform.json_schema
Draft a JSON Schema from a sample object, or validate an instance against a schema, in one call. Call before writes when you need a deterministic schema or a cheap validity check — cheaper and more predictable than asking an LLM to invent types. Inputs: mode=draft|validate|both; sample for draft; schema+instance for validate. Outputs schema and/or validation result. Paid (~2 credits / $0.02) via prepaid key or x402.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | draft | validate | both. Example: draft | |
| draft | No | Legacy boolean alias to request drafting. Example: true | |
| sample | No | Sample value to draft a schema from. Example: {"orderId":"A1","total":12.5} | |
| schema | No | JSON Schema document (required for validate/both). Example: {"type":"object"} | |
| instance | No | Value to validate. Example: {"a":1} |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||