@tenkeybridge/mcp 0.3.0 → 0.5.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.
package/dist/index.cjs CHANGED
@@ -144,14 +144,14 @@ var CATALOG = {
144
144
  "group": "gaps",
145
145
  "read": "none",
146
146
  "write": "none",
147
- "headline": "QuickBooks Desktop's qbXML API has no attachments interface \u2014 the word 'Attachment' does not occur anywhere in the qbxmlops130 message set.",
147
+ "headline": "Unsupported on QuickBooks Desktop, with no opt-in and no workaround inside TenkeyBridge. qbXML has no attachments interface (the word 'Attachment' does not occur anywhere in the qbxmlops130 message set), and TenkeyBridge does not store files itself.",
148
148
  "fields": [],
149
149
  "unsupported": [
150
150
  {
151
151
  "case": "read",
152
152
  "error": "UNSUPPORTED_BY_DESKTOP",
153
153
  "note": "Re-audited 2026-07-29: zero occurrences of any attachment message (no AttachmentAdd/Query/Ref of any kind) across the full qbxmlops130 schema. Desktop's Attached Documents feature is UI-only; files attached in Desktop cannot be listed or fetched through TenkeyBridge.",
154
- "workaround": "Store documents in your own system keyed by the TenkeyBridge entity Id \u2014 that is what QBD integrations have always had to do."
154
+ "workaround": "Store documents in your own system keyed by the TenkeyBridge entity Id, which is what QuickBooks Desktop integrations have always had to do. Branch on UNSUPPORTED_BY_DESKTOP and skip the Attachable call for Desktop-backed companies."
155
155
  },
156
156
  {
157
157
  "case": "query",
@@ -182,7 +182,7 @@ var CATALOG = {
182
182
  "read": "full",
183
183
  "write": "full",
184
184
  "headline": "Batch envelope \u2014 up to 30 create/update/delete/query operations in one request, executed sequentially with per-item faults.",
185
- "usage": "POST /v3/company/{realmId}/batch",
185
+ "usage": "POST /v3/company/{companyId}/batch",
186
186
  "fields": [
187
187
  {
188
188
  "qbo": "bId",
@@ -229,7 +229,7 @@ var CATALOG = {
229
229
  {
230
230
  "case": "entity CRUD or /query on Batch itself",
231
231
  "error": "UNSUPPORTED_BY_DESKTOP",
232
- "note": "Batch is a platform endpoint, not an entity \u2014 POST /v3/company/{realmId}/batch."
232
+ "note": "Batch is a platform endpoint, not an entity \u2014 POST /v3/company/{companyId}/batch."
233
233
  }
234
234
  ]
235
235
  },
@@ -442,7 +442,7 @@ var CATALOG = {
442
442
  "case": "query \u2014 SELECT * cannot enumerate every budget",
443
443
  "error": "UNSUPPORTED_QUERY",
444
444
  "note": "qbXML cannot list budgets: BudgetSummaryReportQueryRq requires a FiscalYear. SELECT * FROM Budget probes a fixed window \u2014 the current calendar year, the one before it, and the one after it \u2014 against both statement types (six report requests in one round-trip) and returns the ones that come back with budgeted amounts. A budget outside that window is invisible to SELECT *. Because the probe is speculative, the query never faults on an individual report's status: a company with no budgets gets an empty list, exactly as QBO answers. GET by id has one report and does surface its status.",
445
- "workaround": "Fetch it by id: GET /v3/company/{realmId}/budget/{fiscalYear}-{BudgetType}, e.g. 2023-ProfitAndLoss, which issues exactly one report request for that year."
445
+ "workaround": "Fetch it by id: GET /v3/company/{companyId}/budget/{fiscalYear}-{BudgetType}, e.g. 2023-ProfitAndLoss, which issues exactly one report request for that year."
446
446
  },
447
447
  {
448
448
  "case": "query \u2014 WHERE on anything but Id, ORDERBY, COUNT(*), column lists",
@@ -491,7 +491,7 @@ var CATALOG = {
491
491
  "read": "full",
492
492
  "write": "none",
493
493
  "headline": "Change Data Capture \u2014 one poll returns changed + deleted records across entities.",
494
- "usage": "GET /v3/company/{realmId}/cdc?entities=Invoice,Customer&changedSince=2026-07-01",
494
+ "usage": "GET /v3/company/{companyId}/cdc?entities=Invoice,Customer&changedSince=2026-07-01",
495
495
  "fields": [
496
496
  {
497
497
  "qbo": "entities",
@@ -608,7 +608,7 @@ var CATALOG = {
608
608
  "group": "company",
609
609
  "read": "full",
610
610
  "write": "none",
611
- "headline": "Read-only; Id equals the realm ID, no Desktop write path",
611
+ "headline": "Read-only; Id equals the Company ID, no Desktop write path",
612
612
  "fields": [
613
613
  {
614
614
  "qbo": "CompanyName",
@@ -748,6 +748,17 @@ var CATALOG = {
748
748
  "qbo": "CustomerRef",
749
749
  "support": "full"
750
750
  },
751
+ {
752
+ "qbo": "ClassRef",
753
+ "support": "full",
754
+ "note": "Header-level class (Desktop ClassRef, read and write). Line-level ClassRef is separate."
755
+ },
756
+ {
757
+ "qbo": "DepartmentRef",
758
+ "support": "none",
759
+ "note": "UNMAPPED_FIELD by default. With Departments from classes turned on for the company file, the gateway maps it to the header ClassRef (written to it, read from it); sending a different ClassRef as well is a 400.",
760
+ "error": "UNMAPPED_FIELD"
761
+ },
751
762
  {
752
763
  "qbo": "TxnDate",
753
764
  "support": "full"
@@ -1039,35 +1050,84 @@ var CATALOG = {
1039
1050
  "group": "gaps",
1040
1051
  "read": "none",
1041
1052
  "write": "none",
1042
- "headline": "QBO Departments (locations) have no Desktop equivalent \u2014 the only 'Department'/'Location' strings in qbXML are free-text fields on Employee, FixedAsset, and Lead, and Desktop's one real dimensional list (Class) is already exposed faithfully as Class.",
1043
- "fields": [],
1053
+ "headline": "QuickBooks Desktop has no Department (location) list, so Department is unsupported by default. Opt in per company file with Departments from classes and Department becomes an alias of Class (DepartmentRef on a transaction becomes its header ClassRef).",
1054
+ "fields": [
1055
+ {
1056
+ "qbo": "Id",
1057
+ "support": "partial",
1058
+ "note": "Only with Departments from classes on: the Class ListID."
1059
+ },
1060
+ {
1061
+ "qbo": "Name",
1062
+ "support": "partial",
1063
+ "note": "Only with Departments from classes on: the Class Name (31 characters max)."
1064
+ },
1065
+ {
1066
+ "qbo": "SubDepartment",
1067
+ "support": "partial",
1068
+ "note": "Only with Departments from classes on: read-only, true when the class has a parent."
1069
+ },
1070
+ {
1071
+ "qbo": "ParentRef",
1072
+ "support": "partial",
1073
+ "note": "Only with Departments from classes on: the parent class."
1074
+ },
1075
+ {
1076
+ "qbo": "FullyQualifiedName",
1077
+ "support": "partial",
1078
+ "note": "Only with Departments from classes on: the class full name (Parent:Child). Read-only."
1079
+ },
1080
+ {
1081
+ "qbo": "Active",
1082
+ "support": "partial",
1083
+ "note": "Only with Departments from classes on: class IsActive. Deactivate with Active:false."
1084
+ },
1085
+ {
1086
+ "qbo": "SyncToken",
1087
+ "support": "partial",
1088
+ "note": "Only with Departments from classes on: the class EditSequence."
1089
+ },
1090
+ {
1091
+ "qbo": "MetaData",
1092
+ "support": "partial",
1093
+ "note": "Only with Departments from classes on: class TimeCreated / TimeModified."
1094
+ }
1095
+ ],
1044
1096
  "unsupported": [
1045
1097
  {
1046
1098
  "case": "read",
1047
1099
  "error": "UNSUPPORTED_BY_DESKTOP",
1048
- "note": "Re-audited 2026-07-29 against the qbxmlops130 message set: qbXML has no Department or Location list \u2014 no Add/Mod/Query message pair exists. The tokens only appear as plain STRTYPE fields (Employee.Department, FixedAsset.Location, Lead.Location), which are annotations, not a queryable list.",
1049
- "workaround": "If your integration treats QBO locations as just another dimension, remap DepartmentRef onto Class in your own code \u2014 Class is live in TenkeyBridge. We decided against a built-in Department\u2192Class alias, even opt-in: ClassRef already maps to Class, so aliasing would make two QBO fields silently write one Desktop list and collide when a client sends both."
1100
+ "note": "Off by default. Re-audited 2026-07-29 against the qbxmlops130 message set: qbXML has no Department or Location list (no Add/Mod/Query message pair). The tokens only appear as plain STRTYPE fields (Employee.Department, FixedAsset.Location, Lead.Location), which are annotations, not a queryable list.",
1101
+ "workaround": "Turn on Departments from classes for the company file (portal: company file page, Departments card; or PATCH /admin/v1/companies/{companyId}/settings with departmentsFromClasses: true). Department then reads your QuickBooks classes. See the Departments guide."
1050
1102
  },
1051
1103
  {
1052
1104
  "case": "query",
1053
1105
  "error": "UNSUPPORTED_BY_DESKTOP",
1054
- "note": "qbXML has no Department/Location list to query \u2014 confirmed absent from the qbxmlops130 message set.",
1055
- "workaround": "Query Class instead if you remap locations client-side; that remapping is your call, TenkeyBridge never reinterprets DepartmentRef silently."
1106
+ "note": "Off by default: no Department list to query. With Departments from classes on, SELECT ... FROM Department is run against Class and answered as Department; DepartmentRef in a transaction query means its ClassRef.",
1107
+ "workaround": "Turn on Departments from classes, or query Class directly."
1056
1108
  },
1057
1109
  {
1058
1110
  "case": "create",
1059
1111
  "error": "UNSUPPORTED_BY_DESKTOP",
1060
- "note": "Desktop has no Department create. Use Class if you need a dimensional axis on Desktop."
1112
+ "note": "Off by default. With Departments from classes on, creating a Department creates a Class (ParentRef makes it a sub-class).",
1113
+ "workaround": "Turn on Departments from classes, or create a Class."
1061
1114
  },
1062
1115
  {
1063
1116
  "case": "update",
1064
1117
  "error": "UNSUPPORTED_BY_DESKTOP",
1065
- "note": "Desktop has no Department update."
1118
+ "note": "Off by default. With Departments from classes on, an update edits the Class (sparse; Name, Active, ParentRef).",
1119
+ "workaround": "Turn on Departments from classes, or update the Class."
1066
1120
  },
1067
1121
  {
1068
1122
  "case": "delete",
1069
1123
  "error": "UNSUPPORTED_BY_DESKTOP",
1070
- "note": "Desktop has no Department delete."
1124
+ "note": "Always unsupported: a Desktop class cannot be deleted through qbXML. Deactivate with Active:false."
1125
+ },
1126
+ {
1127
+ "case": "DepartmentRef on a transaction",
1128
+ "error": "UNSUPPORTED_BY_DESKTOP",
1129
+ "note": "With Departments from classes on it maps to the header ClassRef on Invoice, SalesReceipt, Estimate, CreditMemo, PurchaseOrder and TimeActivity. Sending a different ClassRef as well is a 400. Bill, Purchase, VendorCredit, JournalEntry, Deposit, RefundReceipt and Transfer have no header class in QuickBooks Desktop (class lives on the lines), so DepartmentRef there is a 422 that says to set ClassRef per line. Off: UNMAPPED_FIELD.",
1130
+ "workaround": "Set ClassRef on each line for those transactions."
1071
1131
  }
1072
1132
  ]
1073
1133
  },
@@ -1242,8 +1302,8 @@ var CATALOG = {
1242
1302
  "group": "platform",
1243
1303
  "read": "partial",
1244
1304
  "write": "none",
1245
- "headline": "GET /v3/company/{realmId}/entitlements \u2014 a static, honest capability document for a QuickBooks Desktop company (no per-file subscription data).",
1246
- "usage": "GET /v3/company/{realmId}/entitlements",
1305
+ "headline": "GET /v3/company/{companyId}/entitlements \u2014 a static, honest capability document for a QuickBooks Desktop company (no per-file subscription data).",
1306
+ "usage": "GET /v3/company/{companyId}/entitlements",
1247
1307
  "fields": [
1248
1308
  {
1249
1309
  "qbo": "Entitlements.platform",
@@ -1276,6 +1336,17 @@ var CATALOG = {
1276
1336
  "qbo": "CustomerRef",
1277
1337
  "support": "full"
1278
1338
  },
1339
+ {
1340
+ "qbo": "ClassRef",
1341
+ "support": "full",
1342
+ "note": "Header-level class (Desktop ClassRef, read and write). Line-level ClassRef is separate."
1343
+ },
1344
+ {
1345
+ "qbo": "DepartmentRef",
1346
+ "support": "none",
1347
+ "note": "UNMAPPED_FIELD by default. With Departments from classes turned on for the company file, the gateway maps it to the header ClassRef (written to it, read from it); sending a different ClassRef as well is a 400.",
1348
+ "error": "UNMAPPED_FIELD"
1349
+ },
1279
1350
  {
1280
1351
  "qbo": "TxnDate",
1281
1352
  "support": "full"
@@ -1505,6 +1576,17 @@ var CATALOG = {
1505
1576
  "qbo": "CustomerRef",
1506
1577
  "support": "full"
1507
1578
  },
1579
+ {
1580
+ "qbo": "ClassRef",
1581
+ "support": "full",
1582
+ "note": "Header-level class (Desktop ClassRef, read and write). Line-level ClassRef is separate."
1583
+ },
1584
+ {
1585
+ "qbo": "DepartmentRef",
1586
+ "support": "none",
1587
+ "note": "UNMAPPED_FIELD by default. With Departments from classes turned on for the company file, the gateway maps it to the header ClassRef (written to it, read from it); sending a different ClassRef as well is a 400.",
1588
+ "error": "UNMAPPED_FIELD"
1589
+ },
1508
1590
  {
1509
1591
  "qbo": "TxnDate",
1510
1592
  "support": "full"
@@ -1985,7 +2067,7 @@ var CATALOG = {
1985
2067
  {
1986
2068
  "qbo": "AccountingInfoPrefs",
1987
2069
  "support": "partial",
1988
- "note": "ClassTrackingPerTxn/ClassTrackingPerTxnLine \u2190 IsUsingClassTracking (same bool projected to both); TrackDepartments always false (no Desktop Locations)."
2070
+ "note": "ClassTrackingPerTxn/ClassTrackingPerTxnLine \u2190 IsUsingClassTracking (same bool projected to both); TrackDepartments is false, or true when the company file has Departments from classes turned on (Department is then an alias of Class)."
1989
2071
  },
1990
2072
  {
1991
2073
  "qbo": "CurrencyPrefs",
@@ -2148,6 +2230,17 @@ var CATALOG = {
2148
2230
  "qbo": "VendorRef",
2149
2231
  "support": "full"
2150
2232
  },
2233
+ {
2234
+ "qbo": "ClassRef",
2235
+ "support": "full",
2236
+ "note": "Header-level class (Desktop ClassRef, read and write). Line-level ClassRef is separate."
2237
+ },
2238
+ {
2239
+ "qbo": "DepartmentRef",
2240
+ "support": "none",
2241
+ "note": "UNMAPPED_FIELD by default. With Departments from classes turned on for the company file, the gateway maps it to the header ClassRef (written to it, read from it); sending a different ClassRef as well is a 400.",
2242
+ "error": "UNMAPPED_FIELD"
2243
+ },
2151
2244
  {
2152
2245
  "qbo": "TxnDate",
2153
2246
  "support": "full"
@@ -2384,8 +2477,8 @@ var CATALOG = {
2384
2477
  "group": "platform",
2385
2478
  "read": "partial",
2386
2479
  "write": "none",
2387
- "headline": "Twenty QBO-compatible reports translated live from Desktop's report engine: summary, detail, aging, balance and sales reports, all run against QuickBooks Enterprise 24. There is no CashFlow \u2014 Desktop's SDK has no cash-flow report.",
2388
- "usage": "GET /v3/company/{realmId}/reports/ProfitAndLoss?start_date=2026-01-01&end_date=2026-12-31&summarize_column_by=Month",
2480
+ "headline": "Forty-eight QBO-compatible reports served from QuickBooks Desktop: 24 translated live from Desktop's report engine (summary, detail, aging, balance, sales and sales-tax reports), 22 Desktop extension reports with no QBO twin, and two composites, AccountList (built from Desktop's account list) and CashFlow (built from several queries). CashFlow is derived, not translated: Desktop's SDK has no cash-flow report, so it is computed from Profit and Loss and two Trial Balances and checked against Desktop before it is returned.",
2481
+ "usage": "GET /v3/company/{companyId}/reports/ProfitAndLoss?start_date=2026-01-01&end_date=2026-12-31&summarize_column_by=Month",
2389
2482
  "fields": [
2390
2483
  {
2391
2484
  "qbo": "ProfitAndLoss / BalanceSheet / TrialBalance",
@@ -2427,6 +2520,16 @@ var CATALOG = {
2427
2520
  "support": "partial",
2428
2521
  "note": "GeneralDetailReportQueryRq Journal / TxnListByDate. ColKeys best-effort. Journal's per-transaction unlabeled subtotals become header-less Sections; TransactionList is a flat Data list. Desktop refuses ReportBasis on both, so accounting_method faults."
2429
2522
  },
2523
+ {
2524
+ "qbo": "InventoryValuationDetail / TransactionListByCustomer / TransactionListByVendor",
2525
+ "support": "partial",
2526
+ "note": "GeneralDetailReportQueryRq InventoryValuationDetail / TxnListByCustomer / TxnListByVendor. ColKeys best-effort. Desktop refuses ReportBasis on all three (3151), so accounting_method faults. InventoryValuationDetail takes the item filter only."
2527
+ },
2528
+ {
2529
+ "qbo": "TaxSummary",
2530
+ "support": "partial",
2531
+ "note": "Desktop's Sales Tax Liability report (GeneralSummaryReportQueryRq SalesTaxLiability): taxable and non-taxable sales and tax collected. accounting_method is honored. Desktop refuses SummarizeColumnsBy here, so summarize_column_by takes Total only."
2532
+ },
2430
2533
  {
2431
2534
  "qbo": "CustomerBalanceDetail / VendorBalanceDetail",
2432
2535
  "support": "partial",
@@ -2437,6 +2540,21 @@ var CATALOG = {
2437
2540
  "support": "partial",
2438
2541
  "note": "AgingReportQueryRq ARAgingDetail / APAgingDetail, as-of (report_date), with the receivable (customer) or payable (vendor) filter. ColKeys best-effort."
2439
2542
  },
2543
+ {
2544
+ "qbo": "CashFlow",
2545
+ "support": "partial",
2546
+ "note": "Derived (TkbDerivedReport): Desktop's SDK has no cash-flow report, so TenkeyBridge builds the indirect-method statement from Desktop's Profit and Loss and two Trial Balances, classified by account type. Bank accounts plus Undeposited Funds count as cash, as in QBO. Fixed Asset accounts, including accumulated depreciation, are investing (Desktop's own default classification). Self-checking: if the derived net income differs from Desktop's by a cent, or a trial-balance row cannot be matched to an account, the call fails with REPORT_COMPOSE_FAILED (502) instead of answering. Five QuickBooks round trips. Sandbox realms serve it from captured sample inputs (SandboxStaticReport)."
2547
+ },
2548
+ {
2549
+ "qbo": "AccountList",
2550
+ "support": "partial",
2551
+ "note": "Built from Desktop's account list (AccountQueryRq). Desktop has no account detail type, so that column is absent."
2552
+ },
2553
+ {
2554
+ "qbo": "Desktop extension reports",
2555
+ "support": "full",
2556
+ "note": "ProfitAndLossByClass, ProfitAndLossByJob, ProfitAndLossPrevYearComp, ProfitAndLossYTDComp, BalanceSheetPrevYearComp, BalanceSheetByClass, PurchaseByVendorSummary, PurchaseByItemSummary, SalesByRepSummary, InventoryStockStatusByItem, OpenInvoices, UnpaidBillsDetail, OpenPOs, SalesByCustomerDetail, SalesByItemDetail, IncomeByCustomerDetail, ExpenseByVendorDetail, PurchaseByVendorDetail, DepositDetail, CheckDetail, BalanceSheetDetail, CollectionsReport. Desktop reports with no QBO twin, served under their Desktop names in the same QBO report JSON."
2557
+ },
2440
2558
  {
2441
2559
  "qbo": "start_date / end_date / date_macro",
2442
2560
  "support": "full",
@@ -2465,6 +2583,30 @@ var CATALOG = {
2465
2583
  "note": "Comma-separated Ids \u2192 ReportEntityFilter (customer + vendor) / ReportItemFilter / ReportClassFilter. AR reports accept customer only, AP reports vendor only; InventoryValuationSummary accepts item only.",
2466
2584
  "error": "REPORT_UNSUPPORTED_OPTION"
2467
2585
  },
2586
+ {
2587
+ "qbo": "account / account_type",
2588
+ "support": "partial",
2589
+ "note": "account is comma-separated account Ids (ReportAccountFilter ListID); account_type is one QBO account type (Bank, AccountsReceivable, OtherCurrentAsset, FixedAsset, OtherAsset, AccountsPayable, CreditCard, OtherCurrentLiability, LongTermLiability, Equity, Income, CostOfGoodsSold, Expense, OtherIncome, OtherExpense) mapped to AccountTypeFilter. Sending both faults. Accepted on the summary reports (except InventoryValuationSummary) and on every detail report except AgedReceivableDetail / AgedPayableDetail. The aging reports refuse both: Desktop's aging account filter does not filter meaningfully.",
2590
+ "error": "REPORT_UNSUPPORTED_OPTION"
2591
+ },
2592
+ {
2593
+ "qbo": "transaction_type",
2594
+ "support": "partial",
2595
+ "note": "Comma-separated QBO transaction types (Invoice, CreditMemo, SalesReceipt, Payment, Deposit, Transfer, Estimate, Bill, VendorCredit, BillPayment, BillPaymentCheck, BillPaymentCreditCard, Check, CreditCardCharge, CreditCardCredit, PurchaseOrder, JournalEntry, InventoryQuantityAdjustment) mapped to ReportTxnTypeFilter. BillPayment fans out to both check and credit-card bill payments. Types with no single Desktop twin (Expense, CashPurchase, RefundReceipt) fault. Accepted on summary, detail and aging reports (not InventoryValuationSummary).",
2596
+ "error": "REPORT_UNSUPPORTED_OPTION"
2597
+ },
2598
+ {
2599
+ "qbo": "start_moddate / end_moddate",
2600
+ "support": "partial",
2601
+ "note": "ISO dates that filter on the transaction last-modified date (ReportModifiedDateRangeFilter). Both are required together, otherwise REPORT_INVALID_DATE. Detail reports only (not AgedReceivableDetail / AgedPayableDetail); summary and aging reports refuse them.",
2602
+ "error": "REPORT_INVALID_DATE"
2603
+ },
2604
+ {
2605
+ "qbo": "columns",
2606
+ "support": "partial",
2607
+ "note": "Comma-separated QBO ColKeys (tx_date, txn_type, doc_num, txn_num, name, cust_name, vend_name, memo, account_name, split_acc, klass_name, is_cleared, debt_amt, credit_amt, subt_nat_amount, rbal_nat_amount, subt_open_bal, due_date, past_due, po_num, term_name) mapped to IncludeColumn; aliases dedupe and an unknown key faults listing the accepted ones. Detail reports and AgedReceivableDetail / AgedPayableDetail only. When columns is sent, data rows carry the QuickBooks transaction id as id on the txn_type cell (GeneralLedger cost-posting rows have none). If txn_type is not among the requested columns, the id is on the first cell.",
2608
+ "error": "REPORT_UNSUPPORTED_OPTION"
2609
+ },
2468
2610
  {
2469
2611
  "qbo": "Column titles",
2470
2612
  "support": "partial",
@@ -2473,14 +2615,9 @@ var CATALOG = {
2473
2615
  ],
2474
2616
  "unsupported": [
2475
2617
  {
2476
- "case": "CashFlow",
2477
- "error": "REPORT_UNKNOWN",
2478
- "note": "QuickBooks Desktop's SDK has no cash-flow report (StatementOfCashFlows is refused with 3110 on every qbXML version)."
2479
- },
2480
- {
2481
- "case": "columns / department / qzurl / adjusted_gain_loss",
2618
+ "case": "department / qzurl / adjusted_gain_loss",
2482
2619
  "error": "REPORT_UNSUPPORTED_OPTION",
2483
- "note": "Column selection has no qbXML equivalent; Desktop has no departments (use class); QuickZoom URLs and multicurrency gain/loss adjustment are QBO-only."
2620
+ "note": "Desktop has no departments (use class); QuickZoom URLs and multicurrency gain/loss adjustment are QBO-only."
2484
2621
  },
2485
2622
  {
2486
2623
  "case": "aging_period / num_periods / aging_method",
@@ -2493,7 +2630,17 @@ var CATALOG = {
2493
2630
  "note": "qbXML's SummarizeColumnsBy has no per-item, per-employee or per-location split (ItemType splits by item type, not by item)."
2494
2631
  },
2495
2632
  {
2496
- "case": "other QBO report names (class/department sales, tax, account list, ...)",
2633
+ "case": "ClassSales / DepartmentSales",
2634
+ "error": "REPORT_UNKNOWN",
2635
+ "note": "No Desktop SDK report. Use ProfitAndLoss?summarize_column_by=Classes."
2636
+ },
2637
+ {
2638
+ "case": "TransactionListWithSplits",
2639
+ "error": "REPORT_UNKNOWN",
2640
+ "note": "No Desktop SDK report of that name. Use JournalReport."
2641
+ },
2642
+ {
2643
+ "case": "other QBO report names",
2497
2644
  "error": "REPORT_UNKNOWN",
2498
2645
  "note": "Not shipped. The fault lists the supported reports."
2499
2646
  }
@@ -2511,6 +2658,17 @@ var CATALOG = {
2511
2658
  "qbo": "CustomerRef",
2512
2659
  "support": "full"
2513
2660
  },
2661
+ {
2662
+ "qbo": "ClassRef",
2663
+ "support": "full",
2664
+ "note": "Header-level class (Desktop ClassRef, read and write). Line-level ClassRef is separate."
2665
+ },
2666
+ {
2667
+ "qbo": "DepartmentRef",
2668
+ "support": "none",
2669
+ "note": "UNMAPPED_FIELD by default. With Departments from classes turned on for the company file, the gateway maps it to the header ClassRef (written to it, read from it); sending a different ClassRef as well is a 400.",
2670
+ "error": "UNMAPPED_FIELD"
2671
+ },
2514
2672
  {
2515
2673
  "qbo": "TxnDate",
2516
2674
  "support": "full"
@@ -2959,6 +3117,12 @@ var CATALOG = {
2959
3117
  "qbo": "ClassRef",
2960
3118
  "support": "full"
2961
3119
  },
3120
+ {
3121
+ "qbo": "DepartmentRef",
3122
+ "support": "none",
3123
+ "note": "UNMAPPED_FIELD by default. With Departments from classes turned on for the company file, the gateway maps it to the header ClassRef (written to it, read from it); sending a different ClassRef as well is a 400.",
3124
+ "error": "UNMAPPED_FIELD"
3125
+ },
2962
3126
  {
2963
3127
  "qbo": "Description",
2964
3128
  "support": "full",
@@ -3396,7 +3560,7 @@ function unknownEntity(name) {
3396
3560
  if (gap) {
3397
3561
  if (gap.verdict === "live") {
3398
3562
  return fail(
3399
- `${gap.entity} is a platform endpoint, not reachable through this server's entity tools. Call the REST API directly: ${gap.usage}. Detail: compat://entity/${gap.entity.toLowerCase()}`
3563
+ `${gap.entity} is a platform endpoint, not reachable through this server's entity tools. ${gap.entity === "Reports" ? "Use the run_report tool." : `Call the REST API directly: ${gap.usage}.`} Detail: compat://entity/${gap.entity.toLowerCase()}`
3400
3564
  );
3401
3565
  }
3402
3566
  const cases = gap.unsupported.map((u) => `- ${u.case}: ${u.error}${u.workaround ? ` \u2014 workaround: ${u.workaround}` : ""}`).join("\n");
@@ -3444,6 +3608,24 @@ function registerTools(server, client) {
3444
3608
  }
3445
3609
  }
3446
3610
  );
3611
+ server.registerTool(
3612
+ "run_report",
3613
+ {
3614
+ description: "Run a QuickBooks Desktop report and get QBO-style report JSON (Header, Columns, Rows). Report names are QBO names such as ProfitAndLoss, BalanceSheet or CashFlow, plus Desktop extension reports. Params use QBO names, e.g. start_date, end_date, date_macro, accounting_method, summarize_column_by, customer, vendor, item, class, account, account_type, transaction_type, columns. Read compat://entity/reports for the available reports and which params each takes.",
3615
+ inputSchema: {
3616
+ report: import_zod.z.string().describe('Report name, e.g. "ProfitAndLoss" (case-insensitive).'),
3617
+ params: import_zod.z.record(import_zod.z.string()).optional().describe('Query params, e.g. { "date_macro": "Last Month" }.')
3618
+ }
3619
+ },
3620
+ async ({ report, params }) => {
3621
+ if (!client.report) return fail("This TenkeyBridge client has no report() method; upgrade @tenkeybridge/client to 0.5.0.");
3622
+ try {
3623
+ return ok(await client.report(report, params ?? {}));
3624
+ } catch (err) {
3625
+ return failure(err);
3626
+ }
3627
+ }
3628
+ );
3447
3629
  server.registerTool(
3448
3630
  "get",
3449
3631
  {
@@ -3558,7 +3740,7 @@ function registerTools(server, client) {
3558
3740
  }
3559
3741
 
3560
3742
  // src/version.ts
3561
- var PKG_VERSION = "0.3.0";
3743
+ var PKG_VERSION = "0.5.0";
3562
3744
 
3563
3745
  // src/server.ts
3564
3746
  var SERVER_NAME = "tenkeybridge";
@@ -3574,19 +3756,25 @@ var import_node_fs = require("fs");
3574
3756
  var import_node_os = require("os");
3575
3757
  var import_node_path = require("path");
3576
3758
  var PORTAL_URL = "https://api.tenkeybridge.com/portal";
3577
- function defaultTokenFile(realmId) {
3578
- return (0, import_node_path.join)((0, import_node_os.homedir)(), ".tenkeybridge", `mcp-tokens-${realmId}.json`);
3759
+ function defaultTokenFile(companyId) {
3760
+ return (0, import_node_path.join)((0, import_node_os.homedir)(), ".tenkeybridge", `mcp-tokens-${companyId}.json`);
3579
3761
  }
3580
3762
  function loadConfig(env) {
3581
- const realmId = env.TKB_REALM_ID;
3582
- if (!realmId) {
3763
+ const fromNew = env.TKB_COMPANY_ID;
3764
+ const fromOld = env.TKB_REALM_ID;
3765
+ if (fromNew && fromOld && fromNew !== fromOld) {
3766
+ throw new Error("TKB_COMPANY_ID and TKB_REALM_ID (deprecated) disagree \u2014 set TKB_COMPANY_ID only.");
3767
+ }
3768
+ const companyId = fromNew || fromOld;
3769
+ if (!companyId) {
3583
3770
  throw new Error(
3584
- `TKB_REALM_ID is required \u2014 the realm id of the connected company file (shown in the portal: ${PORTAL_URL}).`
3771
+ `TKB_COMPANY_ID is required \u2014 the Company ID of the connected QuickBooks company file (shown in the portal: ${PORTAL_URL}).`
3585
3772
  );
3586
3773
  }
3774
+ const deprecations = !fromNew && fromOld ? ["TKB_REALM_ID is deprecated; set TKB_COMPANY_ID instead."] : [];
3587
3775
  const baseUrl = env.TKB_BASE_URL;
3588
3776
  if (env.TKB_ACCESS_TOKEN) {
3589
- return { realmId, ...baseUrl ? { baseUrl } : {}, auth: { accessToken: env.TKB_ACCESS_TOKEN } };
3777
+ return { companyId, deprecations, ...baseUrl ? { baseUrl } : {}, auth: { accessToken: env.TKB_ACCESS_TOKEN } };
3590
3778
  }
3591
3779
  const clientId = env.TKB_CLIENT_ID;
3592
3780
  const clientSecret = env.TKB_CLIENT_SECRET;
@@ -3598,13 +3786,14 @@ function loadConfig(env) {
3598
3786
  !refreshToken && "TKB_REFRESH_TOKEN"
3599
3787
  ].filter(Boolean).join(", ");
3600
3788
  throw new Error(
3601
- `Missing ${missing}. Set either TKB_ACCESS_TOKEN, or all of TKB_CLIENT_ID + TKB_CLIENT_SECRET + TKB_REFRESH_TOKEN (create an OAuth client in the portal: ${PORTAL_URL}).`
3789
+ `Missing ${missing}. Set either TKB_ACCESS_TOKEN, or all of TKB_CLIENT_ID + TKB_CLIENT_SECRET + TKB_REFRESH_TOKEN (create an OAuth app in the portal: ${PORTAL_URL}).`
3602
3790
  );
3603
3791
  }
3604
- const tokenFile = env.TKB_TOKEN_FILE ?? defaultTokenFile(realmId);
3792
+ const tokenFile = env.TKB_TOKEN_FILE ?? defaultTokenFile(companyId);
3605
3793
  const stored = readStoredRefreshToken(tokenFile);
3606
3794
  return {
3607
- realmId,
3795
+ companyId,
3796
+ deprecations,
3608
3797
  ...baseUrl ? { baseUrl } : {},
3609
3798
  tokenFile,
3610
3799
  auth: { clientId, clientSecret, refreshToken: stored ?? refreshToken }