Skip to main content
Glama

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

NameRequiredDescriptionDefault
kindNoHow the unicode rules treat the string. Default text.
scanNoRun the hidden-Unicode rules. Default true.
textYesThe string.
rangesNoHalf-open ranges to convert; each is read in its own unit.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must carry the behavioral burden, and it does disclose useful traits: a 200-range conversion limit, grapheme segmentation via Intl.Segmenter, and that out-of-boundary ranges are flagged rather than silently clipped. However, it says nothing about cost, failure modes, or what a caller receives back (there is no output schema), and the description is truncated exactly where the scanning behavior would be explained.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The content is dense and front-loaded with the core verb, but it is delivered as one sprawling run-on sentence that ends in an unclosed parenthesis and a dangling clause. A reader must parse a triple-nested list to extract the three capabilities, and the unfinished tail undermines trust in the rest.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a four-parameter, no-annotation, no-output-schema tool, the description covers inputs and internal mechanics reasonably well. But with no output schema the description should specify the shape of the reported lengths and range-conversion results, and the truncated scanning clause leaves a whole advertised capability undefined.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all four parameters, their enums and defaults, making 3 the baseline. The description adds only modest meaning beyond that — ranges are 'given in any one of those units' and each is 'read in its own unit', and kind affects how the unicode rules treat the string — but it does not explain how kind's enum values change results or what happens when ranges overlap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names concrete verbs and resources: reports string length in UTF-16 units, code points, UTF-8 bytes and graphemes, converts ranges between those units, and flags ranges landing inside surrogate pairs or grapheme clusters. That is far more specific than the bare name 'text-offsets'. It loses a point because the final clause trails off mid-sentence ('It also runs the unicode-check rules (bidi controls, zero-width and invisible characters'), leaving the scope of the scanning half ambiguous and overlapping with the sibling unicode-check.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no statement of when to reach for this tool versus the sibling unicode-check, which the description explicitly says it duplicates in part, nor versus platform-text-fit or redact-text. The only usage-ish signals are the parameter defaults ('Default text', 'Default true') and the 200-range cap, which describe configuration rather than tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources