# json-formatter

## 功能

格式化或压缩 JSON 数据。支持 POST 请求体和 GET 参数两种方式。

## 工具定义

### tool: json_format
**description:** 格式化 JSON 字符串为缩进美化格式。
**parameters:**
  - json (string, required): 原始 JSON 字符串

**api endpoint:** `POST https://json.shxai.space`
**api endpoint (GET):** `GET https://json.shxai.space?json=...`

### tool: json_minify
**description:** 压缩 JSON 为一行的最小体积格式。
**parameters:**
  - json (string, required): 原始 JSON 字符串

**api endpoint:** `POST https://json.shxai.space/minify`
**api endpoint (GET):** `GET https://json.shxai.space/minify?json=...`

## 示例

```bash
# 格式化
curl -X POST https://json.shxai.space -d '{"a":1,"b":[2,3]}'

# 压缩
curl "https://json.shxai.space/minify?json=%7B%22a%22%3A1%7D"
```

## 返回格式

```json
{
  "a": 1,
  "b": [
    2,
    3
  ]
}
```

## 鉴权

无需 API Key，直接调用即可。

---
> Skill 版本: 1.0 | 平台: shxai.space | 更新: 2026-08
