@mindstone/mcp-server-xero 0.1.0 → 0.1.1

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.
Files changed (63) hide show
  1. package/dist/tools/create/create-bank-transaction.tool.js +2 -1
  2. package/dist/tools/create/create-contact.tool.js +2 -0
  3. package/dist/tools/create/create-credit-note.tool.js +1 -0
  4. package/dist/tools/create/create-invoice.tool.js +1 -0
  5. package/dist/tools/create/create-item.tool.js +1 -0
  6. package/dist/tools/create/create-manual-journal.tool.js +2 -0
  7. package/dist/tools/create/create-payment.tool.js +1 -0
  8. package/dist/tools/create/create-payroll-timesheet.tool.js +1 -0
  9. package/dist/tools/create/create-purchase-order.tool.js +1 -0
  10. package/dist/tools/create/create-quote.tool.js +1 -0
  11. package/dist/tools/create/create-tracking-category.tool.js +2 -1
  12. package/dist/tools/create/create-tracking-options.tool.js +2 -1
  13. package/dist/tools/delete/delete-payroll-timesheet.tool.js +1 -0
  14. package/dist/tools/get/get-invoice-attachment.tool.js +1 -0
  15. package/dist/tools/get/get-payroll-timesheet.tool.js +1 -0
  16. package/dist/tools/history/index.js +2 -0
  17. package/dist/tools/list/list-accounts.tool.js +1 -0
  18. package/dist/tools/list/list-aged-payables-by-contact.tool.js +1 -0
  19. package/dist/tools/list/list-aged-receivables-by-contact.tool.js +1 -0
  20. package/dist/tools/list/list-bank-summary.tool.js +1 -0
  21. package/dist/tools/list/list-bank-transactions.tool.js +2 -1
  22. package/dist/tools/list/list-budget-summary.tool.js +1 -0
  23. package/dist/tools/list/list-contact-groups.tool.js +1 -0
  24. package/dist/tools/list/list-contacts.tool.js +1 -0
  25. package/dist/tools/list/list-credit-notes.tool.js +1 -0
  26. package/dist/tools/list/list-currencies.tool.js +1 -0
  27. package/dist/tools/list/list-executive-summary.tool.js +1 -0
  28. package/dist/tools/list/list-invoice-attachments.tool.js +1 -0
  29. package/dist/tools/list/list-invoices.tool.js +1 -0
  30. package/dist/tools/list/list-items.tool.js +1 -0
  31. package/dist/tools/list/list-manual-journals.tool.js +1 -0
  32. package/dist/tools/list/list-organisation-details.tool.js +1 -0
  33. package/dist/tools/list/list-payments.tool.js +1 -0
  34. package/dist/tools/list/list-payroll-employee-leave-balances.tool.js +1 -0
  35. package/dist/tools/list/list-payroll-employee-leave-types.tool.js +1 -0
  36. package/dist/tools/list/list-payroll-employee-leave.tool.js +1 -0
  37. package/dist/tools/list/list-payroll-employees.tool.js +1 -0
  38. package/dist/tools/list/list-payroll-leave-periods.tool.js +1 -0
  39. package/dist/tools/list/list-payroll-leave-types.tool.js +1 -0
  40. package/dist/tools/list/list-payroll-timesheets.tool.js +1 -0
  41. package/dist/tools/list/list-profit-and-loss.tool.js +1 -0
  42. package/dist/tools/list/list-purchase-orders.tool.js +1 -0
  43. package/dist/tools/list/list-quotes.tool.js +1 -0
  44. package/dist/tools/list/list-report-balance-sheet.tool.js +1 -0
  45. package/dist/tools/list/list-tax-rates.tool.js +1 -0
  46. package/dist/tools/list/list-tracking-categories.tool.js +2 -1
  47. package/dist/tools/list/list-trial-balance.tool.js +1 -0
  48. package/dist/tools/update/approve-payroll-timesheet.tool.js +1 -0
  49. package/dist/tools/update/email-invoice.tool.js +1 -0
  50. package/dist/tools/update/revert-payroll-timesheet.tool.js +1 -0
  51. package/dist/tools/update/update-bank-transaction.tool.js +1 -0
  52. package/dist/tools/update/update-contact.tool.js +2 -0
  53. package/dist/tools/update/update-credit-note.tool.js +1 -0
  54. package/dist/tools/update/update-invoice.tool.js +1 -0
  55. package/dist/tools/update/update-item.tool.js +1 -0
  56. package/dist/tools/update/update-manual-journal-tool.js +2 -0
  57. package/dist/tools/update/update-payroll-timesheet-add-line.tool.js +1 -0
  58. package/dist/tools/update/update-payroll-timesheet-update-line.tool.js +1 -0
  59. package/dist/tools/update/update-quote.tool.js +1 -0
  60. package/dist/tools/update/update-tracking-category.tool.js +2 -1
  61. package/dist/tools/update/update-tracking-options.tool.js +2 -1
  62. package/dist/untrusted-content.js +27 -16
  63. package/package.json +2 -2
