Danh mục thao tác

Lưu danh thiếp / tài khoản ngân hàng

library.cards.saveMCP:library_cards_saveBộ công cụ: Thiết lập tự chạy

Save a contact card (Zalo user id) or bank card to reuse in messages.

Cần Idempotency-Key
Quyền: Thiết lập tự chạy

Gọi bằng REST v2

curl -X POST https://zl.builera.app/api/public/v2/ops/library.cards.save \
  -H "Authorization: Bearer za_live_…" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"kind":"card","name":"Nguyễn Văn A","data":{"userId":"x"}}'

Mỗi khoá/kết nối tối đa 300 lệnh đọc và 60 lệnh ghi mỗi phút. Gọi lại cùng Idempotency-Key trả đúng kết quả cũ, không làm lại.

Gọi qua MCP

{
  "method": "tools/call",
  "params": {
    "name": "library_cards_save",
    "arguments": {
      "kind": "card",
      "name": "Nguyễn Văn A",
      "data": {
        "userId": "x"
      }
    }
  }
}

Thêm https://zl.builera.app/mcp vào ứng dụng AI rồi cho phép kết nối; AI chỉ thấy công cụ trong bộ bạn chọn.

Kết quả

HTTP 200
{ "status": "succeeded", "operationId": "…", "data": { … } }

Ví dụ đầu vào

{
  "kind": "card",
  "name": "Nguyễn Văn A",
  "data": {
    "userId": "x"
  }
}

Thay mã (id) mẫu bằng mã thật lấy từ các thao tác liệt kê/tìm kiếm.

Lược đồ đầu vào (JSON Schema)

{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "enum": [
        "card",
        "bank"
      ]
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "data": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "userId": {
              "type": "string",
              "maxLength": 64
            },
            "phone": {
              "type": "string",
              "maxLength": 20
            }
          },
          "required": [
            "userId"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "binBank": {
              "type": "integer"
            },
            "numAccBank": {
              "type": "string",
              "maxLength": 40
            },
            "nameAccBank": {
              "type": "string",
              "maxLength": 120
            }
          },
          "required": [
            "binBank",
            "numAccBank",
            "nameAccBank"
          ],
          "additionalProperties": false
        }
      ]
    }
  },
  "required": [
    "kind",
    "name",
    "data"
  ],
  "additionalProperties": false
}

Cùng bộ công cụ