Skip to content
BEAD

JSON Sample → JSON Schema

Infer a Draft 2020-12 JSON Schema from a sample value or array of objects, with auto-detected formats.

JSON Schema (Draft 2020-12)
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer"
    },
    "email": {
      "type": "string",
      "format": "email"
    },
    "active": {
      "type": "boolean"
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "profile": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "age": {
          "type": "integer"
        }
      },
      "required": [
        "age",
        "name"
      ],
      "additionalProperties": false
    },
    "lastLogin": {
      "type": "null"
    }
  },
  "required": [
    "active",
    "email",
    "id",
    "lastLogin",
    "profile",
    "tags"
  ],
  "additionalProperties": false
}
</>Use this tool programmaticallycurl · JavaScript · MCP

Same tool, callable from any HTTP client or from Claude (via MCP). Anonymous: 100 req/day per IP. Sign up for 1,000 req/day.

curl
curl https://api.b-e-a-d.com/tools/json-to-schema/run \
  -H "Content-Type: application/json" \
  -d '{
  "input": "your input here"
}'
JavaScript (fetch)
const res = await fetch("https://api.b-e-a-d.com/tools/json-to-schema/run", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
  "input": "your input here"
}),
});
const data = await res.json();
console.log(data.result);
MCP (Claude Desktop / Claude Code)
# In Claude Desktop / Claude Code, add to your MCP config:
{
  "mcpServers": {
    "bead": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.b-e-a-d.com"]
    }
  }
}

# Then ask Claude to call:
mcp__bead__bead_json_to_schema

Full reference: developer docs · OpenAPI spec

How it infers

Each field gets the narrowest JSON Schema type that fits every observed sample. Arrays of objects merge into a singleitems shape — keys present in some samples but not others are dropped from required. Integers stayinteger until they meet a float, then promote tonumber.

Multiple samples

Pass an array of objects at the top level to widen the schema — very useful for shaping API responses from a handful of fixture payloads.

You might also like

Used in these workflows