# Json To Go Struct — REST API endpoint `json-to-go-struct`

Returns Go struct definitions (as source text) generated from a JSON object. Field names become PascalCase, nested objects become their own structs (or inline structs), and json tags with optional omitempty are added.

- Category: data
- 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-go-struct/execute (no API keys, 60 req/min per IP)
- Reference page: https://findutils.com/api/json-to-go-struct/
- Same tool on the other surface: https://findutils.com/mcp/json-to-go-struct/

## Call the endpoint (verified example)

```bash
curl -X POST https://api.findutils.com/api/tools/json-to-go-struct/execute \
  -H "Content-Type: application/json" \
  -d '{
    "json": "{\"user_name\":\"a\",\"age\":3,\"address\":{\"city\":\"x\"}}"
  }'

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

## Input schema

| Argument | Type | Required | Description |
|---|---|---|---|
| `json` | string | yes | A JSON object (text). The top-level value must be an object. |
| `struct_name` | string | no | Name of the top-level struct. Default: "Root". Default: `"Root"`. |
| `add_json_tags` | boolean | no | Add `json:"..."` struct tags. Default: true. Default: `true`. |
| `omit_empty` | boolean | no | Append ",omitempty" to every json tag. Default: false. Default: `false`. |
| `inline_structs` | boolean | no | Emit nested objects as inline anonymous structs instead of named types. Default: false. Default: `false`. |

Example arguments (verified):

```json
{
  "json": "{\"user_name\":\"a\",\"age\":3,\"address\":{\"city\":\"x\"}}"
}
```

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

```json
{
  "user_name": "a",
  "age": 3,
  "address": {
    "city": "x"
  }
}
```

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_go_struct`. Full MCP reference: https://findutils.com/mcp/json-to-go-struct/

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