@@ -30,7 +30,8 @@ const CreateBankTransactionTool = CreateXeroTool("create-bank-transaction", `Cre
30
30
  type: "text",
31
31
  text: `Error creating bank transaction: ${result.error}`
32
32
  }
33
- ]
33
+ ],
34
+ isError: true,
34
35
  };
35
36
  }
36
37
  const bankTransaction = result.result;
@@ -21,6 +21,7 @@ const CreateContactTool = CreateXeroTool("create-contact", "Create a contact in
21
21
  text: `Error creating contact: ${response.error}`,
22
22
  },
23
23
  ],
24
+ isError: true,
24
25
  };
25
26
  }
26
27
  const contact = response.result;
@@ -49,6 +50,7 @@ const CreateContactTool = CreateXeroTool("create-contact", "Create a contact in
49
50
  text: `Error creating contact: ${formatError(error)}`,
50
51
  },
51
52
  ],
53
+ isError: true,
52
54
  };
53
55
  }
54
56
  });
@@ -26,6 +26,7 @@ const CreateCreditNoteTool = CreateXeroTool("create-credit-note", "Create a cred
26
26
  text: `Error creating credit note: ${result.error}`,
27
27
  },
28
28
  ],
29
+ isError: true,
29
30
  };
30
31
  }
31
32
  const creditNote = result.result;
@@ -46,6 +46,7 @@ const CreateInvoiceTool = CreateXeroTool("create-invoice", "Create an invoice in
46
46
  text: `Error creating invoice: ${result.error}`,
47
47
  },
48
48
  ],
49
+ isError: true,
49
50
  };
50
51
  }
51
52
  const invoice = result.result;
@@ -39,6 +39,7 @@ const CreateItemTool = CreateXeroTool("create-item", "Create an item in Xero.",
39
39
  text: `Error creating item: ${result.error}`,
40
40
  },
41
41
  ],
42
+ isError: true,
42
43
  };
43
44
  }
44
45
  const item = result.result;
@@ -56,6 +56,7 @@ const CreateManualJournalTool = CreateXeroTool("create-manual-journal", "Create
56
56
  text: `Error creating manual journal: ${response.error}`,
57
57
  },
58
58
  ],
59
+ isError: true,
59
60
  };
60
61
  }
61
62
  const manualJournal = response.result;
@@ -109,6 +110,7 @@ const CreateManualJournalTool = CreateXeroTool("create-manual-journal", "Create
109
110
  text: `Error creating manual journal: ${formatError(error)}`,
110
111
  },
111
112
  ],
113
+ isError: true,
112
114
  };
113
115
  }
114
116
  });
@@ -43,6 +43,7 @@ const CreatePaymentTool = CreateXeroTool("create-payment", "Create a payment aga
43
43
  text: `Error creating payment: ${result.error}`,
44
44
  },
45
45
  ],
46
+ isError: true,
46
47
  };
47
48
  }
48
49
  const payment = result.result;
@@ -25,6 +25,7 @@ This allows you to specify details such as the employee ID, payroll calendar ID,
25
25
  text: `Error creating timesheet: ${response.error}`,
26
26
  },
27
27
  ],
28
+ isError: true,
28
29
  };
29
30
  }
30
31
  const timesheet = response.result;
@@ -35,6 +35,7 @@ const CreatePurchaseOrderTool = CreateXeroTool("create-purchase-order", "Create
35
35
  text: `Error creating purchase order: ${result.error}`,
36
36
  },
37
37
  ],
38
+ isError: true,
38
39
  };
39
40
  }
40
41
  const purchaseOrder = result.result;
@@ -30,6 +30,7 @@ const CreateQuoteTool = CreateXeroTool("create-quote", "Create a quote in Xero.\
30
30
  text: `Error creating quote: ${result.error}`,
31
31
  },
32
32
  ],
33
+ isError: true,
33
34
  };
34
35
  }
35
36
  const quote = result.result;
@@ -12,7 +12,8 @@ const CreateTrackingCategoryTool = CreateXeroTool("create-tracking-category", `C
12
12
  type: "text",
13
13
  text: `Error while creating tracking category: ${response.error}`
14
14
  }
