Skip to main content
Glama

Mx Seal Cfdi

mx__seal_cfdi

Seal CFDI 4.0 invoices locally with CSD key/certificate, or choose PAC mode to return XML unsealed for your PAC to sign.

Instructions

Seal (or deliberately not seal) a CFDI 4.0 Comprobante, PAC-agnostic.

sealing_mode="local" computes the cadena original via the actual SAT XSLT transform (specs/cadenaoriginal_4_0.xslt, with its utilerias.xslt and Pagos20.xslt includes resolved from specs/; any other complemento include a document might reference is not in Phase-1 scope and stubs to a no-op template — see SelloDigitalSigner's docstring), then computes Sello/NoCertificado/Certificado via mcp_einvoicing_core.digital_signature.SelloDigitalSigner — no local reimplementation of the signing algorithm.

sealing_mode="pac" returns xml unchanged: some PACs accept an unsealed, schema-valid CFDI and seal it on the emisor's behalf. This tool does not submit to any PAC — see the package README for the PAC-agnostic design.

CSD key material is always a file path, never accepted as plaintext key content in a tool argument.

Returns a dict with:

  • xml: the sealed (or, for "pac", unchanged) XML string

  • sealing_mode: echoes the mode used

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xmlYesThe unsealed CFDI 4.0 Comprobante XML, as returned by mx__build_cfdi/mx__build_pago
key_pathNoPath to the CSD's encrypted PKCS#8 DER private key (.key). Required when sealing_mode='local'.
cert_pathNoPath to the CSD's DER-encoded certificate (.cer). Required when sealing_mode='local'.
key_passwordNoPassphrase for the private key. Required when sealing_mode='local'. This is a secret that transits the tool call as plain text — callers should source it from an environment variable or secrets manager reference on their side rather than hardcoding it, the same as cert_path/key_path are file references rather than inline key material.
sealing_modeYes'local': compute Sello/NoCertificado/Certificado from the supplied CSD. 'pac': return the XML unchanged, for a PAC that seals on the emisor's behalf.
no_certificadoNoThe CSD's 20-digit serial number from the SAT enrollment acknowledgment (acuse). Not derived from the certificate bytes — no confirmed algorithm exists for that derivation, see SelloDigitalSigner's docstring. Required when sealing_mode='local'.

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.9/5.0
Behavior5/5

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

With no annotations, the description carries the full burden, and it does extensively: it explains that local sealing uses an actual SAT XSLT transform, that out-of-scope complementos are stubbed to no-op templates, that key material is only accepted as file paths and never plaintext, that PAC mode returns the XML unchanged, and that the tool does not submit to any PAC. It also explicitly warns that no_certificado is not derived from certificate bytes. This is a highly transparent behavioral disclosure.

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 organized with clear paragraphs per mode and a concise return-value summary. It is longer than minimal, but every section adds necessary operational detail: mode behavior, XSLT internals, security constraints, and return shape. Minor deduction because the implementation detail about spec files and SelloDigitalSigner's docstring could arguably be condensed, but it earns its place for transparency.

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 overall complexity (6 params, two modes, file-path dependencies, security considerations) and the fact that no annotations are present, the description covers all essential calling context: mode selection, required parameters per mode, security convention, return format, and what the tool does not do. The presence of an output schema further confirms the return dict, and the description already enumerates its keys. Nothing critical is missing.

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

Parameters5/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, but the description adds substantial value beyond the schema. It explains the relationship between key_path/cert_path/key_password/no_certificado and sealing_mode, clarifies the security convention for key material, documents the no_certificado derivation caveat, and maps the sealing_mode enum values to their concrete behavior. This is auxesis rather than mere repetition.

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 ('Seal'), a precise resource ('a CFDI 4.0 Comprobante'), and an explicit scope qualifier ('PAC-agnostic'). It clearly distinguishes the two modes of operation. It also differentiates the tool from siblings by stating that it does not submit to any PAC, which is a key distinguishing trait among the cfdi-related tools.

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?

The description explicitly explains when each sealing_mode should be used: 'local' computes the cadena original and signature, 'pac' returns the XML unchanged for PACs that seal on the emisor's behalf. It also states what this tool does not do ('does not submit to any PAC') and where to find the PAC-agnostic design context (package README). This is strong guidance for selecting the right mode and avoiding misuse.

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