{
  "schemaVersion": "1.0.0",
  "id": "compress",
  "name": "Compress",
  "category": "Media Compressor",
  "status": "operational",
  "description": "Shrink heavy videos, photos, and PDFs by up to 85% in seconds without losing visual quality. Fast, sharp, and easy to use.",
  "runtime": "client-edge",
  "capabilities": [
    "Pre-baked platform optimization presets (WhatsApp, Gmail, Discord, Twitter/X, Instagram, Web Hero)",
    "Perceptual rate-distortion optimization (CRF & bitrate calculation)",
    "Audio bitrate, sample rate, and ITU-R BS.1770 LUFS loudness normalization",
    "PDF downsampling and grayscale compaction recipes for resumes and email limits",
    "In-worker lossless SVG optimization and attribute cleaning",
    "Deterministic WebCodecs / WebAssembly client-side execution recipes"
  ],
  "endpoints": [
    {
      "method": "POST",
      "path": "/v1/inspect",
      "summary": "Inspect media container codecs, streams, and bitrate profiles",
      "url": "https://api.xicae.dev/compress/v1/inspect"
    },
    {
      "method": "POST",
      "path": "/v1/transcode-plan",
      "summary": "Calculate optimal CRF, resolution scale, and bitrate for target file size",
      "url": "https://api.xicae.dev/compress/v1/transcode-plan"
    },
    {
      "method": "POST",
      "path": "/v1/pdf-plan",
      "summary": "Determine PDF image downsampling and stream compression recipe",
      "url": "https://api.xicae.dev/compress/v1/pdf-plan"
    },
    {
      "method": "POST",
      "path": "/v1/audio-plan",
      "summary": "Audio loudness normalization and bitrate target calculation",
      "url": "https://api.xicae.dev/compress/v1/audio-plan"
    }
  ],
  "mcp": {
    "url": "https://xicae.dev/compress/mcp",
    "tools": [
      {
        "name": "compress_calculate_optimization_target",
        "description": "Calculate mathematical compression parameters (CRF, bitrate, scale factor, and ready-to-run FFmpeg CLI string) to shrink media files to strict platform limits with zero guesswork.",
        "parameters": {
          "type": "object",
          "properties": {
            "preset": {
              "type": "string",
              "enum": [
                "whatsapp_video",
                "whatsapp_status",
                "gmail_attachment",
                "discord_free",
                "twitter_x",
                "instagram_story",
                "web_hero_background",
                "job_portal_resume_pdf",
                "email_pdf_5mb",
                "passport_photo_50kb",
                "custom"
              ],
              "description": "Pre-baked target profile preset (auto-configures size caps, resolutions, and codecs)"
            },
            "current_size_mb": {
              "type": "number",
              "description": "Current asset size in megabytes (optional)"
            },
            "target_max_size_mb": {
              "type": "number",
              "description": "Maximum allowable file size in megabytes (auto-filled by preset)"
            },
            "source_resolution": {
              "type": "string",
              "description": "Source resolution (e.g. 1920x1080, 3840x2160)"
            },
            "duration_seconds": {
              "type": "number",
              "description": "Duration in seconds for video"
            }
          },
          "required": [
            "preset"
          ]
        }
      },
      {
        "name": "compress_calculate_audio_target",
        "description": "Calculate optimal audio encoding bitrates, sample rates (Hz), channels, and ITU-R BS.1770 LUFS loudness normalization for speech, podcasts, music, and Whisper AI transcription.",
        "parameters": {
          "type": "object",
          "properties": {
            "preset": {
              "type": "string",
              "enum": [
                "voice_speech_podcast",
                "music_high_fidelity",
                "whisper_ai_transcription",
                "whatsapp_voice_note",
                "telephony_ivr"
              ],
              "description": "Audio content profile preset"
            },
            "duration_seconds": {
              "type": "number",
              "description": "Audio duration in seconds"
            },
            "target_format": {
              "type": "string",
              "enum": [
                "opus",
                "aac",
                "mp3"
              ],
              "description": "Target audio codec"
            }
          },
          "required": [
            "preset"
          ]
        }
      },
      {
        "name": "compress_pdf_downsample_plan",
        "description": "Calculate image downsampling, color space reduction, and font stripping plans to compress bloated PDF documents to strictly enforced thresholds (e.g. 2MB job resumes, 5MB emails).",
        "parameters": {
          "type": "object",
          "properties": {
            "preset": {
              "type": "string",
              "enum": [
                "job_application_resume_2mb",
                "email_attachment_5mb",
                "legal_archival_300dpi",
                "ultra_compact_screen_72dpi"
              ],
              "description": "PDF compaction profile"
            },
            "current_size_mb": {
              "type": "number",
              "description": "Current PDF size in megabytes"
            },
            "convert_to_grayscale": {
              "type": "boolean",
              "description": "Whether to convert color illustrations to monochrome grayscale"
            }
          },
          "required": [
            "preset"
          ]
        }
      },
      {
        "name": "compress_optimize_svg",
        "description": "Losslessly minify and sanitize raw SVG vector text on the edge worker, stripping XML bloat, doctypes, and editor metadata.",
        "parameters": {
          "type": "object",
          "properties": {
            "svg_content": {
              "type": "string",
              "description": "Raw SVG XML string to optimize"
            }
          },
          "required": [
            "svg_content"
          ]
        }
      },
      {
        "name": "compress_inspect_media_container",
        "description": "Inspect audio, video, or image container metadata to detect codecs, stream bitrates, sample rates, and browser/platform compatibility.",
        "parameters": {
          "type": "object",
          "properties": {
            "file_name": {
              "type": "string",
              "description": "Name of the media file"
            },
            "mime_type": {
              "type": "string",
              "description": "MIME type of the asset (e.g. video/mp4, image/heic)"
            },
            "file_size_bytes": {
              "type": "number",
              "description": "Total byte length of the file"
            }
          },
          "required": [
            "file_name",
            "mime_type",
            "file_size_bytes"
          ]
        }
      },
      {
        "name": "compress_generate_wasm_pipeline",
        "description": "Generate client-executable WebCodecs / FFmpeg.wasm pipeline instructions for zero-server in-browser or local agent processing.",
        "parameters": {
          "type": "object",
          "properties": {
            "input_codec": {
              "type": "string",
              "description": "Input container codec"
            },
            "target_codec": {
              "type": "string",
              "enum": [
                "av1",
                "h264",
                "webp",
                "avif",
                "opus",
                "mp3"
              ],
              "description": "Desired target codec"
            },
            "strip_exif_metadata": {
              "type": "boolean",
              "description": "Whether to strip GPS and camera hardware tags"
            }
          },
          "required": [
            "input_codec",
            "target_codec"
          ]
        }
      },
      {
        "name": "compress_get_optimization_recipe",
        "description": "Generate an optimal client-side FFmpeg or WebAssembly compression recipe, calculating exact CRF, video bitrates, and container-safe flags without burning server compute.",
        "parameters": {
          "type": "object",
          "properties": {
            "media_type": {
              "type": "string",
              "enum": [
                "video",
                "audio",
                "image"
              ],
              "description": "Input media type"
            },
            "input_format": {
              "type": "string",
              "description": "Source file format extension"
            },
            "output_format": {
              "type": "string",
              "description": "Target file format extension"
            },
            "duration_seconds": {
              "type": "number",
              "description": "Media duration in seconds"
            },
            "target_size_mb": {
              "type": "number",
              "description": "Target output file size in megabytes"
            },
            "resolution_preset": {
              "type": "string",
              "enum": [
                "1080p",
                "720p",
                "480p",
                "50pct",
                "original"
              ],
              "description": "Resolution scale preset"
            },
            "crf_preset": {
              "type": "number",
              "description": "Constant Rate Factor (16 to 36)"
            },
            "mute_audio": {
              "type": "boolean",
              "description": "Whether to discard audio stream"
            },
            "normalize_audio": {
              "type": "boolean",
              "description": "Whether to apply loudness normalization"
            }
          },
          "required": [
            "media_type",
            "input_format",
            "output_format"
          ]
        }
      }
    ]
  },
  "rateLimit": {
    "requestsPerMinute": 60,
    "quotaReset": "sliding-window"
  },
  "documentation": "https://xicae.dev/llms.txt"
}