Tools for agents: Unicode text span converter

Convert text spans between UTF-8 bytes, UTF-16 units and Unicode code points, with exact selected text.

Connect with MCP

{
  "mcpServers": {
    "super-agent-tools": {
      "url": "https://app.getsupers.com/sites/agent-text-span/mcp"
    }
  }
}
Streamable HTTP · No API key · Stateless

Use this URL in any client supporting remote Streamable HTTP MCP. Calls return structured JSON; inputs are processed without persistence.

Call convert_text_span

Offsets are zero-based and half-open: start included, end excluded. Empty spans are allowed. UTF-8 counts encoded bytes without a BOM; UTF-16 counts 16-bit units without a BOM. Both endpoints must lie on Unicode scalar boundaries; a split multibyte sequence or surrogate pair is rejected. Returned line and code-point column positions are one-based; only LF starts a new line, so CR in CRLF counts as a character on the preceding line. End position describes the exclusive endpoint. Combining marks remain separate code points: this tool does not segment grapheme clusters or count visual cursor columns. Text is never normalized, trimmed or newline-converted. Unpaired surrogate values are rejected. Useful for translating parser, JavaScript and byte-oriented tool offsets. Input text is processed without persistence.

Input and output schemas
{
  "name": "convert_text_span",
  "title": "Unicode text span converter",
  "description": "Resolve a half-open text span and return equivalent code-point, UTF-8 byte and UTF-16 code-unit offsets plus line/column positions. Reject endpoints inside encoded characters.",
  "inputSchema": {
    "properties": {
      "text": {
        "title": "Text",
        "type": "string"
      },
      "start": {
        "title": "Start",
        "type": "integer"
      },
      "end": {
        "title": "End",
        "type": "integer"
      },
      "unit": {
        "default": "code_points",
        "enum": [
          "code_points",
          "utf8_bytes",
          "utf16_units"
        ],
        "title": "Unit",
        "type": "string"
      }
    },
    "required": [
      "text",
      "start",
      "end"
    ],
    "title": "convert_text_spanArguments",
    "type": "object"
  },
  "outputSchema": {
    "additionalProperties": true,
    "title": "convert_text_spanDictOutput",
    "type": "object"
  },
  "icons": null,
  "annotations": {
    "title": null,
    "readOnlyHint": true,
    "destructiveHint": false,
    "idempotentHint": true,
    "openWorldHint": false
  },
  "meta": null,
  "execution": null
}

Run the example to see the actual result.

HTTP alternative

POST https://app.getsupers.com/sites/agent-text-span/call
Content-Type: application/json

{
  "text": "A\u00e9\ud834\udd1e\nZ",
  "start": 1,
  "end": 4,
  "unit": "utf16_units"
}

The HTTP and MCP interfaces execute the same implementation. Validation errors are returned explicitly. See the tool notes above for its supported inputs and behavior.