Skip to main content
Glama

Credit card validation (Luhn): check a card or ID number's Luhn checksum

validate_luhn
Read-only

Check whether a card number or other ID passes the Luhn (mod 10) algorithm used by card numbers, IMEI numbers and many IDs, and compute the check digit to append. Only the format is checked; nothing is looked up. Use to catch typos in card or ID numbers. Example: number=79927398713. Price $0.01/call via x402 USDC or a card key (/credits), first 25 free; failed calls free. Reads or computes only and changes nothing; each call is charged, so repeats are not free.

Input Schema

NameRequiredDescriptionDefault
numberYesDigits, spaces and hyphens allowed

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / number / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "number",
      +  "boolean"
      +]
  2. Added
  3. Removed
  4. Added

TDQS

A4/5.0
Behavior4/5

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

Annotations cover readOnlyHint=true and destructiveHint=false, and the description adds real value beyond them: it discloses that calls are charged ($0.01/call via x402 USDC or card key, first 25 free, failed calls free) and that repeats are not free because of the per-call charge. It correctly notes nothing is looked up (pure computation) and changes nothing, which complements the openWorldHint annotation. It doesn't disclose the return shape, but there's no output schema, so that is a minor gap rather than a major one.

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

Conciseness3/5

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

The description is front-loaded with the core check behavior and the example, which is good. But it packs multiple concerns (pricing/billing, safety, repeats) into the closing sentences, making the tail dense and slightly repetitive ('each call is charged, so repeats are not free' restates the pricing). Some sentences could be trimmed without losing meaning.

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?

For a single-parameter, no-output-schema validation tool, the description covers what it does, an example, the format-only nature, and the billing model. An agent has enough to call it correctly. The missing piece is return-value shape (pass/fail + computed check digit), which would help, but with no output schema the description could be more explicit about what it returns.

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% and the schema already documents the 'number' parameter ('Digits, spaces and hyphens allowed'). The description adds a concrete example value, which helps but doesn't add much semantic depth beyond what the schema provides. Baseline 3 is appropriate.

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?

States a specific verb+resource: check whether a number passes the Luhn (mod 10) algorithm, and also compute the check digit to append. The scope ('only the format is checked; nothing is looked up') distinguishes it from sibling validators like validate_iban, validate_isbn and bic_validate, each of which validates a different format.

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?

Explicitly says 'Use to catch typos in card or ID numbers' and gives a concrete example (number=79927398713), which is clear usage context. However, it doesn't explicitly say when NOT to use it or name an alternative sibling for card-number checking, so it stops short of the 5-level 'when-not/alternatives' bar.

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.