15
- ]
15
+ ],
16
+ isError: true,
16
17
  };
17
18
  }
18
19
  const trackingCategory = response.result;
@@ -14,7 +14,8 @@ const CreateTrackingOptionsTool = CreateXeroTool("create-tracking-options", `Cre
14
14
  type: "text",
15
15
  text: `Error while creating tracking options: ${response.error}`
16
16
  }
17
- ]
17
+ ],
18
+ isError: true,
18
19
  };
19
20
  }
20
21
  const trackingOptions = response.result;
@@ -14,6 +14,7 @@ const DeletePayrollTimesheetTool = CreateXeroTool("delete-timesheet", `Delete an
14
14
  text: `Error deleting timesheet: ${response.error}`,
15
15
  },
16
16
  ],
17
+ isError: true,
17
18
  };
18
19
  }
19
20
  return {
@@ -23,6 +23,7 @@ Requires the accounting.attachments.read scope on the Xero Custom Connection.`,
23
23
  text: `Error downloading attachment: ${response.error}`,
24
24
  },
25
25
  ],
26
+ isError: true,
26
27
  };
27
28
  }
28
29
  const result = response.result;
@@ -15,6 +15,7 @@ This provides details such as the timesheet ID, employee ID, start and end dates
15
15
  text: `Error retrieving timesheet: ${response.error}`,
16
16
  },
17
17
  ],
18
+ isError: true,
18
19
  };
19
20
  }
20
21
  const timesheet = response.result;
@@ -73,6 +73,7 @@ function createGetHistoryTool(def) {
73
73
  text: `Error retrieving ${def.entity} history: ${response.error}`,
74
74
  },
75
75
  ],
76
+ isError: true,
76
77
  };
77
78
  }
78
79
  const records = response.result;
@@ -115,6 +116,7 @@ function createAddNoteTool(def) {
115
116
  text: `Error adding note to ${def.entity}: ${response.error}`,
116
117
  },
117
118
  ],
119
+ isError: true,
118
120
  };
119
121
  }
120
122
  const record = response.result;
@@ -10,6 +10,7 @@ const ListAccountsTool = CreateXeroTool("list-accounts", "Lists all accounts in
10
10
  text: `Error listing accounts: ${response.error}`,
11
11
  },
12
12
  ],
13
+ isError: true,
13
14
  };
14
15
  }
15
16
  const accounts = response.result;
@@ -21,6 +21,7 @@ const ListAgedPayablesByContact = CreateXeroTool("list-aged-payables-by-contact"
21
21
  text: `Error listing aged payables by contact: ${response.error}`,
22
22
  },
23
23
  ],
24
+ isError: true,
24
25
  };
25
26
  }
26
27
  const agedPayablesReport = response.result;
@@ -21,6 +21,7 @@ const ListAgedReceivablesByContact = CreateXeroTool("list-aged-receivables-by-co
21
21
  text: `Error listing aged receivables by contact: ${response.error}`,
22
22
  },
23
23
  ],
24
+ isError: true,
24
25
  };
25
26
  }
26
27
  const agedReceivablesReport = response.result;
@@ -22,6 +22,7 @@ const ListBankSummaryTool = CreateXeroTool("list-bank-summary", "Get the bank su
22
22
  text: `Error getting bank summary report: ${response.error}`,
23
23
  },
24
24
  ],
25
+ isError: true,
25
26
  };
26
27
  }
27
28
  const report = response.result;
@@ -24,7 +24,8 @@ COMMON MISTAKES:
24
24
  type: "text",
25
25
  text: `Error listing bank transactions: ${response.error}`
26
26
  }
27
- ]
27
+ ],
28
+ isError: true,
28
29
  };
29
30
  }
30
31
  const bankTransactions = response.result;
@@ -28,6 +28,7 @@ const ListBudgetSummaryTool = CreateXeroTool("list-budget-summary", "Get the bud
28
28
  text: `Error getting budget summary report: ${response.error}`,
29
29
  },
30
30
  ],
31
+ isError: true,
31
32
  };
32
33
  }
33
34
  const report = response.result;
@@ -17,6 +17,7 @@ const ListContactGroupsTool = CreateXeroTool("list-contact-groups", `List all co
17
17
  text: `Error listing contact groups: ${response.error}`,
18
18
  },
