# JSON to TOML

`json-to-toml` · version 1.0.0 · YAML, TOML, INI, XML & TSV · free, no key needed

Convert JSON data to a TOML string.

**Use when you need to: json to toml · stringify toml · convert json to toml.**

## Supported

- json to toml
- stringify toml
- convert json to toml

## Not supported

- toml to json
- read files
- write files

## Behavior

- Converts valid JSON structured data into a TOML document.
- Top level must be an object.
- null values are strictly rejected to prevent implicit dropping.

## Input

- `data` (object, required)

## Output

- `toml` (string, required)

## Limits

- max input bytes: 262144
- max depth: 20

## Example

Request input:

```json
{
  "data": {
    "name": "Ada",
    "city": "London"
  }
}
```

Response:

```json
{
  "result": {
    "toml": "name = \"Ada\"\ncity = \"London\"\n"
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "json-to-toml",
  "version": "1.0.0",
  "input": {
    "data": {
      "name": "Ada",
      "city": "London"
    }
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/json-to-toml/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"data":{"name":"Ada","city":"London"}}'
```

The machine-readable contract is at [/v1/tools/json-to-toml/versions/1.0.0](/v1/tools/json-to-toml/versions/1.0.0).

### CLI

```sh
node cli.mjs run json-to-toml 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [JSON to INI](/tools/json-to-ini): Convert JSON data to an INI string.
- [JSON to TSV](/tools/json-to-tsv): Convert a JSON array of objects to a TSV string.
- [JSON to XML](/tools/json-to-xml): Convert JSON data to an XML string.
- [JSON to YAML](/tools/json-to-yaml): Convert JSON data to a YAML string.
- [TOML to JSON](/tools/toml-to-json): Convert a TOML string to a JSON object.
- [INI to JSON](/tools/ini-to-json): Convert an INI string to a JSON object.
