@teamnetwork-nz/xero-mcp-server 1.7.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,7 +8,11 @@ const ListContactsTool = CreateXeroTool("list-contacts", "List contacts from Xer
|
|
|
8
8
|
"Common patterns: " +
|
|
9
9
|
"find a customer by name → searchTerm=<name>, contactRole=customer; " +
|
|
10
10
|
"all active suppliers → contactRole=supplier, status=ACTIVE; " +
|
|
11
|
-
"recently updated contacts → fromDate=<date>."
|
|
11
|
+
"recently updated contacts → fromDate=<date>. " +
|
|
12
|
+
"Each contact in the response includes: name, contactID, firstName, lastName, emailAddress, " +
|
|
13
|
+
"accountNumber (user-defined), taxNumber (NZBN/ABN/VAT), isCustomer/isSupplier flags, " +
|
|
14
|
+
"phones (type + number, short form), addresses (type + line1/city/region/postcode/country, short form), " +
|
|
15
|
+
"AR/AP tax types, defaultCurrency, contactStatus, contactGroups, and lastUpdated.", {
|
|
12
16
|
page: z.number().optional().describe("Page number for pagination (starts at 1)."),
|
|
13
17
|
searchTerm: z.string().optional().describe("Case-insensitive search across Name, FirstName, LastName, ContactNumber, EmailAddress. Use this instead of listing all contacts."),
|
|
14
18
|
contactRole: z.enum(["customer", "supplier"]).optional().describe("Filter to customers only (IsCustomer==true) or suppliers only (IsSupplier==true). Use customer for AR work, supplier for AP work."),
|
|
@@ -46,6 +50,28 @@ const ListContactsTool = CreateXeroTool("list-contacts", "List contacts from Xer
|
|
|
46
50
|
contact.emailAddress
|
|
47
51
|
? `Email: ${contact.emailAddress}`
|
|
48
52
|
: "No email",
|
|
53
|
+
contact.accountNumber ? `Account Number: ${contact.accountNumber}` : null,
|
|
54
|
+
contact.taxNumber ? `Tax Number: ${contact.taxNumber}` : null,
|
|
55
|
+
contact.phones?.filter((p) => p.phoneNumber).length
|
|
56
|
+
? `Phones:\n${contact.phones
|
|
57
|
+
.filter((p) => p.phoneNumber)
|
|
58
|
+
.map((p) => {
|
|
59
|
+
const num = [p.phoneCountryCode, p.phoneAreaCode, p.phoneNumber]
|
|
60
|
+
.filter(Boolean)
|
|
61
|
+
.join(" ");
|
|
62
|
+
return ` [${p.phoneType ?? "DEFAULT"}] ${num}`;
|
|
63
|
+
})
|
|
64
|
+
.join("\n")}`
|
|
65
|
+
: null,
|
|
66
|
+
contact.addresses?.filter((a) => a.addressLine1 || a.city || a.country).length
|
|
67
|
+
? `Addresses:\n${contact.addresses
|
|
68
|
+
.filter((a) => a.addressLine1 || a.city || a.country)
|
|
69
|
+
.map((a) => {
|
|
70
|
+
const parts = [a.addressLine1, a.city, a.region, a.postalCode, a.country].filter(Boolean);
|
|
71
|
+
return ` [${a.addressType ?? "UNKNOWN"}] ${parts.join(", ")}`;
|
|
72
|
+
})
|
|
73
|
+
.join("\n")}`
|
|
74
|
+
: null,
|
|
49
75
|
contact.accountsReceivableTaxType
|
|
50
76
|
? `AR Tax Type: ${contact.accountsReceivableTaxType}`
|
|
51
77
|
: null,
|