19
19
  ],
20
+ isError: true,
20
21
  };
21
22
  }
22
23
  const contactGroups = response.result;
@@ -17,6 +17,7 @@ const ListContactsTool = CreateXeroTool("list-contacts", "List all contacts in X
17
17
  text: `Error listing contacts: ${response.error}`,
18
18
  },
19
19
  ],
20
+ isError: true,
20
21
  };
21
22
  }
22
23
  const contacts = response.result;
@@ -24,6 +24,7 @@ COMMON MISTAKES:
24
24
  text: `Error listing credit notes: ${response.error}`,
25
25
  },
26
26
  ],
27
+ isError: true,
27
28
  };
28
29
  }
29
30
  const creditNotes = response.result;
@@ -10,6 +10,7 @@ const ListCurrenciesTool = CreateXeroTool("list-currencies", "Lists currencies e
10
10
  text: `Error listing currencies: ${response.error}`,
11
11
  },
12
12
  ],
13
+ isError: true,
13
14
  };
14
15
  }
15
16
  const currencies = response.result;
@@ -17,6 +17,7 @@ const ListExecutiveSummaryTool = CreateXeroTool("list-executive-summary", "Get t
17
17
  text: `Error getting executive summary report: ${response.error}`,
18
18
  },
19
19
  ],
20
+ isError: true,
20
21
  };
21
22
  }
22
23
  const report = response.result;
@@ -16,6 +16,7 @@ const ListInvoiceAttachmentsTool = CreateXeroTool("list-invoice-attachments", "L
16
16
  text: `Error listing invoice attachments: ${response.error}`,
17
17
  },
18
18
  ],
19
+ isError: true,
19
20
  };
20
21
  }
21
22
  const attachments = response.result;
@@ -75,6 +75,7 @@ COMMON MISTAKES:
75
75
  text: `Error listing invoices: ${response.error}`,
76
76
  },
77
77
  ],
78
+ isError: true,
78
79
  };
79
80
  }
80
81
  const invoices = response.result;
@@ -17,6 +17,7 @@ COMMON MISTAKES:
17
17
  text: `Error listing items: ${response.error}`,
18
18
  },
19
19
  ],
20
+ isError: true,
20
21
  };
21
22
  }
22
23
  const items = response.result;
@@ -31,6 +31,7 @@ COMMON MISTAKES:
31
31
  text: `Error listing manual journals: ${response.error}`,
32
32
  },
33
33
  ],
34
+ isError: true,
34
35
  };
35
36
  }
36
37
  const manualJournals = response.result;
@@ -11,6 +11,7 @@ const ListOrganisationDetailsTool = CreateXeroTool("list-organisation-details",
11
11
  text: `Error fetching organisation details: ${response.error || "Unknown error"}`,
12
12
  },
13
13
  ],
14
+ isError: true,
14
15
  };
15
16
  }
16
17
  const organisation = response.result;
@@ -65,6 +65,7 @@ COMMON MISTAKES:
65
65
  text: `Error listing payments: ${response.error}`,
66
66
  },
67
67
  ],
68
+ isError: true,
68
69
  };
69
70
  }
70
71
  const payments = response.result;
