Skip to main content
Glama

Distancia de Damerau-Levenshtein

damerau-levenshtein
Read-onlyIdempotent

Calcula la distancia OSA (Levenshtein con transposiciones), útil para errores de tipeo. Cuándo: hay que transformar, comparar o medir un texto con exactitud y no por aproximación. No para: calcular la distancia de edición de Levenshtein entre dos cadenas y similitud normalizada (levenshtein-distance). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.

EN: Computes the optimal string alignment distance: Levenshtein plus transposition of adjacent characters, useful for typo matching. When: text has to be transformed, compared or measured exactly instead of approximated. Not for: computing the edit distance (levenshtein-distance). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB.

Input Schema

NameRequiredDescriptionDefault
aYesFirst string (string; required; up to 20000 chars).
bYesSecond string (string; required; up to 20000 chars).
case_sensitiveNoCase sensitive (boolean; optional; default true).

Output Schema

NameRequiredDescriptionDefault
distanceNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / a / examples
      Added value: +[
      +  "ca"
      +]
    • addedInput schema / properties / b / examples
      Added value: +[
      +  "ac"
      +]
  2. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, non-destructive and closed-world, so the description does not need to re-argue safety; it still adds real value with concrete operational limits (64 KB JSON input, 1 s per call, 1 MB result) and an explicit determinism guarantee. Only return-shape/pagination-style detail is absent, and an output schema exists to cover that.

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?

Purpose, exclusions, side effects and limits are front-loaded and each sentence carries information. The full ES/EN duplication roughly doubles the length for no added meaning to an agent, which is the main structural inefficiency.

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

Completeness4/5

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

Given an output schema exists, the description covers what it must: what is computed, which sibling to use instead, side effects, determinism, and hard limits. The only meaningful gap is the unmentioned case-sensitivity default, which affects result interpretation.

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% for all three parameters (a, b, case_sensitive with default and maxLength), so the schema already carries the semantics. The description adds nothing parameter-specific – notably it never mentions that comparison is case-sensitive by default, which is the one non-obvious behavioral choice a caller might get wrong.

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?

Names the exact algorithm ('distancia OSA: Levenshtein con transposiciones') and its use case (typo matching), then explicitly distinguishes itself from the levenshtein-distance sibling. An agent can tell this apart from levenshtein-distance, jaro-winkler or hamming-distance without opening any schema.

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

Usage Guidelines4/5

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

The 'No para / Not for' clause explicitly routes edit-distance and normalized-similarity work to levenshtein-distance, which is the key disambiguation among many string-comparison siblings. The positive 'When' clause is weaker – 'transform, compare or measure text exactly instead of approximated' is generic enough to apply to several siblings – so it falls short of a full 5.

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