360 Secure SkillHub
360 安全技能中心

Formatgate

FormatGate 以本地 HTTP 服务形式提供 JSON、YAML、TOML 之间的六种方向转换,接收内容文本与输入/输出格式标识,返回转换结果或错误信息;需要 Python 运行时并安装 FastAPI、uvicorn、pydantic、pyyaml,通过 curl 调用接口。

mirni
mirni
热度 40.87
最近更新 2026-05-11 17:42:41
分类:效率依赖:代码执行 / 第三方 API应用场景:文件转换 / 数据处理

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add formatgate
Metadata
name
formatgate
description
Convert between JSON, YAML, and TOML formats. All 6 conversion directions supported. Round-trip safe. Useful for agents that receive data in one format and need it in another.
metadata
{"openclaw":{"emoji":"🔄","requires":{"bins":["python"]},"install":[{"id":"pip","kind":"uv","packages":["fastapi","uvicorn","pydantic","pyyaml"]}]}}

FormatGate

Convert data between JSON, YAML, and TOML.

Start the server

uvicorn formatgate.app:app --port 8008

Convert JSON to YAML

curl -s -X POST http://localhost:8008/v1/convert \
  -H "Content-Type: application/json" \
  -d '{"content": "{\"name\": \"Alice\", \"age\": 30}", "input_format": "json", "output_format": "yaml"}' | jq -r '.result'

Convert YAML to JSON

echo "name: Alice" | curl -s -X POST http://localhost:8008/v1/convert \
  -H "Content-Type: application/json" \
  -d "{\"content\": $(cat - | jq -Rs), \"input_format\": \"yaml\", \"output_format\": \"json\"}" | jq -r '.result'

Returns success (true/false), result (converted content), and error (if conversion failed — e.g., invalid input).