Skip to main content
Glama

Create word alignment diagram

create_word_alignment
Read-onlyIdempotent

Create a shareable Word Aligner diagram that shows which words match across two or more stacked lines of text (a translation and its source, an interlinear gloss, IPA, etc.). Returns a URL that opens the interactive diagram, plus a preview image.

Use this when the user wants to translate a phrase and show word correspondences, align a translation with its source (including RTL scripts like Hebrew or Arabic, or vertically written ones like Japanese and Mongolian), or build a Leipzig-style interlinear gloss.

Word indices are 0-based token positions. Tokenize each line the same way the tool does before assigning indices:

  • Whitespace always splits ("I have been going" -> I[0] have[1] been[2] going[3]).

  • The characters in settings.tokenSplitChars (default ".-|") also split and are then removed from the rendered text, so "go.PST.IPFV" becomes three tokens (go, PST, IPFV) and the dots disappear. For Leipzig glosses set tokenSplitChars to "-|" to keep the dots.

  • Punctuation stays attached by default ("Hello, world!" -> Hello,[0] world![1]).

  • In RTL lines, word 0 is the logically first word (rightmost on screen); index in reading order.

  • Japanese and Chinese are written without spaces and nothing is segmented for you: put spaces where the alignment units should be.

For a vertically written script set settings.axis to "columns". Every line then becomes a vertical column and the connectors run sideways. Set orientation per line: "vertical" stacks the characters (Japanese, Chinese), "sideways" rotates the line a quarter turn (traditional Mongolian, and Latin runs inside vertical text), "upright" leaves a translation as horizontal word boxes. The first line is the leftmost column, so for Japanese and Chinese, whose columns read right to left, list the translation first and the script second.

