Skip to main content
Glama

Mx Build Pago

mx__build_pago

Generate a well-formed, unsealed CFDI 4.0 payment complement (Pagos 2.0) by combining fixed concept fields with pagos data, ready for sealing.

Instructions

Build a well-formed, unsealed Complemento de Pagos 2.0 CFDI.

Composes the fixed single-Concepto wrapper SAT's Guía de llenado de pagos mandates for a Pago-type Comprobante (ClaveProdServ, ClaveUnidad, Descripcion, ValorUnitario, Importe, ObjetoImp are all fixed conventional values — see this module's docstring constants) with the Pagos20 complement built from pagos_data, and attaches the complement under cfdi:Complemento.

buyer.uso_cfdi is forced to "CP01" (the schema requires it for every Pagos CFDI per the same guide, regardless of what the caller passes) — mirrors how this tool already forces SubTotal/Moneda/etc.

The output XML omits Sello/NoCertificado/Certificado, same as mx__build_cfdi — seal afterward with mx__seal_cfdi.

Returns a dict with:

  • xml: the generated, unsealed CFDI XML string (with the Pagos complement attached)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pagos_dataYesFields matching the Pagos20 schema
comprobante_dataYesFields matching CFDIComprobante, minus SubTotal/Moneda/FormaPago/MetodoPago/CondicionesDePago/lines/TipoDeComprobante — all fixed or derived for a Pagos CFDI, do not supply them

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.3.0

TDQS

A4.7/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 behavioral burde. It discloses that the output is unsealed, omits Sello/NoCertificadao/Certificado, forces buyer.uso_cfdi to CP01 'regardless of what the caller passes,' and returns a dict with an xml key. It also explains that the tool mirrors mx__build_cfdi and that sealing must happen afterward.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is dense but every sentence earns its place: scope, fixed-value behavior, sealing expectations, and return shape. It is front-loaded with the purpose and organized so that technical details follow naturally, without repetition or fluff.

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?

Given the tool's complexity, the descriptions fully covers what an agent needs: input responsibilities, forced schema values, output structure, the unsealed state, and the next step to use mx__seal_cfdi. The output schema signal also relieves the description from needing to enumerate every return field beyond the xml key.

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 the baseline is 3. The description adds value beyond the schema by explaining that comprobante_data fields like SubTotal/Moneda are fixed or derived, that buyer.uso_cfdi is forced to CP01, and that pagos_data drives the Pagos20 complement. This helps the agent understand why certain fields must not be supplied.

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 opens with a specific verb and resource: 'Build a well-formed, unsealed Complemento de Pagos 2.0 CFDI.' It immediately distinguishes itself from mx__build_cfdi by scoping to a Pagos-type comprobante and mentions the Pagos20 complement and fixed Concepto wrapper.

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?

The description makes the intended context clear through the phrase 'Pagos-type Comprobante' and refers to mx__build_cfdi and mx__seal_cfdi as related steps. However, it does not explicitly state 'use this instead of mx__build_cfdi for Pagos' or list when-not-to-use conditions, so it falls short of the highest explicitness bar.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cmendezs/mcp-cfdi-mx'

If you have feedback or need assistance with the MCP directory API, please join our Discord server