@@ -13,6 +13,7 @@ const ListPayrollEmployeeLeaveBalancesTool = CreateXeroTool("list-payroll-employ
13
13
  text: `Error listing employee leave balances: ${response.error}`,
14
14
  },
15
15
  ],
16
+ isError: true,
16
17
  };
17
18
  }
18
19
  const leaveBalances = response.result;
@@ -15,6 +15,7 @@ const ListPayrollEmployeeLeaveTypesTool = CreateXeroTool("list-payroll-employee-
15
15
  text: `Error listing employee leave types: ${response.error}`,
16
16
  },
17
17
  ],
18
+ isError: true,
18
19
  };
19
20
  }
20
21
  const leaveTypes = response.result;
@@ -13,6 +13,7 @@ const ListPayrollEmployeeLeaveTool = CreateXeroTool("list-payroll-employee-leave
13
13
  text: `Error listing employee leave: ${response.error}`,
14
14
  },
15
15
  ],
16
+ isError: true,
16
17
  };
17
18
  }
18
19
  const leave = response.result;
@@ -12,6 +12,7 @@ The response presents a complete overview of all staff currently registered in y
12
12
  text: `Error listing payroll employees: ${response.error}`,
13
13
  },
14
14
  ],
15
+ isError: true,
15
16
  };
16
17
  }
17
18
  const employees = response.result;
@@ -15,6 +15,7 @@ const ListPayrollLeavePeriodsToolTool = CreateXeroTool("list-payroll-leave-perio
15
15
  text: `Error listing employee leave periods: ${response.error}`,
16
16
  },
17
17
  ],
18
+ isError: true,
18
19
  };
19
20
  }
20
21
  const periods = response.result;
@@ -10,6 +10,7 @@ const ListPayrollLeaveTypesTool = CreateXeroTool("list-payroll-leave-types", "Li
10
10
  text: `Error listing payroll leave types: ${response.error}`,
11
11
  },
12
12
  ],
13
+ isError: true,
13
14
  };
14
15
  }
15
16
  const leaveTypes = response.result;
@@ -11,6 +11,7 @@ This retrieves comprehensive timesheet details including timesheet IDs, employee
11
11
  text: `Error listing timesheets: ${response.error}`,
12
12
  },
13
13
  ],
14
+ isError: true,
14
15
  };
15
16
  }
16
17
  const timesheets = response.result;
@@ -18,6 +18,7 @@ const ListProfitAndLossTool = CreateXeroTool("list-profit-and-loss", "Lists prof
18
18
  text: `Error listing profit and loss report: ${response.error}`,
19
19
  },
20
20
  ],
21
+ isError: true,
21
22
  };
22
23
  }
23
24
  const profitAndLossReport = response.result;
@@ -54,6 +54,7 @@ PAGINATION: If results returned equals pageSize, there may be more pages. Call a
54
54
  text: `Error listing purchase orders: ${response.error}`,
55
55
  },
56
56
  ],
57
+ isError: true,
57
58
  };
58
59
  }
59
60
  const purchaseOrders = response.result;
@@ -22,6 +22,7 @@ COMMON MISTAKES:
22
22
  text: `Error listing quotes: ${response.error}`,
23
23
  },
24
24
  ],
25
+ isError: true,
25
26
  };
26
27
  }
27
28
  const quotes = response.result;
@@ -20,6 +20,7 @@ const ListReportBalanceSheetTool = CreateXeroTool("list-report-balance-sheet", "
20
20
  text: `Error listing balance sheet report: ${response.error}`,
21
21
  },
22
22
  ],
23
+ isError: true,
23
24
  };
24
25
  }
25
26
  const balanceSheetReport = response.result;
@@ -10,6 +10,7 @@ const ListTaxRatesTool = CreateXeroTool("list-tax-rates", "Lists all tax rates i
10
10
  text: `Error listing tax rates: ${response.error}`,
11
11
  },
12
12
  ],
13
+ isError: true,
13
14
  };
14
15
  }
15
16
  const taxRates = response.result;
@@ -14,7 +14,8 @@ const ListTrackingCategoriesTool = CreateXeroTool("list-tracking-categories", "L
14
14
  type: "text",
15
15
  text: `Error listing tracking categories: ${response.error}`
16
16
  }
