Servidor MCPHerramientas disponibles
Guardar producto
Crea o actualiza un producto del catálogo de la organización.
Herramienta MCP
save_productPropósito
- Usar cuando
- Debe agregarse o cambiarse un producto del catálogo.
- No usar cuando
- Necesitas modificar existencias o buscar una clave SAT.
- Permisos requeridos
- 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": { "oneOf": [ { "type": "object", "properties": { "operation": { "const": "create" }, "description": { "type": "string", "minLength": 1 }, "sku": { "type": "string" }, "code": { "type": "string" }, "price": { "type": "number", "exclusiveMinimum": 0 }, "quantityDiscounts": { "allOf": [ { "$ref": "#/definitions/__schema0" } ] }, "taxIncluded": { "$ref": "#/definitions/__schema2" }, "taxability": { "$ref": "#/definitions/__schema3" }, "taxCategory": { "allOf": [ { "$ref": "#/definitions/__schema4" } ] }, "taxExemptReason": { "type": "string" }, "supplierIds": { "$ref": "#/definitions/__schema5" }, "locationIds": { "$ref": "#/definitions/__schema6" }, "satProductCode": { "type": "string", "pattern": "^\\d{8}$", "description": "Active SAT c_ClaveProdServ. Exac requires a specific key, not 01010101." }, "satUnitCode": { "type": "string", "minLength": 1, "description": "SAT c_ClaveUnidad." } }, "required": [ "operation", "description", "price", "satProductCode", "satUnitCode" ], "additionalProperties": false }, { "type": "object", "properties": { "operation": { "const": "update" }, "productId": { "type": "string" }, "sku": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "code": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "quantityDiscounts": { "anyOf": [ { "$ref": "#/definitions/__schema0" }, { "type": "null" } ] }, "taxIncluded": { "$ref": "#/definitions/__schema2" }, "taxability": { "$ref": "#/definitions/__schema3" }, "taxCategory": { "anyOf": [ { "$ref": "#/definitions/__schema4" }, { "type": "null" } ] }, "taxExemptReason": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "supplierIds": { "$ref": "#/definitions/__schema5" }, "locationIds": { "$ref": "#/definitions/__schema6" }, "description": { "type": "string", "minLength": 1 }, "price": { "type": "number", "exclusiveMinimum": 0 }, "active": { "type": "boolean" }, "satProductCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "satUnitCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } }, "required": [ "operation", "productId" ], "additionalProperties": false } ] } }, "required": [ "idempotencyKey", "input" ], "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "definitions": { "__schema0": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "minQuantity": { "type": "number" }, "percentage": { "type": "number" } }, "required": [ "minQuantity", "percentage" ], "additionalProperties": false } }, "__schema2": { "type": "boolean" }, "__schema3": { "enum": [ "standard", "zero", "exempt" ] }, "__schema4": { "type": "string", "pattern": "^[a-z][A-Za-z0-9]{0,63}$" }, "__schema5": { "type": "array", "items": { "type": "string" } }, "__schema6": { "type": "array", "items": { "type": "string" } } }}Esquema de salida
JSON Schema{ "type": "object", "properties": { "data": { "type": "object", "properties": { "productId": { "type": "string", "minLength": 1 }, "description": { "type": "string" }, "sku": { "type": "string" }, "code": { "type": "string" }, "active": { "type": "boolean" }, "price": { "type": "number" }, "quantityDiscounts": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "minQuantity": { "type": "number" }, "percentage": { "type": "number" } }, "required": [ "minQuantity", "percentage" ], "additionalProperties": false } }, "taxIncluded": { "type": "boolean" }, "taxability": { "type": "string" }, "taxCategory": { "type": "string", "pattern": "^[a-z][A-Za-z0-9]{0,63}$" }, "taxExemptReason": { "type": "string" }, "stock": { "type": "number" }, "stockStatus": { "enum": [ "available", "out_of_stock" ] }, "satProductCode": { "type": "string" }, "satUnitCode": { "type": "string" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "productId", "description", "active", "price", "updatedAt" ], "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" ] } ]}