Skip to content
BEAD

JSON Sample → Zod Schema

Generate a z.object({...}) schema with inferred TypeScript type from any JSON sample. Detects UUID/email/URL/date formats.

Zod schema
import { z } from "zod";

export const UserSchema = z.object({
  id: z.string().uuid(),
  email: z.string().email(),
  active: z.boolean(),
  createdAt: z.string().datetime(),
  tags: z.array(z.string()),
  profile: z.object({
    name: z.string(),
    age: z.number().int(),
  }),
});

export type User = z.infer<typeof UserSchema>;
</>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-zod/run \
  -H "Content-Type: application/json" \
  -d '{
  "input": "your input here",
  "name": "Root"
}'
JavaScript (fetch)
const res = await fetch("https://api.b-e-a-d.com/tools/json-to-zod/run", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
  "input": "your input here",
  "name": "Root"
}),
});
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_zod

Full reference: developer docs · OpenAPI spec

What you get

A drop-in z.object({…}) schema and an inferred TypeScript type from a JSON sample. Pass an array of objects to widen the schema across multiple shapes.

Format detection

Strings that look like UUIDs, emails, dates, ISO timestamps, or URLs get the matching Zod refinement so validation is meaningful out of the box.

You might also like

Used in these workflows