Mexico Invoices (CFDI 4.0 factura electrónica)
Server Details
Mexico CFDI 4.0 invoices for AI agents - issue, query, cancel facturas via Facturapi.
- Status
- Healthy
- Last Tested
- Transport
- Streamable HTTP
- URL
Glama MCP Gateway
Connect through Glama MCP Gateway for full control over tool access and complete visibility into every call.
Full call logging
Every tool call is logged with complete inputs and outputs, so you can debug issues and audit what your agents are doing.
Tool access control
Enable or disable individual tools per connector, so you decide what your agents can and cannot do.
Managed credentials
Glama handles OAuth flows, token storage, and automatic rotation, so credentials never expire on your clients.
Usage analytics
See which tools your agents call, how often, and when, so you can understand usage patterns and catch anomalies.
Tool Definition Quality
Average 4.4/5 across 4 of 4 tools scored.
Each tool has a clear, distinct purpose: create, cancel, query, and send. There is no overlap or ambiguity.
All tool names follow a consistent verb_noun pattern (create_invoice, cancel_invoice, query_invoice, send_invoice), making them predictable.
Four tools cover the essential operations for invoicing (create, cancel, query, send) without being excessive or insufficient.
The set covers core lifecycle operations but lacks a list/search tool for retrieving all invoices, which could be useful for agents.
Available Tools
4 toolscancel_invoiceADestructiveIdempotentInspect
Cancel (void) a stamped Mexico CFDI at SAT. SAT requires a cancellation motive code: 01 replaced-with-corrected, 02 issued-in-error-no-replacement (default), 03 transaction-did-not-happen, 04 related-to-global-invoice. Some cancellations need the buyer's acceptance — status stays pending until SAT resolves it.
| Name | Required | Description | Default |
|---|---|---|---|
| motive | No | SAT cancellation motive. Default 02. | |
| invoice_id | Yes | The invoice_id returned by create_invoice |
Tool Definition Quality
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already indicate destructive and idempotent hints. Description adds that SAT cancellation requires motives and may involve pending status, providing useful behavioral context beyond annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, directly front-loaded with purpose, no wasted words. Every sentence earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema, but description explains behavior including pending status and motives. Complete enough for this tool's complexity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, and description adds meaning to the motive codes (e.g., '01 replaced-with-corrected'), which enhances understanding beyond enum values.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool cancels/voids a Mexico CFDI at SAT, and includes the motive codes. It distinctively differentiates from siblings like create_invoice, query_invoice, send_invoice.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides context on buyer acceptance and pending status, but doesn't explicitly state when not to use or name alternatives. Still, the context is helpful for proper usage.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
create_invoiceAInspect
Issue a Mexico CFDI 4.0 electronic invoice (factura electrónica, stamped/timbrada through a SAT-certified PAC). Two interchangeable PACs behind one tool (bring your own credentials as HTTP headers; this server stores nothing, and the CSD certificate stays in the merchant's own PAC account): (A) FACTURAPI — header x-facturapi-key (free sk_test_ from facturapi.io never reaches SAT; sk_live_ stamps real CFDIs). (B) FACTURAMA API-Web — headers x-facturama-user + x-facturama-password (your Facturama login) plus x-facturama-expedition-place (your branch-office 5-digit ZIP, which Facturama requires for the issuer); add x-facturama-sandbox: true for the no-fiscal-effect sandbox. Routing: whichever credential headers you send picks the PAC; if both are present Facturapi wins unless you set header x-invoice-provider: facturama. Sensible SAT defaults: product_key 01010101 (generic), payment_form 03 (bank transfer), use G03 (general expenses); item price is tax-inclusive (16% IVA assumed). For a buyer without RFC use tax_id XAXX010101000 with tax_system 616 and use S01.
| Name | Required | Description | Default |
|---|---|---|---|
| use | No | SAT uso del CFDI code. Default G03 (gastos en general). Use S01 with the generic RFC. | |
| items | Yes | Line items. Each: description, price (MXN, tax-inclusive by default), optional quantity (default 1) and product_key (SAT catalog code, default 01010101). | |
| customer_zip | Yes | Buyer tax-address ZIP code (código postal fiscal), 5 digits — CFDI 4.0 requires it to match SAT records. | |
| payment_form | No | SAT forma de pago code. Default 03 (transferencia). Common: 01 cash, 04 credit card, 28 debit card, 99 por definir. | |
| customer_email | No | Optional buyer email — stored on the invoice so send_invoice can deliver the PDF+XML. | |
| customer_tax_id | Yes | Buyer RFC, e.g. ABC680524P76. Generic consumer: XAXX010101000. | |
| customer_legal_name | Yes | Buyer legal name (razón social) exactly as registered with SAT — must match the RFC or SAT rejects the stamp. | |
| customer_tax_system | No | Buyer régimen fiscal SAT code. Default 601 (General de Ley Personas Morales). Use 616 for the generic consumer RFC. |
Tool Definition Quality
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations indicate readOnlyHint=false, etc. Description adds details: credentials not stored, CSD stays in PAC account, no fiscal effect sandbox, and default SAT codes. No contradiction.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Dense but efficient; front-loaded with purpose. Could benefit from bullet points, but every sentence adds value without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Covers PAC routing, defaults, and SAT requirements well. However, lacks explanation of the return value (no output schema), which is a gap for a tool that creates a resource.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, but description adds value by explaining defaults (e.g., product_key 01010101, payment_form 03) and contextual usage (e.g., customer_zip must match SAT records, tax_system default 601).
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it issues a Mexico CFDI 4.0 electronic invoice, a specific verb and resource. It distinguishes from sibling tools (cancel, query, send) by explaining the stamping process through a PAC.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides extensive usage context: which PACs, credential headers, routing logic, and sensible defaults. Does not explicitly state when not to use, but the context is comprehensive and clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
query_invoiceARead-onlyInspect
Check a Mexico CFDI invoice created by create_invoice. Status values: VALID (stamped and fiscally valid — uuid is the SAT folio fiscal), CANCELED (voided at SAT); cancellation_status pending means SAT is still processing a cancellation. Safe to call anytime.
| Name | Required | Description | Default |
|---|---|---|---|
| invoice_id | Yes | The invoice_id returned by create_invoice |
Tool Definition Quality
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already mark it as read-only, but the description adds valuable behavioral details: status values (VALID, CANCELED) and cancellation_status meaning. No contradictions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and front-loaded: first sentence states the purpose, then explains status values, and ends with usage guidance. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
While there is no output schema, the description covers the key status fields a user needs. It is adequate for the simple tool, though a full response field list would be more complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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 by specifying that the invoice_id comes from create_invoice, linking it to the sibling tool context.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it checks a Mexico CFDI invoice, tying it to the create_invoice sibling. It distinguishes from siblings by being a read-only query operation, and the status values are explained.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It provides clear context about when to call (after creating an invoice) and explicitly states 'Safe to call anytime.' However, it does not explicitly mention when not to use or compare with alternatives, but the sibling context helps.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
send_invoiceAIdempotentInspect
Email the stamped CFDI (PDF + XML) to the buyer via the same PAC that issued it (Facturapi or Facturama). Uses the email stored on the invoice unless a different one is passed.
| Name | Required | Description | Default |
|---|---|---|---|
| No | Optional recipient email; defaults to the customer email on the invoice. | ||
| invoice_id | Yes | The invoice_id returned by create_invoice |
Tool Definition Quality
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations provide idempotentHint and destructiveHint, and the description adds that it uses the same PAC and defaults to stored email. However, it does not detail state changes, required prerequisites, or error handling beyond the schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loaded with the core action, and contains no filler. Every sentence is essential.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's straightforward nature and good schema coverage, the description covers the primary use case. It does not detail error cases or output, but for emailing a document, it is sufficient.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 100% schema coverage, baseline is 3. The description adds value by explaining that the email defaults to the customer email on the invoice and that the PAC is the same that issued the invoice, reinforcing and contextualizing the parameter descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it emails the stamped CFDI (PDF + XML) to the buyer, specifying the verb (email), resource (stamped CFDI), and the PAC used. It distinguishes from siblings (cancel, create, query) by focusing on sending.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage after invoice creation but does not explicitly state when to use this tool versus alternatives. It lacks explicit when/when-not and alternative guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Claim this connector by publishing a /.well-known/glama.json file on your server's domain with the following structure:
{
"$schema": "https://glama.ai/mcp/schemas/connector.json",
"maintainers": [{ "email": "your-email@example.com" }]
}The email address must match the email associated with your Glama account. Once published, Glama will automatically detect and verify the file within a few minutes.
Control your server's listing on Glama, including description and metadata
Access analytics and receive server usage reports
Get monitoring and health status updates for your server
Feature your server to boost visibility and reach more users
For users:
Full audit trail – every tool call is logged with inputs and outputs for compliance and debugging
Granular tool control – enable or disable individual tools per connector to limit what your AI agents can do
Centralized credential management – store and rotate API keys and OAuth tokens in one place
Change alerts – get notified when a connector changes its schema, adds or removes tools, or updates tool definitions, so nothing breaks silently
For server owners:
Proven adoption – public usage metrics on your listing show real-world traction and build trust with prospective users
Tool-level analytics – see which tools are being used most, helping you prioritize development and documentation
Direct user feedback – users can report issues and suggest improvements through the listing, giving you a channel you would not have otherwise
The connector status is unhealthy when Glama is unable to successfully connect to the server. This can happen for several reasons:
The server is experiencing an outage
The URL of the server is wrong
Credentials required to access the server are missing or invalid
If you are the owner of this MCP connector and would like to make modifications to the listing, including providing test credentials for accessing the server, please contact support@glama.ai.
Discussions
No comments yet. Be the first to start the discussion!