text-offsets
Convert text offsets between UTF-16, code points, UTF-8 bytes and graphemes, and locate hidden Unicode — Reports the length of a string in UTF-16 code units, Unicode code points, UTF-8 bytes and extended grapheme clusters (Intl.Segmenter), converts up to 200 ranges given in any one of those units into all four, and flags ranges that fall inside a surrogate pair, a multi-byte UTF-8 character or a grapheme cluster. It also runs the unicode-check rules (bidi controls, zero-width and invisible characters
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"text": "<text>"
},
"name": "text-offsets"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | How the unicode rules treat the string. Default text. | |
| scan | No | Run the hidden-Unicode rules. Default true. | |
| text | Yes | The string. | |
| ranges | No | Half-open ranges to convert; each is read in its own unit. |