Skip to main content
Glama

cfdi_parse

Parse a Mexican CFDI 4.0 invoice XML into JSON: UUID, issuer and receiver RFC, totals, taxes, line items and payment method. / Convierte un CFDI 4.0 de México a JSON. Paid via x402 ($0.01 USDC on Base mainnet (also Polygon, Arbitrum and Solana)) on this tools/call request. Official source and as-of date are in the JSON. Invalid input is rejected without payment.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "xml": "<xml>"
    },
    "name": "cfdi_parse"
  }
}

Input Schema

NameRequiredDescriptionDefault
xmlYesFull CFDI 4.0 XML text (max 512 KiB). / Contenido completo del XML del CFDI.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations to lean on, the description carries the burden well: it discloses that payment is charged per tools/call via x402 ($0.01 USDC on Base, also Polygon/Arbitrum/Solana) and that invalid input is rejected without payment, which is meaningful cost and failure semantics. It still doesn't describe the shape of an error response or how partial/invalid-but-parseable XML is handled.

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?

Purpose is front-loaded in the first sentence, followed by payment and failure terms, so the reading order is correct. The bilingual duplication roughly doubles length without adding new information, which is the only real waste.

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?

For a one-parameter parsing tool with no output schema, the description does explain the returned fields and the payment/failure model. Remaining gaps are the error payload format and version-mismatch behavior, which matter because a paid call with bad input is a real risk to the agent.

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

Parameters3/5

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

There is a single parameter at 100% schema description coverage, including the 512 KiB cap, so the schema does the work and baseline is 3. The description adds no information about the xml parameter itself (encoding, BOM, namespaces, whether a signed XML with Complemento is accepted).

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?

States a specific verb and resource ('Parse a Mexican CFDI 4.0 invoice XML into JSON') and enumerates the returned fields (UUID, issuer/receiver RFC, totals, taxes, line items, payment method), so an agent knows exactly what it gets. Nothing in the sibling list does CFDI parsing, so the purpose is unambiguous without needing sibling differentiation.

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?

Usage is only implied: it applies when you hold CFDI 4.0 XML, and the '4.0' repetition hints older versions are unsupported. There is no explicit when-to-use vs. alternative guidance, no statement about what happens with CFDI 3.3 input, and no routing to a sibling such as extract_metadata for generic XML.

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