{
  "name": "encode",
  "group": "crypto",
  "summary": "Convert text between base64, base64url, hex, URL and HTML encodings.",
  "description": "Round-trips a value between encodings in one call. Handles base64url (JWT-style, no padding) and distinguishes full-URI encoding from component encoding, which is the usual cause of double-encoded query strings.",
  "keywords": [
    "base64 decode",
    "base64 encode",
    "url encode",
    "hex",
    "html escape",
    "percent encoding",
    "base64url"
  ],
  "endpoint": "https://fluentedi.com/v1/encode",
  "mcp_name": "encode",
  "makes_network_request": false,
  "parameters": {
    "type": "object",
    "properties": {
      "input": {
        "description": "Value to convert.",
        "type": "string",
        "maxLength": 500000,
        "examples": [
          "hello world"
        ]
      },
      "from": {
        "description": "Encoding of the input.",
        "type": "string",
        "enum": [
          "text",
          "base64",
          "base64url",
          "hex",
          "url",
          "url_component",
          "html"
        ],
        "default": "text"
      },
      "to": {
        "description": "Encoding to produce.",
        "type": "string",
        "enum": [
          "text",
          "base64",
          "base64url",
          "hex",
          "url",
          "url_component",
          "html"
        ],
        "default": "base64"
      }
    },
    "required": [
      "input"
    ],
    "additionalProperties": false
  },
  "examples": [
    {
      "description": "Encode to base64",
      "url": "https://fluentedi.com/v1/encode?input=hello%20world&to=base64",
      "args": {
        "input": "hello world",
        "to": "base64"
      }
    },
    {
      "description": "Decode a base64 string",
      "url": "https://fluentedi.com/v1/encode?input=aGVsbG8gd29ybGQ%3D&from=base64&to=text",
      "args": {
        "input": "aGVsbG8gd29ybGQ=",
        "from": "base64",
        "to": "text"
      }
    },
    {
      "description": "Decode a JWT payload segment",
      "url": "https://fluentedi.com/v1/encode?input=eyJzdWIiOiIxMjMifQ&from=base64url&to=text",
      "args": {
        "input": "eyJzdWIiOiIxMjMifQ",
        "from": "base64url",
        "to": "text"
      }
    },
    {
      "description": "Escape a value for a query string",
      "url": "https://fluentedi.com/v1/encode?input=a%3D1%26b%3Dhello%20world&to=url_component",
      "args": {
        "input": "a=1&b=hello world",
        "to": "url_component"
      }
    }
  ],
  "suggestion": null
}