Skip to main content
Glama

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.

MCP client
Glama
MCP server

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.

100% free. Your data is private.
Tool DescriptionsA

Average 4.4/5 across 4 of 4 tools scored.

Server CoherenceA
Disambiguation5/5

Each tool has a clear, distinct purpose: create, cancel, query, and send. There is no overlap or ambiguity.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern (create_invoice, cancel_invoice, query_invoice, send_invoice), making them predictable.

Tool Count5/5

Four tools cover the essential operations for invoicing (create, cancel, query, send) without being excessive or insufficient.

Completeness4/5

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 tools
cancel_invoiceA
DestructiveIdempotent
Inspect

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
motiveNoSAT cancellation motive. Default 02.
invoice_idYesThe invoice_id returned by create_invoice
Behavior4/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
useNoSAT uso del CFDI code. Default G03 (gastos en general). Use S01 with the generic RFC.
itemsYesLine items. Each: description, price (MXN, tax-inclusive by default), optional quantity (default 1) and product_key (SAT catalog code, default 01010101).
customer_zipYesBuyer tax-address ZIP code (código postal fiscal), 5 digits — CFDI 4.0 requires it to match SAT records.
payment_formNoSAT forma de pago code. Default 03 (transferencia). Common: 01 cash, 04 credit card, 28 debit card, 99 por definir.
customer_emailNoOptional buyer email — stored on the invoice so send_invoice can deliver the PDF+XML.
customer_tax_idYesBuyer RFC, e.g. ABC680524P76. Generic consumer: XAXX010101000.
customer_legal_nameYesBuyer legal name (razón social) exactly as registered with SAT — must match the RFC or SAT rejects the stamp.
customer_tax_systemNoBuyer régimen fiscal SAT code. Default 601 (General de Ley Personas Morales). Use 616 for the generic consumer RFC.
Behavior5/5

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.

Conciseness4/5

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.

Completeness3/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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_invoiceA
Read-only
Inspect

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
invoice_idYesThe invoice_id returned by create_invoice
Behavior5/5

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.

Conciseness5/5

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.

Completeness4/5

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.

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 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.

Purpose5/5

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.

Usage Guidelines4/5

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_invoiceA
Idempotent
Inspect

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
emailNoOptional recipient email; defaults to the customer email on the invoice.
invoice_idYesThe invoice_id returned by create_invoice
Behavior3/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.

Discussions

No comments yet. Be the first to start the discussion!

Try in Browser

Your Connectors

Sign in to create a connector for this server.

Resources