Each alignment is [lineA, wordA, lineB, wordB]; the two lines must be neighbours in the stack (|lineA - lineB| = 1), which means one above the other in rows and side by side in columns. To express many-to-one, list each target word as its own tuple. Tokens that share a connection group get the same color automatically.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
linesYesText lines, top to bottom. Each entry is a plain string or an object with per-line visual options.
pairsNoPer-pair controls for a specific adjacent line pair.
settingsNoGlobal visual overrides. Unset fields inherit defaults.
alignmentsNoWord-alignment links as [lineA, wordA, lineB, wordB] (0-based indices, lines must be adjacent).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe shareable diagram URL. Return this to the user exactly as received, character for character.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed2 schema fields changed
    • changedInput schema / properties / lines / items / oneOf
      Previous value: -[
      -  {
      -    "description": "Plain line text (shorthand).",
      -    "type": "string"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "font": {
      -        "description": "Google Fonts family name (e.g. \"Noto Sans Hebrew\"). Defaults to Inter.",
      -        "type": "string"
      -      },
      -      "gapPx": {
      -        "description": "Horizontal gap between word tokens in px. Default 14.",
      -        "maximum": 56,
      -        "minimum": 0,
      -        "type": "integer"
      -      },
      -      "rtl": {
      -        "description": "Right-to-left layout (Hebrew, Arabic, ...). Default false.",
      -        "type": "boolean"
      -      },
      -      "sizePx": {
      -        "description": "Text size in px. Default 36.",
      -        "maximum": 64,
      -        "minimum": 12,
      -        "type": "integer"
      -      },
      -      "text": {
      -        "description": "Line text.",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "text"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "description": "Plain line text (shorthand).",
      +    "type": "string"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "font": {
      +        "description": "Google Fonts family name (e.g. \"Noto Sans Hebrew\"). Defaults to Inter.",
      +        "type": "string"
      +      },
      +      "gapPx": {
      +        "description": "Horizontal gap between word tokens in px. Default 14.",
      +        "maximum": 56,
      +        "minimum": 0,
      +        "type": "integer"
      +      },
      +      "orientation": {
      +        "description": "How this line's glyphs are set, visible with settings.axis \"columns\". \"vertical\" stacks characters (Japanese, Chinese), \"sideways\" rotates the line (Mongolian). Default \"upright\".",
      +        "enum": [
      +          "upright",
      +          "vertical",
      +          "sideways"
      +        ],
      +        "type": "string"
      +      },
      +      "rtl": {
      +        "description": "Right-to-left layout (Hebrew, Arabic, ...). Default false.",
      +        "type": "boolean"
      +      },
      +      "sizePx": {
      +        "description": "Text size in px. Default 36.",
      +        "maximum": 64,
      +        "minimum": 12,
      +        "type": "integer"
      +      },
      +      "text": {
      +        "description": "Line text.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "text"
      +    ],
      +    "type": "object"
      +  }
      +]
    • addedInput schema / properties / settings / properties / axis
      Added value: +{
      +  "description": "Flow direction of the diagram. \"rows\" (default) stacks lines downward with vertical connectors. \"columns\" stands each line up as a vertical column with sideways connectors, for Japanese, Chinese, and Mongolian; the first line is the leftmost column.",
      +  "enum": [
      +    "rows",
      +    "columns"
      +  ],
      +  "type": "string"
      +}
  2. Changed1 schema field changed
    • changedInput schema / properties / settings / properties / palette / enum
      Previous value: -[
      -  "pastel",
      -  "vivid",
      -  "academic"
      -]New value: +[
      +  "pastel",
      +  "vivid"
      +]
  3. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, so the safety profile is already covered. The description adds substantial behavioral context beyond that: it explains tokenization rules (whitespace, tokenSplitChars, punctuation attachment), RTL indexing, vertical script orientation, and the adjacency constraint on alignments. It also discloses that tokens sharing a connection group get the same color automatically. This is rich behavioral detail that goes well beyond the annotations, though it doesn't explicitly state that the tool is non-mutating (but annotations already do).

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

Conciseness4/5

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

The description is long but densely packed with necessary operational detail. It is front-loaded with the core purpose and output, then proceeds logically through tokenization, RTL, vertical scripts, and alignment semantics. Every sentence earns its place; there is no fluff. However, it is quite lengthy and could arguably be trimmed in places (e.g., the vertical script paragraph is dense), but given the complexity of the tool, the length is justified. It loses one point for being at the upper limit of acceptable length.

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

Completeness5/5

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

Given the tool's complexity (4 parameters, nested objects, 100% schema coverage, output schema present), the description is remarkably complete. It covers tokenization rules, RTL and vertical script handling, alignment constraints, and even provides examples. The output schema exists, so return values are covered. The only minor gap is that it doesn't explicitly state the maximum number of lines (8) or the alignment count limits, but those are in the schema. For an agent to call this tool correctly, everything essential is present.

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

Parameters4/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 every parameter. The description adds significant semantic value beyond the schema: it explains the tokenization algorithm in detail (how tokenSplitChars works, punctuation attachment, RTL indexing), the meaning of alignment tuples and the adjacency requirement, and the orientation semantics for vertical scripts. It also gives practical examples ('go.PST.IPFV' becomes three tokens). This goes well beyond the baseline 3 for full coverage, though it doesn't exhaustively map every setting (e.g., tokenMergeChar is only mentioned in the schema).

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

Purpose5/5

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

The description opens with a specific verb and resource ('Create a shareable Word Aligner diagram') and immediately clarifies the domain (word matching across stacked lines) and the output (URL plus preview image). It distinguishes itself from generic diagram tools by naming concrete use cases (translation alignment, interlinear gloss, RTL scripts, vertical scripts). No sibling tools exist, so differentiation is moot, but the purpose is unmistakable.

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

Usage Guidelines5/5

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

The description gives explicit when-to-use guidance: 'Use this when the user wants to translate a phrase and show word correspondences, align a translation with its source... or build a Leipzig-style interlinear gloss.' It also provides detailed how-to instructions for tokenization, RTL handling, vertical scripts, and alignment tuple semantics. While it doesn't name alternatives (no siblings), it fully specifies the conditions for use and the operational rules, which is more than adequate.

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.

TDQS

A4.5/5.0
Disambiguation5/5

There is only one tool, so there is no possibility of confusing it with another tool. Its purpose is further clarified by the detailed description of when and how to use it.

Naming Consistency5/5

The sole tool uses a clear snake_case verb_noun pattern: create_word_alignment. Although there are no other names to compare against, the name is predictable and matches common MCP naming conventions.

Tool Count3/5

The server is essentially a single-purpose generator, and the existing tool is rich enough to handle many advanced cases. Still, with only one tool, the server feels thin and lacks supporting operations such as listing or managing previously created alignments.

Completeness4/5

The creation workflow is well covered, including tokenization, RTL scripts, vertical text, and multiple alignment styles. The main gap is post-creation lifecycle support such as updating or deleting shared alignment diagrams, though those are not central to the tool's stated purpose.