Docs
Servidor MCPHerramientas disponibles

Programar sincronización SAT

Programa una sincronización autorizada de datos fiscales del SAT, incluida la descarga masiva de CFDI.

Herramienta MCPsync_sat_data

Propósito

Programa una sincronización autorizada de datos fiscales del SAT, incluida la descarga masiva de CFDI.

Usar cuando
Documentos, declaraciones u opiniones del SAT requieren actualización.
No usar cuando
Solo necesitas consultar datos ya sincronizados.
Permisos requeridos
sat:manage
Efectos secundarios
Efecto externo
Idempotencia
Idempotente

Esquema de entrada

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": {      "oneOf": [        {          "$ref": "#/definitions/__schema0"        },        {          "$ref": "#/definitions/__schema2"        },        {          "$ref": "#/definitions/__schema3"        }      ],      "description": "SAT source to refresh and only the arguments required by that source."    }  },  "required": [    "idempotencyKey",    "input"  ],  "$schema": "http://json-schema.org/draft-07/schema#",  "additionalProperties": false,  "definitions": {    "__schema0": {      "type": "object",      "properties": {        "source": {          "type": "string",          "const": "documents"        },        "dateFrom": {          "$ref": "#/definitions/__schema1"        },        "dateTo": {          "$ref": "#/definitions/__schema1"        },        "kind": {          "type": "string",          "enum": [            "all",            "invoices",            "withholdings"          ]        }      },      "required": [        "source",        "dateFrom",        "dateTo"      ],      "additionalProperties": false    },    "__schema1": {      "type": "string",      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"    },    "__schema2": {      "type": "object",      "properties": {        "source": {          "type": "string",          "const": "declarations"        },        "fiscalYear": {          "type": "integer",          "minimum": 2000,          "maximum": 2100        }      },      "required": [        "source",        "fiscalYear"      ],      "additionalProperties": false    },    "__schema3": {      "type": "object",      "properties": {        "source": {          "type": "string",          "const": "compliance_opinion"        }      },      "required": [        "source"      ],      "additionalProperties": false    }  }}

Esquema de salida

JSON Schema
{  "type": "object",  "properties": {    "data": {      "oneOf": [        {          "type": "object",          "properties": {            "source": {              "type": "string",              "const": "documents"            },            "status": {              "type": "string",              "const": "scheduled"            },            "scheduled": {              "type": "number"            }          },          "required": [            "source",            "status",            "scheduled"          ],          "additionalProperties": false        },        {          "type": "object",          "properties": {            "source": {              "type": "string",              "const": "declarations"            },            "status": {              "type": "string",              "const": "completed"            },            "fiscalYear": {              "type": "number"            },            "declarations": {              "type": "number"            },            "paymentsMatched": {              "type": "number"            },            "filesDownloaded": {              "type": "number"            }          },          "required": [            "source",            "status",            "fiscalYear",            "declarations",            "paymentsMatched",            "filesDownloaded"          ],          "additionalProperties": false        },        {          "type": "object",          "properties": {            "source": {              "type": "string",              "const": "compliance_opinion"            },            "status": {              "type": "string",              "const": "scheduled"            }          },          "required": [            "source",            "status"          ],          "additionalProperties": false        }      ]    },    "error": {      "$schema": "http://json-schema.org/draft-07/schema#",      "type": "object",      "properties": {        "code": {          "type": "string",          "enum": [            "validation_error",            "unauthenticated",            "forbidden",            "not_found",            "method_not_allowed",            "conflict",            "idempotency_conflict",            "operation_in_progress",            "recovery_required",            "rate_limited",            "provider_unavailable",            "internal"          ]        },        "message": {          "type": "string"        },        "details": {          "type": "object",          "properties": {            "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            }          },          "additionalProperties": false        }      },      "required": [        "code",        "message"      ],      "additionalProperties": false    }  },  "$schema": "http://json-schema.org/draft-07/schema#",  "additionalProperties": false,  "oneOf": [    {      "required": [        "data"      ]    },    {      "required": [        "error"      ]    }  ]}

Flujo relacionado

Consulta los flujos canónicos en la introducción

Herramientas relacionadas