360 Secure SkillHub
360 安全技能中心

Formatgate

核心功能:支持JSON、YAML、TOML三种格式间6种方向的相互转换,且转换往返安全。典型场景:适用于需将接收的某格式数据转为其他格式的代理场景。使用时需先启动服务,通过POST请求提交待转换内容、输入输出格式,返回包含转换结果、成功状态及错误信息的响应,输入无效时会返回错误提示。

mirni
mirni
热度 40.78
最近更新 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).