Extract JSON from text
extract_jsonUse this when you need to turn unstructured text (emails, invoices, receipts, job posts, listings, bios, support tickets, chat logs) into JSON matching a schema. Send the text plus a JSON Schema or a list of field names; get back data that validates against it. Missing values come back as null, never invented. Charged only on success. Price: $0.002 USDC per call (x402, eip155:8453); the first call returns payment requirements, then retry with an x402 payment in _meta["x402/payment"]. Not charged if extraction fails.
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"text": "Hi team, I'm Dana Ortiz, VP of Ops at Lumen Freight. Can we move Thursday's demo to Friday Nov 27 at 2pm ET? Reach me at dana@lumenfreight.com or (617) 555-0142.",
"fields": [
"name",
"title",
"company",
"email",
"phone",
"requested_meeting_time"
]
},
"name": "extract_json"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The unstructured text to extract from (max 8000 characters). | |
| fields | No | Shortcut instead of a schema: field names, optionally typed as name:type where type is string, number, integer, boolean, date, string[], number[] or object[] (e.g. ["name", "email", "total:number", "skills:string[]"]). | |
| schema | No | A JSON Schema (type: object, with properties) describing the JSON you want back. Supports type, properties, required, items, enum, description. Provide this OR fields. | |
| instructions | No | Optional extra guidance, e.g. 'dates as YYYY-MM-DD', 'amounts in USD'. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | The extracted JSON. Validates against your schema; values not found in the text are null. | |
| note | No | ||
| model | Yes | ||
| missing | No | Paths of requested fields that were not found in the text (returned as null). | |
| warnings | Yes |