
{
  "openapi": "3.1.0",
  "info": {
    "title": "Emoji Tools API",
    "description": "API for Emoji Tools features including background removal and QR code generation.",
    "version": "1.1.0"
  },
  "servers": [
    {
      "url": "https://emoji-tools.com"
    }
  ],
  "paths": {
    "/api/mcp/generate-qr": {
      "post": {
        "operationId": "generateQRCode",
        "summary": "Generate a QR Code",
        "description": "Generates a QR Code image from the provided text or URL.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "description": "The text or URL to encode in the QR code."
                  },
                  "options": {
                    "type": "object",
                    "description": "Optional configuration for the QR code.",
                    "properties": {
                      "width": { "type": "number", "default": 500, "description": "Width of the output image in pixels." },
                      "margin": { "type": "number", "default": 4, "description": "Margin around the QR code." },
                      "color": {
                        "type": "object",
                        "properties": {
                          "dark": { "type": "string", "default": "#000000" },
                          "light": { "type": "string", "default": "#ffffff" }
                        }
                      }
                    }
                  }
                },
                "required": ["text"]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean" },
                    "image": { "type": "string", "description": "Base64 Data URL of the generated QR code (PNG)." }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/mcp/remove-bg": {
      "post": {
        "operationId": "removeBackground",
        "summary": "Remove background from an image",
        "description": "Removes the background from a provided image URL or Base64 string using color-based detection.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "image": {
                    "type": "string",
                    "description": "The URL of the image or Base64 data (data:image/...)."
                  },
                  "tolerance": {
                    "type": "number",
                    "description": "Color tolerance (0-100). Default 25.",
                    "default": 25
                  },
                  "keyColor": {
                    "type": "string",
                    "description": "Hex color to remove (e.g. #FFFFFF). Auto-detected if omitted."
                  }
                },
                "required": ["image"]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean" },
                    "processedImage": { "type": "string", "description": "Base64 Data URL of processed PNG" },
                    "width": { "type": "number" },
                    "height": { "type": "number" }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
