Schema Inference
Work out the schema of a JSON array or CSV: field types, nulls, uniqueness and completeness, plus minimum, maximum and mean for numbers.
Pay by wallet (x402)
schema-infer Example
Example answer
{
"fields": [
{
"max": 30,
"min": 25,
"mean": 27.5,
"name": "age",
"type": "number",
"unique": true,
"nullable": false,
"sample_values": [
30,
25
],
"completeness_percent": 100
},
{
"name": "city",
"type": "string",
"unique": true,
"nullable": false,
"sample_values": [
"Stockholm",
"Oslo"
],
"completeness_percent": 100
},
{
"name": "name",
"type": "string",
"unique": true,
"nullable": false,
"sample_values": [
"Alice",
"Bob"
],
"completeness_percent": 100
}
],
"total_rows": 2,
"total_fields": 3,
"format_detected": "json"
} Inputs
| Field | Type | Required | What it is |
|---|---|---|---|
data | any | Yes | JSON array or CSV string |
Output fields
How reliably each field appears in a successful answer.
| Field | Type | Appears |
|---|---|---|
fields | array | Always (present in every successful answer) |
total_rows | integer | Always (present in every successful answer) |
total_fields | integer | Always (present in every successful answer) |
format_detected | string | Always (present in every successful answer) |
How to call it
The same tool through each route. MCP clients reach it through Strale’s server at https://api.strale.io/mcp; the call below is what the agent sends.
# Needs an API key. max_price_cents caps what this call may cost.
curl -X POST https://api.strale.io/v1/do \
-H "Authorization: Bearer $STRALE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"capability_slug": "schema-infer",
"inputs": {
"data": [
{
"age": 30,
"city": "Stockholm",
"name": "Alice"
},
{
"age": 25,
"city": "Oslo",
"name": "Bob"
}
]
},
"max_price_cents": 5
}' {
"tool": "strale_execute",
"arguments": {
"slug": "schema-infer",
"inputs": {
"data": [
{
"age": 30,
"city": "Stockholm",
"name": "Alice"
},
{
"age": 25,
"city": "Oslo",
"name": "Bob"
}
]
},
"max_price_cents": 5
}
} import { Strale } from "straleio";
const strale = new Strale({ apiKey: process.env.STRALE_API_KEY! });
const result = await strale.do({
capability_slug: "schema-infer",
inputs: {
"data": [
{
"age": 30,
"city": "Stockholm",
"name": "Alice"
},
{
"age": 25,
"city": "Oslo",
"name": "Bob"
}
]
},
max_price_cents: 5,
}); import os
from straleio import Strale, DoRequest
strale = Strale(api_key=os.environ["STRALE_API_KEY"])
result = strale.do(DoRequest(
capability_slug="schema-infer",
inputs={
"data": [
{
"age": 30,
"city": "Stockholm",
"name": "Alice",
},
{
"age": 25,
"city": "Oslo",
"name": "Bob",
},
],
},
max_price_cents=5,
)) # No account. The first request answers 402 with the price in USDC;
# an x402 client pays it from your wallet and repeats the request.
curl -i -X POST https://api.strale.io/x402/v2/schema-infer \
-H 'Content-Type: application/json' \
-d '{
"data": [
{
"age": 30,
"city": "Stockholm",
"name": "Alice"
},
{
"age": 25,
"city": "Oslo",
"name": "Bob"
}
]
}' Limitations
Samples can omit optional fields and rare types
Infers schema from sample data — optional fields or rare value types may not appear in the inferred schema
What to do instead: Provide a representative sample including edge cases and null values for more accurate schema inference
Related tools
- Address Parser €0.05
- Company Industry Classification €0.05
- Company Name Match €0.02
- Credit Score Band €0.02
- CSV Cleaner €0.02
- CSV to JSON €0.02