Docs
Servidor MCPHerramientas disponibles

Guardar contacto

Crea o actualiza un cliente o proveedor de la organización.

Herramienta MCPsave_contact

Propósito

Crea o actualiza un cliente o proveedor de la organización.

Usar cuando
Debe agregarse o cambiarse un contacto.
No usar cuando
Necesitas eliminarlo o solo consultar sus datos.
Permisos requeridos
Según input.kind: customer → customers:manage; supplier → providers:manage
Efectos secundarios
Modifica datos
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": {      "anyOf": [        {          "type": "object",          "properties": {            "operation": {              "$ref": "#/definitions/__schema0"            },            "kind": {              "$ref": "#/definitions/__schema1"            },            "legalName": {              "$ref": "#/definitions/__schema2"            },            "email": {              "$ref": "#/definitions/__schema3"            },            "rfc": {              "$ref": "#/definitions/__schema4"            },            "code": {              "$ref": "#/definitions/__schema5"            },            "taxSystem": {              "$ref": "#/definitions/__schema6"            },            "phone": {              "$ref": "#/definitions/__schema7"            },            "address": {              "$ref": "#/definitions/__schema8"            },            "cfdiUse": {              "$ref": "#/definitions/__schema9"            },            "creditEnabled": {              "$ref": "#/definitions/__schema11"            },            "creditByDefault": {              "$ref": "#/definitions/__schema12"            },            "defaultPaymentTermDays": {              "$ref": "#/definitions/__schema13"            }          },          "required": [            "operation",            "kind",            "legalName"          ],          "additionalProperties": false        },        {          "type": "object",          "properties": {            "operation": {              "$ref": "#/definitions/__schema15"            },            "contactId": {              "$ref": "#/definitions/__schema16"            },            "legalName": {              "$ref": "#/definitions/__schema17"            },            "email": {              "$ref": "#/definitions/__schema18"            },            "rfc": {              "$ref": "#/definitions/__schema19"            },            "code": {              "$ref": "#/definitions/__schema20"            },            "taxSystem": {              "$ref": "#/definitions/__schema21"            },            "phone": {              "$ref": "#/definitions/__schema22"            },            "address": {              "$ref": "#/definitions/__schema23"            },            "cfdiUse": {              "$ref": "#/definitions/__schema24"            },            "creditEnabled": {              "$ref": "#/definitions/__schema25"            },            "creditByDefault": {              "$ref": "#/definitions/__schema26"            },            "defaultPaymentTermDays": {              "$ref": "#/definitions/__schema27"            },            "kind": {              "$ref": "#/definitions/__schema28"            }          },          "required": [            "operation",            "contactId",            "kind"          ],          "additionalProperties": false        },        {          "type": "object",          "properties": {            "operation": {              "type": "string",              "const": "create"            },            "kind": {              "type": "string",              "const": "supplier"            },            "legalName": {              "$ref": "#/definitions/__schema2"            },            "email": {              "$ref": "#/definitions/__schema3"            },            "rfc": {              "$ref": "#/definitions/__schema4"            },            "code": {              "$ref": "#/definitions/__schema5"            },            "taxSystem": {              "$ref": "#/definitions/__schema6"            },            "phone": {              "$ref": "#/definitions/__schema7"            },            "address": {              "$ref": "#/definitions/__schema8"            }          },          "required": [            "operation",            "kind",            "legalName"          ],          "additionalProperties": false        },        {          "type": "object",          "properties": {            "operation": {              "$ref": "#/definitions/__schema29"            },            "contactId": {              "$ref": "#/definitions/__schema30"            },            "legalName": {              "$ref": "#/definitions/__schema31"            },            "email": {              "$ref": "#/definitions/__schema32"            },            "rfc": {              "$ref": "#/definitions/__schema33"            },            "code": {              "$ref": "#/definitions/__schema34"            },            "taxSystem": {              "$ref": "#/definitions/__schema35"            },            "phone": {              "$ref": "#/definitions/__schema36"            },            "address": {              "$ref": "#/definitions/__schema37"            },            "kind": {              "$ref": "#/definitions/__schema38"            }          },          "required": [            "operation",            "contactId",            "kind"          ],          "additionalProperties": false        }      ]    }  },  "required": [    "idempotencyKey",    "input"  ],  "$schema": "http://json-schema.org/draft-07/schema#",  "additionalProperties": false,  "definitions": {    "__schema0": {      "type": "string",      "const": "create"    },    "__schema1": {      "type": "string",      "const": "customer"    },    "__schema2": {      "type": "string"    },    "__schema3": {      "type": "string"    },    "__schema4": {      "type": "string"    },    "__schema5": {      "type": "string"    },    "__schema6": {      "type": "string",      "enum": [        "601",        "603",        "605",        "606",        "607",        "608",        "610",        "611",        "612",        "614",        "615",        "616",        "620",        "621",        "622",        "623",        "624",        "625",        "626"      ],      "description": "Active SAT tax-system code.",      "x-exac-sat-catalog": "tax-systems"    },    "__schema7": {      "type": "string"    },    "__schema8": {      "type": "object",      "properties": {        "street": {          "type": "string"        },        "exterior": {          "type": "string"        },        "interior": {          "type": "string"        },        "neighborhood": {          "type": "string"        },        "city": {          "type": "string"        },        "municipality": {          "type": "string"        },        "state": {          "type": "string"        },        "postalCode": {          "type": "string"        },        "country": {          "type": "string"        }      },      "required": [        "postalCode",        "country"      ],      "additionalProperties": false    },    "__schema9": {      "allOf": [        {          "$ref": "#/definitions/__schema10"        }      ]    },    "__schema10": {      "type": "string",      "enum": [        "G01",        "D06",        "I07",        "I06",        "I01",        "I05",        "D09",        "G02",        "D04",        "I04",        "I03",        "D08",        "G03",        "D03",        "D02",        "D01",        "D05",        "I02",        "CN01",        "I08",        "CP01",        "D10",        "D07",        "S01"      ],      "description": "Active SAT CFDI-use code.",      "x-exac-sat-catalog": "cfdi-uses"    },    "__schema11": {      "type": "boolean"    },    "__schema12": {      "type": "boolean"    },    "__schema13": {      "allOf": [        {          "$ref": "#/definitions/__schema14"        }      ]    },    "__schema14": {      "type": "integer",      "minimum": 1,      "maximum": 365    },    "__schema15": {      "type": "string",      "const": "update"    },    "__schema16": {      "type": "string"    },    "__schema17": {      "allOf": [        {          "$ref": "#/definitions/__schema2"        }      ]    },    "__schema18": {      "allOf": [        {          "$ref": "#/definitions/__schema3"        }      ]    },    "__schema19": {      "allOf": [        {          "$ref": "#/definitions/__schema4"        }      ]    },    "__schema20": {      "allOf": [        {          "$ref": "#/definitions/__schema5"        }      ]    },    "__schema21": {      "allOf": [        {          "$ref": "#/definitions/__schema6"        }      ]    },    "__schema22": {      "allOf": [        {          "$ref": "#/definitions/__schema7"        }      ]    },    "__schema23": {      "allOf": [        {          "$ref": "#/definitions/__schema8"        }      ]    },    "__schema24": {      "allOf": [        {          "$ref": "#/definitions/__schema10"        }      ]    },    "__schema25": {      "type": "boolean"    },    "__schema26": {      "type": "boolean"    },    "__schema27": {      "anyOf": [        {          "$ref": "#/definitions/__schema14"        },        {          "type": "null"        }      ]    },    "__schema28": {      "type": "string",      "const": "customer"    },    "__schema29": {      "type": "string",      "const": "update"    },    "__schema30": {      "type": "string"    },    "__schema31": {      "allOf": [        {          "$ref": "#/definitions/__schema2"        }      ]    },    "__schema32": {      "allOf": [        {          "$ref": "#/definitions/__schema3"        }      ]    },    "__schema33": {      "allOf": [        {          "$ref": "#/definitions/__schema4"        }      ]    },    "__schema34": {      "allOf": [        {          "$ref": "#/definitions/__schema5"        }      ]    },    "__schema35": {      "allOf": [        {          "$ref": "#/definitions/__schema6"        }      ]    },    "__schema36": {      "allOf": [        {          "$ref": "#/definitions/__schema7"        }      ]    },    "__schema37": {      "allOf": [        {          "$ref": "#/definitions/__schema8"        }      ]    },    "__schema38": {      "type": "string",      "const": "supplier"    }  }}

