MCP serverAvailable tools
Send document
Deliver a CFDI, withholding, or sales receipt to a recipient.
MCP tool
send_documentPurpose
- Use when
- A document is ready to be emailed to its recipient.
- Do not use when
- The document is still a draft or the requested attachment is unsupported.
- Required permissions
- Side effects
- External side effect
- Idempotency
- Idempotent
Input schema
JSON Schema{ "type": "object", "properties": { "idempotencyKey": { "type": "string", "minLength": 1, "maxLength": 200, "description": "Unique retry key for this exact operation. Reuse it only when retrying the same request." }, "input": { "anyOf": [ { "type": "object", "properties": { "documentRef": { "type": "string", "pattern": "^(invoice|withholding):.+$", "description": "Fiscal documentRef returned by search_documents" }, "content": { "description": "Attachment set to send; defaults to document", "allOf": [ { "enum": [ "document", "cancellation_receipt" ] } ] }, "recipient": { "$ref": "#/definitions/__schema1" } }, "required": [ "documentRef" ], "additionalProperties": false }, { "type": "object", "properties": { "documentRef": { "type": "string", "pattern": "^(sales_receipt):.+$", "description": "DocumentRef returned by search_documents" }, "content": { "const": "document" }, "recipient": { "$ref": "#/definitions/__schema1" } }, "required": [ "documentRef" ], "additionalProperties": false } ] } }, "required": [ "idempotencyKey", "input" ], "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "definitions": { "__schema1": { "description": "Recipient override; defaults to the saved receptor email", "allOf": [ { "type": "string", "format": "email", "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" } ] } }}Output schema
JSON Schema{ "type": "object", "properties": { "data": { "type": "object", "properties": { "documentRef": { "type": "string" }, "content": { "enum": [ "document", "cancellation_receipt" ] }, "recipient": { "type": "string" }, "sent": { "type": "boolean", "const": true } }, "required": [ "documentRef", "content", "recipient", "sent" ], "additionalProperties": false }, "error": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "code": { "enum": [ "validation_error", "unauthenticated", "forbidden", "payment_required", "not_found", "method_not_allowed", "conflict", "idempotency_conflict", "operation_in_progress", "recovery_required", "migration_required", "rate_limited", "provider_unavailable", "internal" ] }, "message": { "type": "string" }, "details": { "type": "object", "properties": { "document": { "type": "object", "properties": { "documentRef": { "type": "string", "pattern": "^(invoice|withholding|sales_receipt|declaration|tax_compliance_opinion|sales_receipt_refund):.+$" }, "editable": { "type": "boolean" } }, "required": [ "documentRef", "editable" ], "additionalProperties": false }, "issues": { "type": "array", "items": { "type": "object", "properties": { "path": { "type": "array", "items": { "anyOf": [ { "type": "string" }, { "type": "number" } ] } }, "message": { "type": "string" }, "code": { "type": "string" } }, "required": [ "path", "message" ], "additionalProperties": false } }, "retryable": { "type": "boolean" }, "retryAfterSeconds": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "reason": { "type": "string" }, "balanceMinor": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "topUpUrl": { "type": "string" } }, "additionalProperties": false } }, "required": [ "code", "message" ], "additionalProperties": false } }, "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "oneOf": [ { "required": [ "data" ] }, { "required": [ "error" ] } ]}Related workflow
See the canonical workflows in QuickstartRelated tools
Get document
Retrieve one document by its public documentRef.
Cancel fiscal document
Request cancellation of a stamped CFDI or withholding. pending: true acknowledges the request without confirming cancellation. For withholdings, get_document reads stored state; automatic SAT status refresh is unavailable. Verify independently through the [SAT Retenciones verification portal](https://prodretencionverificacion.clouda.sat.gob.mx/). An available acuse does not by itself confirm completion. Never automatically resubmit or change idempotency keys after recovery_required or an uncertain outcome.