17
- ]
17
+ ],
18
+ isError: true,
18
19
  };
19
20
  }
20
21
  const trackingCategories = response.result;
@@ -14,6 +14,7 @@ const ListTrialBalanceTool = CreateXeroTool("list-trial-balance", "Lists trial b
14
14
  text: `Error listing trial balance: ${response.error}`,
15
15
  },
16
16
  ],
17
+ isError: true,
17
18
  };
18
19
  }
19
20
  const trialBalanceReport = response.result;
@@ -14,6 +14,7 @@ const ApprovePayrollTimesheetTool = CreateXeroTool("approve-timesheet", `Approve
14
14
  text: `Error approving timesheet: ${response.error}`,
15
15
  },
16
16
  ],
17
+ isError: true,
17
18
  };
18
19
  }
19
20
  const timesheet = response.result;
@@ -15,6 +15,7 @@ const EmailInvoiceTool = CreateXeroTool("email-invoice", "Email a copy of an inv
15
15
  text: `Error emailing invoice: ${response.error}`,
16
16
  },
17
17
  ],
18
+ isError: true,
18
19
  };
19
20
  }
20
21
  return {
@@ -14,6 +14,7 @@ const RevertPayrollTimesheetTool = CreateXeroTool("revert-timesheet", `Revert a
14
14
  text: `Error reverting timesheet: ${response.error}`,
15
15
  },
16
16
  ],
17
+ isError: true,
17
18
  };
18
19
  }
19
20
  const timesheet = response.result;
@@ -30,6 +30,7 @@ const UpdateBankTransactionTool = CreateXeroTool("update-bank-transaction", `Upd
30
30
  text: `Error updating bank transaction: ${result.error}`,
31
31
  },
32
32
  ],
33
+ isError: true,
33
34
  };
34
35
  }
35
36
  const bankTransaction = result.result;
@@ -34,6 +34,7 @@ const UpdateContactTool = CreateXeroTool("update-contact", "Update a contact in
34
34
  text: `Error updating contact: ${response.error}`,
35
35
  },
36
36
  ],
37
+ isError: true,
37
38
  };
38
39
  }
39
40
  const contact = response.result;
@@ -62,6 +63,7 @@ const UpdateContactTool = CreateXeroTool("update-contact", "Update a contact in
62
63
  text: `Error updating contact: ${formatError(error)}`,
63
64
  },
64
65
  ],
66
+ isError: true,
65
67
  };
66
68
  }
67
69
  });
@@ -31,6 +31,7 @@ const UpdateCreditNoteTool = CreateXeroTool("update-credit-note", "Update a cred
31
31
  text: `Error updating credit note: ${result.error}`,
32
32
  },
33
33
  ],
34
+ isError: true,
34
35
  };
35
36
  }
36
37
  const creditNote = result.result;
@@ -47,6 +47,7 @@ const UpdateInvoiceTool = CreateXeroTool("update-invoice", "Update an invoice in
47
47
  text: `Error updating invoice: ${result.error}`,
48
48
  },
49
49
  ],
50
+ isError: true,
50
51
  };
51
52
  }
52
53
  const invoice = result.result;
@@ -40,6 +40,7 @@ const UpdateItemTool = CreateXeroTool("update-item", "Update an item in Xero.",
40
40
  text: `Error updating item: ${result.error}`,
41
41
  },
42
42
  ],
43
+ isError: true,
43
44
  };
44
45
  }
45
46
  const item = result.result;
@@ -54,6 +54,7 @@ const UpdateManualJournalTool = CreateXeroTool("update-manual-journal", "Update
54
54
  text: `Error updating manual journal: ${response.error}`,
55
55
  },
56
56
  ],
57
+ isError: true,
57
58
  };
58
59
  }
59
60
  const manualJournal = response.result;
@@ -82,6 +83,7 @@ const UpdateManualJournalTool = CreateXeroTool("update-manual-journal", "Update
82
83
  text: `Error updating manual journal: ${formatError(error)}`,
83
84
  },
84
85
  ],
86
+ isError: true,
85
87
  };
86
88
  }
87
89
  });
@@ -19,6 +19,7 @@ const AddTimesheetLineTool = CreateXeroTool("add-timesheet-line", `Add a new tim
19
19
  text: `Error adding timesheet line: ${response.error}`,
20
20
  },
