# JSON to Types

> Convert JSON samples into TypeScript interfaces and Zod schemas, with inference caveats.

- name: com.gumballtools/json-to-types
- version: 0.1.0
- connection class: R0 (autonomous)
- trust: 89/100 flags: duplicate-repo
- quality: 86/100 (good)
- owner: not claimed
- descriptor: https://api.protogrid.dev/v1/servers/com.gumballtools%2Fjson-to-types
- tools: https://api.protogrid.dev/v1/servers/com.gumballtools%2Fjson-to-types/tools

**An agent can connect right now, no human step.** Remote endpoint, no authentication, reachable on the last probe.

## Connection (mcpServers)

```json
{
  "mcpServers": {
    "json-to-types": {
      "type": "http",
      "url": "https://json-to-types.gumballtools.com/api/mcp"
    }
  }
}
```


## Trust

- hygiene: 80
- liveness: 100
- freshness: 85
- provenance: 85
- drivers: +repository +dns-namespace +website +reachable +uptime-100% ~updated-44d-ago -duplicate-repo(16 names)
- Derived from observable signals (official registry feed and our own credential-free probes); no code audit performed.

## Quality 86/100 (good)

### protocol: 88 (weight 25)

- pass `protocol.modern`: supports 2026-07-28 (server/discover)
- pass `protocol.stateless`: answers without a session
- pass `protocol.transport`: streamable HTTP
- warn `protocol.list_ttl`: tools/list declares ttlMs 0, so clients re-fetch it on every use

### authorization: n/a (weight 15)

- n/a `auth.prm`, `auth.as_metadata`, `auth.cimd`: no remote uses OAuth
- n/a `auth.secret_in_url`: no templated URL

### tool hygiene: 79 (weight 30)

- pass `tools.descriptions`: every tool has a description
- warn `tools.description_length`: 1 tools have descriptions over 1,024 characters, which crowds the context
- pass `tools.schemas`: every tool has an object input schema
- pass `tools.annotations`: 1 of 1 tools declare readOnlyHint or destructiveHint
- fail `tools.directory_hints`: no tool declares all four of readOnlyHint, destructiveHint, idempotentHint and openWorldHint; missing: json_to_types (destructiveHint, idempotentHint)
- pass `tools.token_cost`: about 501 tokens to load every tool
- pass `tools.api_dump`: tools are not a one-to-one API dump

### stability: 100 (weight 15)

- pass `stability.changes`: no tool changes in 30 days
- pass `stability.rug_pull`: no tool changed its meaning under the same name

### dependencies: n/a (weight 15)

- n/a `deps.known_vulns`, `deps.mcp_sdk_version`, `deps.resolvable`: no npm or PyPI package

- tools: 1, about 501 tokens to load them all
- tool set hash: dc9c5209b819a5bf594c52bed438c191
- badge: [![protogrid quality](https://protogrid.dev/badge/com.gumballtools/json-to-types.svg)](https://protogrid.dev/servers/com.gumballtools/json-to-types)
- Checks run on what our credential-free, read-only probes observe; tools are never called and no code audit is performed.

### Tool changes

_No tool definition changes recorded._

## Remotes

- https://json-to-types.gumballtools.com/api/mcp (streamable-http, auth none, reachable true, uptime30d 1)

## Packages

_none_

## Tools (1)

- `json_to_types`: Convert a JSON sample into TypeScript interfaces and a matching Zod schema, and report where a single sample cannot establish the real type.

Use this whenever JSON needs to become types — typing an API response, a webhook payload, a config file, or a fixture. Prefer it over writing the types directly, because three mistakes are easy to make and invisible once made:

1. ARRAYS. Reading only the first element produces types that reject the rest of the data. This merges every element into a union.
2. NULL VS ABSENT. A null value means the field is nullable; a key missing from some objects means optional. Different types, routinely conflated.
3. EMPTY CONTAINERS. Nothing can be inferred from [] or {}. This emits unknown and says so instead of inventing a plausible shape.

It is also far cheaper in output tokens than generating types inline for a large payload, and the result is deterministic.

Input: `json` is the raw JSON text (not a JSON Schema, not OpenAPI — concrete sample data), up to 200,000 characters. `rootName` optionally names the top-level interface and defaults to "Root".

Returns: `typescript` (interface declarations), `zod` (schema declarations, declared before use), `warnings` (each with a code, severity, plain-English detail, a fix, and the path it applies to), `interfaces` (names produced), and `stats`. Read the warnings before trusting the output — they are the part a model generating types inline cannot give you.
