{
  "name": "qrcode",
  "description": "生成二维码图片。将文本或 URL 编码为二维码图片。",
  "category": "图片工具",
  "ui_url": "/tools/qrcode/",
  "api_url": "/api/qrcode/",
  "method": "POST",
  "parameters": {
    "text": {
      "type": "string",
      "required": true,
      "description": "要编码进二维码的文本或 URL"
    },
    "size": {
      "type": "integer",
      "required": false,
      "default": 300,
      "description": "二维码尺寸（像素），范围 100-800"
    },
    "format": {
      "type": "string",
      "required": false,
      "default": "png",
      "description": "图片格式，支持 png / svg"
    }
  },
  "response": {
    "image": "data:image/png;base64,...（Base64 编码的图片）",
    "format": "png",
    "size": 300,
    "text_length": 12
  },
  "example": {
    "text": "https://clawam.com",
    "size": 300
  },
  "errors": {
    "envelope": {
      "error": "string — 错误描述，与 manifest.protocol.error_envelope.fields.error 一致"
    },
    "by_status": [
      {
        "status": 400,
        "when": "请求体非合法 JSON、缺少必填参数，或 text/size/format 校验失败",
        "example": { "error": "无效的 JSON" }
      },
      {
        "status": 400,
        "when": "text 为空",
        "example": { "error": "text 参数不能为空" }
      },
      {
        "status": 400,
        "when": "text 超过最大长度",
        "example": { "error": "text 长度不能超过 2000" }
      },
      {
        "status": 400,
        "when": "size 超出允许范围",
        "example": { "error": "size 必须在 100-800 之间" }
      },
      {
        "status": 400,
        "when": "format 不支持",
        "example": { "error": "format 仅支持 png / svg" }
      },
      {
        "status": 500,
        "when": "服务端未捕获异常",
        "example": { "error": "服务器内部错误" }
      }
    ]
  }
}