21
21
  ],
22
+ isError: true,
22
23
  };
23
24
  }
24
25
  const newLine = response.result;
@@ -20,6 +20,7 @@ const UpdatePayrollTimesheetLineTool = CreateXeroTool("update-timesheet-line", `
20
20
  text: `Error updating timesheet line: ${response.error}`,
21
21
  },
22
22
  ],
23
+ isError: true,
23
24
  };
24
25
  }
25
26
  const updatedLine = response.result;
@@ -36,6 +36,7 @@ const UpdateQuoteTool = CreateXeroTool("update-quote", "Update a quote in Xero.
36
36
  text: `Error updating quote: ${result.error}`,
37
37
  },
38
38
  ],
39
+ isError: true,
39
40
  };
40
41
  }
41
42
  const quote = result.result;
@@ -14,7 +14,8 @@ const UpdateTrackingCategoryTool = CreateXeroTool("update-tracking-category", `U
14
14
  type: "text",
15
15
  text: `Error while updating tracking category: ${response.error}`
16
16
  }
17
- ]
17
+ ],
18
+ isError: true,
18
19
  };
19
20
  }
20
21
  const trackingCategory = response.result;
@@ -19,7 +19,8 @@ const UpdateTrackingOptionsTool = CreateXeroTool("update-tracking-options", `Upd
19
19
  type: "text",
20
20
  text: `Error while creating tracking options: ${response.error}`
21
21
  }
22
- ]
22
+ ],
23
+ isError: true,
23
24
  };
24
25
  }
25
26
  const trackingOptions = response.result;
@@ -18,34 +18,44 @@
18
18
  * `untrusted-content` in any connector that talks to an external system; this
19
19
  * file (and the call sites that import from it) is what satisfies that gate.
20
20
  */
21
- const UNTRUSTED_CLOSE_TAG_VARIANT = /<\/untrusted-content\s*>/gi;
21
+ const UNTRUSTED_CLOSE_TAG_VARIANT = /<\/untrusted-content(?:\s[^>]*)?>/gi;
22
22
  const ESCAPED_UNTRUSTED_CLOSE_TAG = '<\\/untrusted-content>';
23
+ const UNTRUSTED_OPEN_TAG_VARIANT = /<untrusted-content(?:\s[^>]*)?>/gi;
24
+ const ESCAPED_UNTRUSTED_OPEN_TAG = '<\\untrusted-content>';
23
25
  const UNTRUSTED_ENVELOPE = /^<untrusted-content source="[^"]*">([\s\S]*)<\/untrusted-content>$/;
24
26
  function escapeAttr(s) {
25
27
  return s.replaceAll('&', '&amp;').replaceAll('"', '&quot;').replaceAll('<', '&lt;').replaceAll('>', '&gt;');
26
28
  }
27
29
  /**
28
- * Rewrite every `</untrusted-content>` variant (case-insensitive, optional
29
- * whitespace before `>`) inside `s` to a benign textual form, so an attacker
30
- * who controls the wrapped content cannot terminate the envelope early.
30
+ * Rewrite every `</untrusted-content>` and `<untrusted-content …>` variant
31
+ * (case-insensitive, optional whitespace / attributes before `>`) inside `s`
32
+ * to a benign textual form, so an attacker who controls the wrapped content
33
+ * can neither terminate the envelope early nor spoof a nested open tag that a
34
+ * downstream parser could re-read as a fresh envelope. An LLM parsing the
35
+ * markup plausibly accepts attribute-bearing close forms such as
36
+ * `</untrusted-content foo>` — the matcher must cover them too.
31
37
  */
32
- function escapeCloseTagSentinels(s) {
33
- return s.replace(UNTRUSTED_CLOSE_TAG_VARIANT, ESCAPED_UNTRUSTED_CLOSE_TAG);
38
+ function escapeTagSentinels(s) {
39
+ return s
40
+ .replace(UNTRUSTED_OPEN_TAG_VARIANT, ESCAPED_UNTRUSTED_OPEN_TAG)
41
+ .replace(UNTRUSTED_CLOSE_TAG_VARIANT, ESCAPED_UNTRUSTED_CLOSE_TAG);
34
42
  }
35
- function unescapeCloseTagSentinels(s) {
36
- return s.replaceAll(ESCAPED_UNTRUSTED_CLOSE_TAG, '</untrusted-content>');
43
+ function unescapeTagSentinels(s) {
44
+ return s
45
+ .replaceAll(ESCAPED_UNTRUSTED_OPEN_TAG, '<untrusted-content>')
46
+ .replaceAll(ESCAPED_UNTRUSTED_CLOSE_TAG, '</untrusted-content>');
37
47
  }
38
48
  /**
39
49
  * Wrap a single untrusted string in an `<untrusted-content source="…">`
40
- * envelope, escaping any embedded close-tag variant so the envelope cannot be
41
- * broken out of.
50
+ * envelope, escaping any embedded open/close-tag variant so the envelope can
51
+ * neither be broken out of nor have a spoofed nested envelope planted inside.
42
52
  *
43
53
  * `undefined` and `null` are passed through untouched so callers can apply the wrapper
44
54
  * uniformly to optional fields without branching.
45
55
  *
46
56
  * Idempotent: when `text` is already a properly-shaped envelope for the SAME
47
57
  * `source` (starts with the matching OPEN tag, ends with CLOSE, and contains no
48
- * internal close-tag variants), the original string is returned unchanged so
58
+ * internal open/close-tag variants), the original string is returned unchanged so
49
59
  * `wrapUntrusted(wrapUntrusted(s, src), src) === wrapUntrusted(s, src)`.
50
60
  */
51
61
  export function wrapUntrusted(text, source) {
@@ -55,13 +65,14 @@ export function wrapUntrusted(text, source) {
55
65
  const close = '</untrusted-content>';
56
66
  if (text.startsWith(open) && text.endsWith(close) && text.length >= open.length + close.length) {
57
67
  const inner = text.slice(open.length, text.length - close.length);
58
- if (!UNTRUSTED_CLOSE_TAG_VARIANT.test(inner)) {
59
- UNTRUSTED_CLOSE_TAG_VARIANT.lastIndex = 0; // reset stateful /g regex
68
+ const hasVariant = UNTRUSTED_CLOSE_TAG_VARIANT.test(inner) || UNTRUSTED_OPEN_TAG_VARIANT.test(inner);
69
+ UNTRUSTED_CLOSE_TAG_VARIANT.lastIndex = 0; // reset stateful /g regexes
70
+ UNTRUSTED_OPEN_TAG_VARIANT.lastIndex = 0;
71
+ if (!hasVariant) {
60
72
  return text;
61
73
  }
62
- UNTRUSTED_CLOSE_TAG_VARIANT.lastIndex = 0;
63
74
  }
64
- return `${open}${escapeCloseTagSentinels(text)}${close}`;
75
+ return `${open}${escapeTagSentinels(text)}${close}`;
65
76
  }
66
77
  /**
67
78
  * Strip one `<untrusted-content>` envelope from `text` if present, returning raw
@@ -73,7 +84,7 @@ export function unwrapUntrusted(text) {
73
84
  const match = UNTRUSTED_ENVELOPE.exec(text);
74
85
  if (!match)
75
86
  return text;
76
- return unescapeCloseTagSentinels(match[1]);
87
+ return unescapeTagSentinels(match[1]);
77
88
  }
78
89
  /**
79
90
  * Recursively wrap every string key and value reachable inside `value` (strings,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindstone/mcp-server-xero",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "mcpName": "io.github.mindstone/mcp-server-xero",
5
5
  "description": "Xero MCP server for invoices, contacts, payments, quotes, and financial reports",
6
6
  "license": "MIT",
@@ -11,7 +11,7 @@
11
11
  "directory": "connectors/xero"
12
12
  },
13
13
  "homepage": "https://github.com/mindstone/mcp-servers/tree/main/connectors/xero",
14
- "author": "Xero (https://xero.com)",
14
+ "author": "Mindstone <support@mindstone.ai>",
15
15
  "type": "module",
16
16
  "bin": {
17
17
  "mcp-server-xero": "dist/index.js"