Validation
Valida o genera números usando el algoritmo de Luhn (módulo 10). Aplica a tarjetas de crédito, IMEI, IMEISV, SIN, NPI y cualquier identificador basado en Luhn.
Llama a esta herramienta desde tu código en tres lenguajes.
curl -X POST 'https://api.elysiatools.com/es/api/tools/luhn-checksum' \
-H 'Content-Type: application/json' \
-d '{"mode":"validate","number":"e.g., 4532015112830366 (spaces/dashes ignored)","length":16,"prefix":"e.g., 4 for Visa, 35 for JCB (leave blank for random)"}'Envía una petición POST con tus entradas en JSON. Los parámetros de tipo archivo requieren una subida previa.
POST https://api.elysiatools.com/es/api/tools/luhn-checksum| Nombre | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| mode | select | Sí | — |
| number | text | Sí | Any Luhn-based number. Separators are ignored. |
| length | number | No | Total digit count including the check digit. |
| prefix | text | No | Lock the leading digits of the generated number. |
Resultado de texto
{
"result": "Processed text content",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}Añade esta herramienta a tu servidor Model Context Protocol para que los agentes de IA puedan listarla y llamarla.
Añade este bloque a la configuración de tu cliente MCP:
{
"mcpServers": {
"elysiatools-luhn-checksum": {
"name": "luhn-checksum",
"description": "Valida o genera números usando el algoritmo de Luhn (módulo 10). Aplica a tarjetas de crédito, IMEI, IMEISV, SIN, NPI y cualquier identificador basado en Luhn.",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=luhn-checksum",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}Tras conectar al endpoint SSE, lista las herramientas expuestas:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Invoca la herramienta por su id; los argumentos se construyen a partir de sus parámetros:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "luhn-checksum",
"arguments": {
"mode": "validate",
"number": "e.g., 4532015112830366 (spaces/dashes ignored)",
"length": 16,
"prefix": "e.g., 4 for Visa, 35 for JCB (leave blank for random)"
}
}
}¿Dudas o problemas? Contacta con [email protected]