Skip to main content
Glama

Notsy Facturación

emitir_cfdi

Emite y timbra un CFDI 4.0 OFICIAL ante el SAT (acción real, con costo y difícil de revertir). Llama primero a preview_factura. El motor aplica los límites de la API key (puede requerir aprobación humana) y registra la acción en la bitácora.

Args: iguales a preview_factura, más:
    observaciones: texto libre opcional en el CFDI.
    anticipo_id: opcional, id de un anticipo previo a aplicar (relación 07 + nota de crédito).
    idempotency_key: OBLIGATORIA en producción (genera un UUID por operación y reúsalo en
        los reintentos). Si reintentas con la misma clave, NO se timbra de nuevo: se
        devuelve el resultado original o el estado de verificación. Con 504
        PAC_SIN_CONFIRMACION o 409 CFDI_EN_VERIFICACION, reintenta más tarde con la
        MISMA clave y nunca con otra; 409 OPERACION_CERRADA pide una clave nueva; 409
        CFDI_YA_EMITIDO significa que ya existe.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clienteNo
conceptosYes
emisor_idNo
cliente_idNo
forma_pagoNo03
anticipo_idNo
metodo_pagoNoPUE
observacionesNo
idempotency_keyNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and delivers rich behavioral context: real irrevocable/costly action, API key limits, possible human approval, audit logging, mandatory production idempotency, and retry semantics for 504/409 cases. It clearly discloses the operational risks and constraints an agent must know.

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 description is dense but front-loaded with the core warning and preview dependency, then moves into arguments and idempotency details. The long idempotency paragraph is justified by the lack of annotations and schema descriptions, though the structure could be slightly tighter.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex, dangerous, 9-parameter tool with no annotations, no output schema, and 0% schema description coverage, the definition is strong on behavior but incomplete on parameters and return expectations. It tells the agent to mirror preview_factura for most inputs, but an agent would need that sibling schema to call this tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% for 9 parameters, and the description only explains three of them: observaciones, anticipo_id, and idempotency_key. The remaining parameters, including the required conceptos plus cliente, emisor_id, cliente_id, forma_pago, and metodo_pago, are delegated to 'iguales a preview_factura,' which is not self-contained parameter documentation.

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?

The description names a specific verb and resource: 'Emite y timbra un CFDI 4.0 OFICIAL ante el SAT.' It also states the scope ('acción real, con costo y difícil de revertir') and directly distinguishes the tool from its sibling by instructing the caller to use preview_factura first.

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?

It explicitly names preview_factura as the required predecessor and gives detailed retry guidance around idempotency, plus behavioral context for production use. It does not spell out a full when-not-to-use rule beyond the implied warning, but the intended usage sequence is clear.

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