Skip to main content
Glama

Word Aligner MCP

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.

TDQS

A4.6/5.0
Behavior4/5

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

The description goes beyond the annotations by explaining tokenization behavior (whitespace splitting, tokenSplitChars, punctuation attachment), RTL indexing, and vertical script handling. It also clarifies that alignments must be between adjacent lines and how many-to-one mappings work. However, it doesn't mention any potential side effects or limitations beyond what's already implied by the readOnlyHint and idempotentHint annotations, which are already present.

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 well-structured with clear sections for tokenization rules, vertical script handling, and alignment format. It is detailed but not overly verbose, and each sentence adds necessary information. The only minor issue is that it could be slightly more concise, but the complexity of the tool justifies the 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, output schema), the description is remarkably complete. It covers tokenization, RTL, vertical scripts, alignment constraints, and output format. The output schema is present, so the description doesn't need to explain return values, but it does mention the URL and preview image. The description fully equips the agent to use the tool correctly.

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?

The schema already has 100% coverage with detailed descriptions for all parameters. The description adds value by explaining the tokenization rules that affect how 'lines' and 'alignments' should be constructed, and provides examples of how to set tokenSplitChars for Leipzig glosses. It also clarifies the meaning of 'orientation' and 'axis' in the context of vertical scripts, which complements the schema descriptions.

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 clearly states the tool creates a shareable Word Aligner diagram showing word matches across stacked lines, and returns a URL plus preview image. It distinguishes itself from any potential sibling by specifying the exact use case (translation alignment, interlinear glosses, RTL scripts) and the output format.

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 explicitly explains when to use this tool: for translating phrases with word correspondences, aligning translations with sources, building Leipzig-style glosses, and handling RTL or vertical scripts. It also provides detailed guidance on tokenization rules and how to set up lines for different scripts, which helps the agent decide when this tool is appropriate.

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

With only one tool, there is no possibility of confusion between tools. The tool's purpose is clearly defined in its description.

Naming Consistency5/5

The single tool name 'create_word_alignment' follows a clear verb_noun pattern, which is consistent and predictable.

Tool Count4/5

The server has only one tool, which is below the typical 3-15 range. However, for its narrow scope of creating word alignment diagrams, this single tool feels reasonable and not excessive.

Completeness3/5

The server provides a comprehensive create operation with detailed tokenization options, but lacks any retrieval, update, or delete capabilities. This is a notable gap for a full lifecycle, but the tool fully addresses its stated purpose of generating a diagram.

Resources