Esquema de salida

JSON Schema
{  "type": "object",  "properties": {    "data": {      "oneOf": [        {          "type": "object",          "properties": {            "contactId": {              "$ref": "#/definitions/__schema0"            },            "legalName": {              "$ref": "#/definitions/__schema1"            },            "code": {              "$ref": "#/definitions/__schema2"            },            "email": {              "$ref": "#/definitions/__schema3"            },            "rfc": {              "$ref": "#/definitions/__schema4"            },            "taxSystem": {              "$ref": "#/definitions/__schema5"            },            "phone": {              "$ref": "#/definitions/__schema6"            },            "address": {              "$ref": "#/definitions/__schema7"            },            "updatedAt": {              "$ref": "#/definitions/__schema8"            },            "kind": {              "type": "string",              "const": "customer"            },            "cfdiUse": {              "type": "string"            },            "creditEnabled": {              "type": "boolean"            },            "creditByDefault": {              "type": "boolean"            },            "defaultPaymentTermDays": {              "type": "integer",              "minimum": 1,              "maximum": 365            }          },          "required": [            "contactId",            "legalName",            "updatedAt",            "kind"          ],          "additionalProperties": false        },        {          "type": "object",          "properties": {            "contactId": {              "$ref": "#/definitions/__schema0"            },            "legalName": {              "$ref": "#/definitions/__schema1"            },            "code": {              "$ref": "#/definitions/__schema2"            },            "email": {              "$ref": "#/definitions/__schema3"            },            "rfc": {              "$ref": "#/definitions/__schema4"            },            "taxSystem": {              "$ref": "#/definitions/__schema5"            },            "phone": {              "$ref": "#/definitions/__schema6"            },            "address": {              "$ref": "#/definitions/__schema7"            },            "updatedAt": {              "$ref": "#/definitions/__schema8"            },            "kind": {              "type": "string",              "const": "supplier"            }          },          "required": [            "contactId",            "legalName",            "updatedAt",            "kind"          ],          "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,  "definitions": {    "__schema0": {      "type": "string",      "minLength": 1    },    "__schema1": {      "type": "string"    },    "__schema2": {      "type": "string"    },    "__schema3": {      "type": "string"    },    "__schema4": {      "type": "string"    },    "__schema5": {      "type": "string"    },    "__schema6": {      "type": "string"    },    "__schema7": {      "type": "object",      "properties": {        "street": {          "type": "string"        },        "exterior": {          "type": "string"        },        "interior": {          "type": "string"        },        "neighborhood": {          "type": "string"        },        "city": {          "type": "string"        },        "municipality": {          "type": "string"        },        "state": {          "type": "string"        },        "postalCode": {          "type": "string"        },        "country": {          "type": "string"        }      },      "required": [        "postalCode",        "country"      ],      "additionalProperties": false    },    "__schema8": {      "type": "string",      "format": "date-time"    }  },  "oneOf": [    {      "required": [        "data"      ]    },    {      "required": [        "error"      ]    }  ]}

Flujo relacionado

Consulta los flujos canónicos en la introducción

Herramientas relacionadas