Skip to main content
Glama

levenshtein_distance

Calculate the minimum number of single-character edits (insert, delete, substitute) required to transform one string into another.

Instructions

Calculate the Levenshtein (edit) distance between two strings.

Use this to measure how many single-character edits (insert, delete,
substitute) are needed to change one string into another.

Parameters:
    a — The first string.
    b — The second string.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations are provided, so the description bears full burden. It describes the standard edit operations (insert, delete, substitute) but does not disclose edge cases (e.g., empty strings) or performance considerations. Merely adequate.

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

Conciseness5/5

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

The description is extremely concise: two sentences plus a parameter list. No redundant information. Every sentence adds value.

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?

For a simple function with two string inputs and a numeric output, the description fully explains what it does and what the parameters mean. The presence of an output schema further reduces the need to describe return values.

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 input schema has no description coverage (0%), so the description compensates by explicitly naming parameters and defining them ('The first string', 'The second string'). This adds meaning beyond the schema's bare type and title.

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 calculates Levenshtein distance between two strings and explains what it measures (number of single-character edits). The verb 'Calculate' and resource 'Levenshtein distance' are specific, and the explanation distinguishes it from general string comparison tools.

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

Usage Guidelines3/5

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

The description provides usage context ('Use this to measure how many single-character edits are needed'), but does not explicitly mention when not to use it or suggest alternative tools for similar purposes.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/scotia1973-bot/api-hub'

If you have feedback or need assistance with the MCP directory API, please join our Discord server