{
  "x402Version": 2,
  "service": "crm-cleanse",
  "title": "CRM Cleanse & Dedupe Edge API",
  "version": "1.0.0",
  "mcpEndpoint": "https://crm-cleanse.apikeg.com/mcp",
  "freeDiscovery": [
    "https://crm-cleanse.apikeg.com/llms.txt",
    "https://crm-cleanse.apikeg.com/llms-full.txt",
    "https://crm-cleanse.apikeg.com/openapi.json",
    "https://crm-cleanse.apikeg.com/.well-known/mcp.json",
    "https://crm-cleanse.apikeg.com/.well-known/api-catalog"
  ],
  "resources": [
    {
      "name": "cleanse_contact_batch",
      "title": "Cleanse & Deduplicate Contact Batch",
      "url": "https://crm-cleanse.apikeg.com/v1/cleanse-contact-batch",
      "method": "POST",
      "description": "Normalizes emails, international E.164 phones, person names/honorifics, and company legal suffixes across 1-500 CRM records, returning merged canonical uniqueRecords and duplicateClusters. Why call instead of DIY: Replaces 300+ lines of fragile phone/name/Jaro-Winkler code and saves thousands of LLM tokens on 500-row CSV imports; executes deterministically in <15ms. Pricing: $0.001 base (up to $0.01 max ($0.001 minimum + $0.002 per 100 records, capped at $0.01 for up to 500 records), x402 variable settlement). Pass ?dry_run=true on REST to validate schema free.",
      "accepts": [
        {
          "scheme": "upto",
          "network": "eip155:8453",
          "amount": "10000",
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "payTo": "0x000000000000000000000000000000000000dEaD",
          "maxTimeoutSeconds": 60,
          "extra": {
            "priceUsd": "0.001",
            "maxPriceUsd": "0.01",
            "unitDescription": "($0.001 minimum + $0.002 per 100 records, capped at $0.01 for up to 500 records)",
            "dryRunQueryParam": "?dry_run=true"
          }
        }
      ],
      "extensions": {
        "bazaar": {
          "discoverable": true,
          "category": [
            "crm-automation",
            "revops",
            "data-hygiene",
            "business-ops"
          ],
          "info": {
            "input": {
              "type": "http",
              "method": "POST",
              "bodyType": "json",
              "example": {
                "defaultCountry": "US",
                "dedupe": true,
                "matchThreshold": 0.82,
                "records": [
                  {
                    "fullName": "Dr. Ronald MCDONALD, MBA",
                    "email": "ronald+webinar@ApexCloud.io",
                    "phone": "(415) 555-2671 ext. 402",
                    "company": "Apex Cloud, Inc."
                  },
                  {
                    "firstName": "Ronald",
                    "lastName": "McDonald",
                    "email": "ronald@apexcloud.io",
                    "company": "Apex Cloud LLC"
                  }
                ]
              }
            },
            "output": {
              "type": "json",
              "summary": "1 unique merged contact and 1 duplicate cluster with exact_email_fingerprint + fuzzy_name_and_company."
            }
          },
          "schema": {
            "inputSchema": {
              "type": "object",
              "properties": {
                "records": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "maxLength": 128,
                        "description": "Optional caller-supplied CRM record identifier."
                      },
                      "fullName": {
                        "type": "string",
                        "maxLength": 200,
                        "description": "Full person name (may include honorifics/suffixes such as 'Dr. Ronald MCDONALD, MBA')."
                      },
                      "firstName": {
                        "type": "string",
                        "maxLength": 120,
                        "description": "Given/first name if already split."
                      },
                      "lastName": {
                        "type": "string",
                        "maxLength": 120,
                        "description": "Family/last name if already split."
                      },
                      "email": {
                        "type": "string",
                        "maxLength": 320,
                        "description": "Email address (supports +tag subaddressing and free-webmail detection)."
                      },
                      "phone": {
                        "type": "string",
                        "maxLength": 64,
                        "description": "Domestic or international phone string, optionally including an extension."
                      },
                      "country": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 2,
                        "pattern": "^[A-Za-z]{2}$",
                        "description": "Per-record ISO 3166-1 alpha-2 country override for domestic phone parsing."
                      },
                      "company": {
                        "type": "string",
                        "maxLength": 240,
                        "description": "Raw company or organization name (e.g. 'Acme, Inc.' or 'Siemens AG')."
                      },
                      "title": {
                        "type": "string",
                        "maxLength": 160,
                        "description": "Job title or organizational role."
                      },
                      "website": {
                        "type": "string",
                        "maxLength": 512,
                        "description": "Company website URL or domain."
                      }
                    },
                    "additionalProperties": false,
                    "description": "CRM contact or lead record."
                  },
                  "minItems": 1,
                  "maxItems": 500,
                  "description": "Batch of 1 to 500 CRM contact records to normalize and deduplicate."
                },
                "defaultCountry": {
                  "type": "string",
                  "default": "US",
                  "minLength": 2,
                  "maxLength": 2,
                  "pattern": "^[A-Za-z]{2}$",
                  "description": "Default ISO 3166-1 alpha-2 country code for domestic phone numbers."
                },
                "dedupe": {
                  "type": "boolean",
                  "default": true,
                  "description": "Cluster duplicate records and merge non-null fields into uniqueRecords."
                },
                "matchThreshold": {
                  "type": "number",
                  "default": 0.82,
                  "minimum": 0.5,
                  "maximum": 1,
                  "description": "Minimum confidence threshold [0.5-1.0] required to merge duplicate records."
                }
              },
              "required": [
                "records"
              ],
              "additionalProperties": false
            },
            "outputSchema": {
              "type": "object",
              "required": [
                "ok",
                "data",
                "_meta"
              ],
              "properties": {
                "ok": {
                  "type": "boolean",
                  "const": true
                },
                "data": {
                  "type": "object",
                  "description": "Deterministic structured tool result payload."
                },
                "_meta": {
                  "type": "object",
                  "required": [
                    "requestId",
                    "durationMs",
                    "chargedUsd",
                    "dryRun"
                  ],
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "durationMs": {
                      "type": "number"
                    },
                    "chargedUsd": {
                      "type": "string"
                    },
                    "dryRun": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    {
      "name": "compare_contact_pair",
      "title": "Compare Two Contacts for Duplicate Match",
      "url": "https://crm-cleanse.apikeg.com/v1/compare-contact-pair",
      "method": "POST",
      "description": "Computes field-by-field normalized similarity (email fingerprint, E.164 phone, Jaro-Winkler + Soundex name, company key, corporate domain) and returns an isMatch merge recommendation. Why call instead of DIY: Instant deterministic entity-resolution check for webhook/CRM pre-insert hooks at $0.0005 per pair. Pricing: $0.0005 USD per contact pair comparison (x402 instant micropayment). Pass ?dry_run=true on REST to validate schema free.",
      "accepts": [
        {
          "scheme": "exact",
          "network": "eip155:8453",
          "amount": "500",
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "payTo": "0x000000000000000000000000000000000000dEaD",
          "maxTimeoutSeconds": 60,
          "extra": {
            "priceUsd": "0.0005",
            "unitDescription": "per contact pair comparison",
            "dryRunQueryParam": "?dry_run=true"
          }
        }
      ],
      "extensions": {
        "bazaar": {
          "discoverable": true,
          "category": [
            "crm-automation",
            "revops",
            "data-hygiene",
            "business-ops"
          ],
          "info": {
            "input": {
              "type": "http",
              "method": "POST",
              "bodyType": "json",
              "example": {
                "defaultCountry": "GB",
                "matchThreshold": 0.82,
                "recordA": {
                  "fullName": "Jon Smyth",
                  "phone": "07911 123456",
                  "company": "Albion Analytics Ltd"
                },
                "recordB": {
                  "fullName": "John Smith",
                  "phone": "+44 7911 123456",
                  "company": "Albion Analytics Limited"
                }
              }
            },
            "output": {
              "type": "json",
              "summary": "isMatch=true, recommendation='merge' with exact_phone_e164, fuzzy_name_and_company, and phonetic_name_match."
            }
          },
          "schema": {
            "inputSchema": {
              "type": "object",
              "properties": {
                "recordA": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 128,
                      "description": "Optional caller-supplied CRM record identifier."
                    },
                    "fullName": {
                      "type": "string",
                      "maxLength": 200,
                      "description": "Full person name (may include honorifics/suffixes such as 'Dr. Ronald MCDONALD, MBA')."
                    },
                    "firstName": {
                      "type": "string",
                      "maxLength": 120,
                      "description": "Given/first name if already split."
                    },
                    "lastName": {
                      "type": "string",
                      "maxLength": 120,
                      "description": "Family/last name if already split."
                    },
                    "email": {
                      "type": "string",
                      "maxLength": 320,
                      "description": "Email address (supports +tag subaddressing and free-webmail detection)."
                    },
                    "phone": {
                      "type": "string",
                      "maxLength": 64,
                      "description": "Domestic or international phone string, optionally including an extension."
                    },
                    "country": {
                      "type": "string",
                      "minLength": 2,
                      "maxLength": 2,
                      "pattern": "^[A-Za-z]{2}$",
                      "description": "Per-record ISO 3166-1 alpha-2 country override for domestic phone parsing."
                    },
                    "company": {
                      "type": "string",
                      "maxLength": 240,
                      "description": "Raw company or organization name (e.g. 'Acme, Inc.' or 'Siemens AG')."
                    },
                    "title": {
                      "type": "string",
                      "maxLength": 160,
                      "description": "Job title or organizational role."
                    },
                    "website": {
                      "type": "string",
                      "maxLength": 512,
                      "description": "Company website URL or domain."
                    }
                  },
                  "additionalProperties": false,
                  "description": "CRM contact or lead record."
                },
                "recordB": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "maxLength": 128,
                      "description": "Optional caller-supplied CRM record identifier."
                    },
                    "fullName": {
                      "type": "string",
                      "maxLength": 200,
                      "description": "Full person name (may include honorifics/suffixes such as 'Dr. Ronald MCDONALD, MBA')."
                    },
                    "firstName": {
                      "type": "string",
                      "maxLength": 120,
                      "description": "Given/first name if already split."
                    },
                    "lastName": {
                      "type": "string",
                      "maxLength": 120,
                      "description": "Family/last name if already split."
                    },
                    "email": {
                      "type": "string",
                      "maxLength": 320,
                      "description": "Email address (supports +tag subaddressing and free-webmail detection)."
                    },
                    "phone": {
                      "type": "string",
                      "maxLength": 64,
                      "description": "Domestic or international phone string, optionally including an extension."
                    },
                    "country": {
                      "type": "string",
                      "minLength": 2,
                      "maxLength": 2,
                      "pattern": "^[A-Za-z]{2}$",
                      "description": "Per-record ISO 3166-1 alpha-2 country override for domestic phone parsing."
                    },
                    "company": {
                      "type": "string",
                      "maxLength": 240,
                      "description": "Raw company or organization name (e.g. 'Acme, Inc.' or 'Siemens AG')."
                    },
                    "title": {
                      "type": "string",
                      "maxLength": 160,
                      "description": "Job title or organizational role."
                    },
                    "website": {
                      "type": "string",
                      "maxLength": 512,
                      "description": "Company website URL or domain."
                    }
                  },
                  "additionalProperties": false,
                  "description": "CRM contact or lead record."
                },
                "defaultCountry": {
                  "type": "string",
                  "default": "US",
                  "minLength": 2,
                  "maxLength": 2,
                  "pattern": "^[A-Za-z]{2}$",
                  "description": "Default ISO 3166-1 alpha-2 country code for domestic phone numbers."
                },
                "matchThreshold": {
                  "type": "number",
                  "default": 0.82,
                  "minimum": 0.5,
                  "maximum": 1,
                  "description": "Minimum confidence threshold [0.5-1.0] required to recommend merging."
                }
              },
              "required": [
                "recordA",
                "recordB"
              ],
              "additionalProperties": false
            },
            "outputSchema": {
              "type": "object",
              "required": [
                "ok",
                "data",
                "_meta"
              ],
              "properties": {
                "ok": {
                  "type": "boolean",
                  "const": true
                },
                "data": {
                  "type": "object",
                  "description": "Deterministic structured tool result payload."
                },
                "_meta": {
                  "type": "object",
                  "required": [
                    "requestId",
                    "durationMs",
                    "chargedUsd",
                    "dryRun"
                  ],
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "durationMs": {
                      "type": "number"
                    },
                    "chargedUsd": {
                      "type": "string"
                    },
                    "dryRun": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  ]
}