# Json To Zod Schema — REST API endpoint `json-to-zod-schema`

Generate a Zod validation schema (TypeScript source) from a JSON sample. Detects email, URL, UUID, and ISO date strings, marks integers with .int(), and emits the z.infer type.

- Category: seo
- MCP server: https://mcp.findutils.com/ (Streamable HTTP, no API keys, 120 req/min per IP)
- REST endpoint: POST https://api.findutils.com/api/tools/json-to-zod-schema/execute (no API keys, 60 req/min per IP)
- Reference page: https://findutils.com/api/json-to-zod-schema/
- Same tool on the other surface: https://findutils.com/mcp/json-to-zod-schema/

## Call the endpoint (verified example)

```bash
curl -X POST https://api.findutils.com/api/tools/json-to-zod-schema/execute \
  -H "Content-Type: application/json" \
  -d '{
    "json": "{\"id\":1,\"email\":\"a@b.co\"}"
  }'

# Parameter schema
curl https://api.findutils.com/api/tools/json-to-zod-schema
```

## Input schema

| Argument | Type | Required | Description |
|---|---|---|---|
| `json` | string | yes | JSON sample to convert. |
| `add_comments` | boolean | no | Append a short comment after detected formats (e.g. "// email format"). Default: true. Default: `true`. |
| `use_optional` | boolean | no | Append .optional() to every object property. Default: false. Default: `false`. |
| `export_type` | string (const \| named \| default) | no | How the schema is exported: "const" (no export), "named" (export const), or "default" (export default). Default: "const". Default: `"const"`. |

Example arguments (verified):

```json
{
  "json": "{\"id\":1,\"email\":\"a@b.co\"}"
}
```

Decoded `json` argument (readability only — send it as a string):

```json
{
  "id": 1,
  "email": "a@b.co"
}
```

OpenAPI 3.1 spec: https://findutils.com/api/openapi.json · Interactive docs: https://findutils.com/api/docs/

## Also an MCP tool

```bash
claude mcp add findutils --transport http https://mcp.findutils.com/
```

Then ask the client to call `findutils:json_to_zod_schema`. Full MCP reference: https://findutils.com/mcp/json-to-zod-schema/

---
Full catalog: GET https://api.findutils.com/api/tools · https://findutils.com/api/ · https://findutils.com/llms.txt
