Skip to main content
Glama

Verificar CUFE de factura DIAN

co-cufe-verify
Read-onlyIdempotent

Recalcula el CUFE de una factura electrónica de venta colombiana (SHA-384 de los 15 campos definidos por la DIAN: número, fecha, hora, valores, impuestos 01/04/03, total, NIT, clave técnica, ambiente) y lo compara con un CUFE dado; o solo revisa el formato de un CUFE/CUDE. Cuándo: hay que recalcular el CUFE de una factura electrónica DIAN a partir de sus campos para comprobar que coincide. No para: calcular el resumen SHA-384 (hash-sha384). 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: Recomputes the CUFE of a Colombian electronic sales invoice (SHA-384 of the 15 fields defined by DIAN: number, date, time, amounts, tax codes 01/04/03, total, NITs, technical key, environment) and compares it with a given CUFE; or checks a CUFE/CUDE format only. [EN completo / full EN: inputSchema.description]

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "cufe": "ABC123"
    },
    "name": "co-cufe-verify"
  }
}

Input Schema

NameRequiredDescriptionDefault
cufeNoCUFE/CUDE to check (96 hex chars) (string; optional; up to 200 chars).
fec_facNoIssue date YYYY-MM-DD (FecFac) (string; optional; pattern ^\d{4}-\d{2}-\d{2}$).
hor_facNoIssue time with offset, e.g. 10:30:45-05:00 (HorFac) (string; optional; pattern ^\d{2}:\d{2}:\d{2}[-+]\d{2}:\d{2}$).
nit_ofeNoIssuer NIT without DV (NitOFE) (string; optional; pattern ^\d{1,15}$).
num_adqNoBuyer ID number (NumAdq) (string; optional; up to 30 chars).
num_facNoInvoice number with prefix (NumFac) (string; optional; up to 40 chars).
val_facNoAmount (number or decimal string, max 2 decimals) (one of several shapes; optional).
val_totNoAmount (number or decimal string, max 2 decimals) (one of several shapes; optional).
val_imp1NoAmount (number or decimal string, max 2 decimals) (one of several shapes; optional).
val_imp2NoAmount (number or decimal string, max 2 decimals) (one of several shapes; optional).
val_imp3NoAmount (number or decimal string, max 2 decimals) (one of several shapes; optional).
clave_tecnicaNoTechnical key from the numbering resolution (ClTec) (string; optional; up to 200 chars).
tipo_ambienteNoEnvironment: 1 production, 2 testing (optional; one of: 1, 2).

Output Schema

NameRequiredDescriptionDefault
cufeNo
chainNo
reasonNo
matchesNo
format_validNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "cufe": "ABC123"
      +  }
      +]
  2. Changed1 schema field changed
    • addedInput schema / description
      Added value: +"EN: Recomputes the CUFE of a Colombian electronic sales invoice (SHA-384 of the 15 fields defined by DIAN: number, date, time, amounts, tax codes 01/04/03, total, NITs, technical key, environment) and compares it with a given CUFE; or checks a CUFE/CUDE format only. When: the CUFE of a DIAN e-invoice has to be recomputed from the invoice fields to check that it matches. Not for: computing the SHA-384 digest (hash-sha384). 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
Behavior4/5

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

Annotations already declare readOnly, openWorld=false, idempotent and non-destructive, and the description re-affirms the same. The added value is real though: hard limits (64 KB JSON input, 1 s per call, 1 MB result) and determinism, which are not in the annotations. It stops short of saying what a mismatch result looks like, but the output schema exists for that.

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?

Front-loaded with the core action and neatly split into Cuándo / No para / Efectos / Límites, which is good structure. However the text is duplicated in Spanish and English, and the trailing pointer "[EN completo / full EN: inputSchema.description]" merely repeats the same paragraph again, padding the definition past its useful size.

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?

With rich annotations, a full output schema and 100% schema description coverage, the description covers behavior, limits and the sibling exclusion adequately. The one material gap: all 13 parameters are optional, and nothing says which subset is required to actually recompute versus merely format-check, leaving the agent to guess the input contract.

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?

Schema coverage is 100%, so baseline is 3, but the description adds meaning the schema does not: it enumerates the 15 DIAN fields and the tax code slots (01/04/03) that must be concatenated for the SHA-384, which tells the agent which properties feed the hash. It also frames the cufe parameter as the comparison target and implies a format-only mode when only cufe is given.

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: recompute the CUFE of a Colombian DIAN e-invoice via SHA-384 over the 15 defined fields and compare it to a supplied CUFE, or format-check a CUFE/CUDE. That is precise enough to distinguish it from the hash-* and co-nit/recibo-verify siblings without opening any schema.

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 gives the trigger ("hay que recalcular el CUFE ... para comprobar que coincide") and an exclusion naming the alternative to use instead (hash-sha384 for a bare digest). The when/when-not structure leaves little to inference.

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