Skip to main content
Glama

Complete a number that is missing its check digit

compute_luhn_digit
Read-only

Given digits with the final check digit omitted, return the one that completes them. US healthcare NPIs and securities ISINs use the Luhn formula.

Use it to build valid test fixtures, to recover a last digit that was lost or illegible, or to check an implementation against a reference. To test a number you already have in full, use validate_identifier instead. Input must reduce to digits only once spaces and dashes are stripped; anything else is an error. Payment cards also use Luhn, and are deliberately out of scope here: do not pass card digits, partial or complete. This constructs a well-formed number and nothing more: it does not create, reserve or verify a real provider or security.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
partialYesDigits excluding the final check digit.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
partialYesThe input digits, echoed back.
checkDigitYesThe single digit that completes a Luhn-valid string.

TDQS

A4.9/5.0
Behavior5/5

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

Beyond annotations (readOnlyHint, openWorldHint), the description discloses input normalization rules (spaces/dashes stripped), error conditions, and that it constructs but does not create/reserve/verify. This adds significant behavioral clarity.

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 front-loaded with the core functionality and every sentence adds value—use cases, alternatives, input constraints, exclusions, and non-behaviors. Well-structured and appropriately sized.

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 simple single-parameter schema and output schema presence, the description covers input, output intent, error handling, exclusions, and sibling alternatives. It is complete for an AI agent to select and invoke 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 covers 'partial' as 'Digits excluding the final check digit' (100% coverage). The description adds value by detailing acceptable input formatting (spaces/dashes stripping) and context (NPI/ISIN uses), but does not drastically expand beyond 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 states a specific verb ('return') and resource ('the one that completes them'), clearly distinguishing it from validate_identifier. It also clarifies the Luhn formula use cases (NPI, ISIN) and what it does not do.

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?

Explicitly provides when to use (build test fixtures, recover lost digit, check implementation) and directs to validate_identifier for full-number testing. Also excludes payment cards, giving clear boundaries.

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.6/5.0
Disambiguation5/5

Each tool serves a distinct, non-overlapping purpose: compute_luhn_digit constructs a missing check digit, validate_identifier checks a known format, and identify_format determines an unknown format. No ambiguity exists between them.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with lowercase and underscores: compute_, identify_, validate_. This is perfectly predictable.

Tool Count5/5

Three tools is well-scoped for a focused check-digit utility. Each tool is necessary and distinct, covering the core operations without bloat.

Completeness4/5

The set covers validation, identification, and Luhn check-digit computation. A minor gap is that computation is only offered for Luhn, not for other formats like ISBN or GTIN, but the validation and identification tools cover those formats adequately.