Skip to main content
Glama

Detectar marca de tarjeta

card-brand-detect
Read-onlyIdempotent

Detecta la franquicia de una tarjeta por su prefijo, valida longitud y Luhn y devuelve el número enmascarado. No guarda nada ni prueba que la tarjeta exista. Cuándo: hay que verificar sin conexión el formato y el dígito de control de un identificador antes de usarlo. No para: validar un número con el algoritmo de Luhn (luhn-validate). 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: Detects a payment card brand from its IIN prefix (Visa, Mastercard, Amex, Diners, Discover, JCB, UnionPay, Maestro, Elo, Hipercard, Mir), checks length and Luhn, and returns only a masked number. Nothing is stored; this does not prove the card exists. When: an identifier's format and check digit have to be verified offline before it is used. Not for: validating a number with the Luhn mod-10 checksum (luhn-validate). [EN completo / full EN: inputSchema.description]

Input Schema

NameRequiredDescriptionDefault
numberYesCard number (PAN) (string; required; up to 40 chars).

Output Schema

NameRequiredDescriptionDefault
brandNo
maskedNo
luhn_validNo
valid_lengthNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / number / examples
      Added value: +[
      +  "4111 1111 1111 1111"
      +]
  2. Changed1 schema field changed
    • addedInput schema / description
      Added value: +"EN: Detects a payment card brand from its IIN prefix (Visa, Mastercard, Amex, Diners, Discover, JCB, UnionPay, Maestro, Elo, Hipercard, Mir), checks length and Luhn, and returns only a masked number. Nothing is stored; this does not prove the card exists. When: an identifier's format and check digit have to be verified offline before it is used. Not for: validating a number with the Luhn mod-10 checksum (luhn-validate). 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."
  3. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare readOnlyHint/idempotentHint/openWorldHint=false, yet the description still adds non-obvious facts: nothing is stored, it does not prove the card exists, no network access, deterministic output, and explicit limits (64 KB input, 1 s, 1 MB result). That is exactly the context annotations cannot convey.

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?

Front-loaded with the core action, then clearly labeled sections (Cuándo / No para / Efectos / Determinista / Límites). The parallel ES and EN blocks plus the schema description repeating the same English text make it longer than strictly necessary, but every sentence carries information.

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 one-parameter, read-only tool with an output schema, everything an agent needs is present: input expectation, what the result is masked, the no-storage/no-existence-proof caveat, determinism, and operational limits. No return-value explanation is required given the output schema.

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?

With 100% schema coverage and a single well-documented parameter (with an example including spaces), the baseline is 3. The description adds only the framing that matching is done on the IIN prefix and that output is masked, which is marginal beyond the 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?

States a specific verb and resource ('Detecta la franquicia de una tarjeta por su prefijo'), enumerates the brands covered, and clarifies that length + Luhn are checked and only a masked number is returned. An agent can distinguish this from a pure checksum tool without opening the 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?

Explicitly gives a 'Cuándo' (offline format/check-digit verification before using an identifier) and routes to a named alternative ('No para ... luhn-validate'). The Luhn boundary is slightly muddy because the tool itself performs Luhn, so the agent has to infer the difference is scope (brand + length + mask vs. bare checksum), but the when/when-not structure is present.

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