JSON Schema → TypeScript
Emit TypeScript types from a JSON Schema — enum/oneOf/allOf/$ref/definitions all handled.
TypeScript
export type Profile = {
name: string;
age?: number;
};
export type User = {
id: number;
email: string;
role?: "admin" | "user" | "guest";
profile?: Profile;
tags?: string[];
createdAt?: string;
};</>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/schema-to-ts/run \
-H "Content-Type: application/json" \
-d '{
"schema": "a"
}'JavaScript (fetch)
const res = await fetch("https://api.b-e-a-d.com/tools/schema-to-ts/run", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"schema": "a"
}),
});
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_schema_to_tsFull reference: developer docs · OpenAPI spec
What we handle
type— string / number / integer / boolean / null / array / objectenum→ literal unionsoneOf/anyOf→ union typesallOf→ intersection types$refwithin the same document (#/definitions/Fooor#/$defs/Foo)required— fields not listed become optional
Not handled
External $refs, patternProperties, and complex validation keywords (format, min/max,pattern) don't affect TypeScript types so they're dropped silently.
You might also like
- CSV ↔ JSON ConverterConvert CSV to JSON or JSON to CSV with quoted fields and configurable delimiters.
- cURL ConverterParse a curl command and emit fetch, Node https, Python requests, Ruby Net::HTTP, Go net/http, PowerShell, HTTPie, and wget equivalents.
- Data Size ConverterConvert between bytes, kilobytes, megabytes, gigabytes, bits, and their binary (KiB, MiB) cousins.
- IP Address ConverterConvert IPv4 between dotted decimal, integer, hex, and binary notations. Compress and expand IPv6.