Infer a reusable JSON Schema from a sample
infer_schemaGiven one sample document's text, propose a reusable JSON Schema for that document type. Use this when no built-in schema_id fits: infer a schema once, review it, then reuse it as schema on parse_document / parse_text across many documents for consistent output. Returns the JSON Schema plus a flat field list and an inferred doc_type. Costs 1 credit per successful call.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"text": "<text>"
},
"name": "infer_schema"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | A single representative sample of the document type, as text. | |
| doc_type | No | Optional hint for what kind of document this is, e.g. "purchase order", "lab report". | |
| instructions | No | Optional guidance on which fields matter or how to shape the schema. |