Skip to main content
Glama

Agent Data Tools: Utilities

Luhn check, card validation: check a card or ID number's Luhn checksum

validate_luhn
Read-only

Luhn 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 10 free; failed calls free. Reads or computes only and changes nothing; each call is charged, so repeats are not free.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "number": "<number>"
    },
    "name": "validate_luhn"
  }
}

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. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, openWorldHint=false and destructiveHint=false, and the description reinforces that with 'Reads or computes only and changes nothing'. It adds genuinely new behavioral facts the annotations cannot express: per-call pricing via x402 USDC or card key, the first 10 calls free, failed calls free, and that repeats are not free — which explains the idempotentHint=false. It could go further on exactly what the response contains, but the added value is real.

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 core capability and the format-only caveat are front-loaded, and the example sits close to them. The pricing sentence is long and bundles four separate facts (rate, payment rails, free tier, repeat billing), making it denser than it needs to be, but nothing is truly wasted.

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 one-parameter, no-output-schema tool with full annotation coverage, the description supplies what is missing: the algorithm's meaning, what is not checked, a working example, and the billing model. Only the exact return shape (boolean plus computed check digit) is left implicit, which is a minor gap given no output schema exists.

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 single 'number' parameter already documents that digits, spaces and hyphens are allowed. The description contributes one concrete example (number=79927398713), which usefully shows an accepted format, but adds no semantics about the boolean input type or edge cases. Marginal value over schema puts it at baseline-plus.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific algorithm and resource: 'whether a card number or other ID passes the Luhn (mod 10) algorithm' plus 'compute the check digit to append'. It also scopes the operation with 'Only the format is checked; nothing is looked up.' It does not name any sibling tool, so the agent must infer that validate_iban, validate_isbn or evm_checksum are the alternatives, which keeps it short of a 5.

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?

'Use to catch typos in card or ID numbers' gives a clear positive trigger, and 'Only the format is checked; nothing is looked up' implicitly excludes use as a real card or account verification step. No alternative tool is named and no explicit when-not statement is given, so it stops at 4.

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