@teamnetwork-nz/teamlink-mcp-server 0.6.2 → 0.6.4
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.js +11 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -127,7 +127,7 @@ function strictTool(name, description, inputSchema, callback) {
|
|
|
127
127
|
}
|
|
128
128
|
const allowedQueryParams = {
|
|
129
129
|
'/accounts/search': new Set([
|
|
130
|
-
'mode', 'q', 'accountId', 'alphaId', 'name', 'address', 'phone', 'website',
|
|
130
|
+
'mode', 'q', 'accountId', 'alphaId', 'name', 'address', 'phone', 'website', 'emailDomain',
|
|
131
131
|
'exactWebsite', 'isActive', 'isCustomer', 'isProspect', 'isSupplier', 'isBranch',
|
|
132
132
|
'branchId', 'teamId', 'page', 'pageSize',
|
|
133
133
|
]),
|
|
@@ -140,21 +140,22 @@ const allowedQueryParams = {
|
|
|
140
140
|
'/tasks/search': new Set(['q', 'accountId', 'loggedForUserId', 'assignedToUserId', 'enteredByUserId', 'callType', 'priority', 'status', 'dateFrom', 'dateTo', 'page', 'pageSize']),
|
|
141
141
|
'/crm/activities/search': new Set(['q', 'accountId', 'assignedToUserId', 'targetContactId', 'enteredByUserId', 'completed', 'dateDueFrom', 'dateDueTo', 'page', 'pageSize']),
|
|
142
142
|
'/crm/activities/time-entries/search': new Set(['activityId', 'accountId', 'personId', 'q', 'dateFrom', 'dateTo', 'page', 'pageSize']),
|
|
143
|
-
'/orders/search': new Set(['q', 'advanced', 'accountId', 'branchId', 'enteredByUserId', 'authorisedByUserId', 'vendorId', 'receivedByUserId', 'approvedByUserId', 'invoicedByUserId', 'returnAuthorisedByUserId', 'creditedByUserId', 'orderType', 'dateFrom', 'dateTo', 'received', 'invoiced', 'returned', 'page', 'pageSize']),
|
|
143
|
+
'/orders/search': new Set(['q', 'advanced', 'invoiceNumber', 'creditReference', 'returnAuthorisationReference', 'customerOrderReference', 'accountId', 'branchId', 'enteredByUserId', 'authorisedByUserId', 'vendorId', 'receivedByUserId', 'approvedByUserId', 'invoicedByUserId', 'returnAuthorisedByUserId', 'creditedByUserId', 'orderType', 'dateFrom', 'dateTo', 'received', 'invoiced', 'returned', 'credited', 'page', 'pageSize']),
|
|
144
144
|
'/orders/products/search': new Set(['q', 'supplierId', 'vendorId', 'manufacturer', 'category', 'inStock', 'page', 'pageSize']),
|
|
145
145
|
};
|
|
146
146
|
// --- Identity ---
|
|
147
147
|
strictTool('teamlink_whoami', 'Return the authenticated TEAMlink user context for the configured API key, including `roleClass` (CSCClass) and `homeAccountId` (CSAID — the identity key scoping staff vs customer visibility).', {}, async () => get('/me'));
|
|
148
148
|
// --- CRM: accounts ---
|
|
149
|
-
strictTool('crm_search_accounts', 'Search
|
|
149
|
+
strictTool('crm_search_accounts', 'Search CRM accounts, including customers, prospects, and suppliers. `accountId` is the canonical public identity. Standard mode uses exact case-insensitive matching except `emailDomain`, which is always partial and domain-normalized. Fuzzy mode performs partial text/phone matching and name DIFFERENCE() matching. Boolean/account filters may be used without a text criterion. `isActive` defaults true unless explicitly set.', {
|
|
150
150
|
mode: z.enum(['standard', 'fuzzy']).optional().describe('Search mode. standard=exact case-insensitive matching; fuzzy=partial matching plus DIFFERENCE() for names. Defaults to standard.'),
|
|
151
|
-
q: z.string().optional().describe('General search value matched against accountId, alphaId, name, address, phone, and
|
|
151
|
+
q: z.string().optional().describe('General search value matched against accountId, alphaId, name, address, phone, website, and emailDomain.'),
|
|
152
152
|
accountId: z.number().optional().describe('Canonical public account identifier. Maps to CSAccount.CSAID in SQL.'),
|
|
153
153
|
alphaId: z.string().optional(),
|
|
154
154
|
name: z.string().optional(),
|
|
155
155
|
address: z.string().optional(),
|
|
156
156
|
phone: z.string().optional().describe('Phone search; punctuation/spaces are ignored.'),
|
|
157
157
|
website: z.string().optional(),
|
|
158
|
+
emailDomain: z.string().optional().describe('Partial, case-insensitive domain search across emailDomain and website. Accepts a domain, email address, or URL; scheme and leading www are ignored.'),
|
|
158
159
|
exactWebsite: z.string().optional().describe('Compatibility alias for website. Prefer website.'),
|
|
159
160
|
isActive: z.boolean().optional().describe('Defaults to true if omitted.'),
|
|
160
161
|
isCustomer: z.boolean().optional(),
|
|
@@ -294,11 +295,15 @@ strictTool('task_search', 'Search/filter tasks. Supports filtering by customer/a
|
|
|
294
295
|
page: z.number().optional(), pageSize: z.number().optional(),
|
|
295
296
|
}, async (args) => get('/tasks/search', args));
|
|
296
297
|
// --- Orders / PM (read) ---
|
|
297
|
-
strictTool('order_get', 'Get an order header
|
|
298
|
+
strictTool('order_get', 'Get an order header, totals, and statusFlags. `statusFlags` reports unapproved/unreceived lines, completion, and returns awaiting credit using the same semantics as order_search. `account` is the resale customer, not the supplier. `vendors` contains every distinct supplier from the order lines; `vendor` is populated only for a single-vendor order. Returns account/bill-to and contact actor fields as objects with IDs and names. `orderType` is returned as { code, label } from CSSelectors/OrderType.', { orderId: z.number() }, async ({ orderId }) => get(`/orders/${orderId}`));
|
|
298
299
|
strictTool('order_list_items', 'List order line items.', { orderId: z.number() }, async ({ orderId }) => get(`/orders/${orderId}/items`));
|
|
299
300
|
strictTool('order_search', 'Search/filter orders. Supports filtering by customer/account, branch, order type, a date-raised range, who entered or authorised the order, who received/approved/invoiced/returned/credited a line, received/invoiced/returned status, and/or free text (order id, invoice/credit/RA reference, or with advanced=true also notes and product codes/descriptions). Every filter is optional and combinable. Results include account/enteredBy/authorisedBy objects with names, plus raw IDs. Returned `orderType` is { code, label } resolved from CSSelectors/OrderType.', {
|
|
300
301
|
q: z.string().optional().describe('Free text search — order id (exact), invoice/credit/RA reference (partial); with advanced=true also order notes and line product code/OEM code/descriptions.'),
|
|
301
302
|
advanced: z.boolean().optional().describe('Widen `q` to also match order notes and line product code/OEM code/descriptions.'),
|
|
303
|
+
invoiceNumber: z.union([z.string(), z.number()]).transform(String).optional().describe('Exact supplier invoice number. Numeric values are accepted and preserved as reference strings.'),
|
|
304
|
+
creditReference: z.union([z.string(), z.number()]).transform(String).optional().describe('Exact supplier credit reference.'),
|
|
305
|
+
returnAuthorisationReference: z.union([z.string(), z.number()]).transform(String).optional().describe('Exact return-authorisation reference.'),
|
|
306
|
+
customerOrderReference: z.union([z.string(), z.number()]).transform(String).optional().describe('Exact customer order reference.'),
|
|
302
307
|
accountId: z.number().optional().describe('Filter by customer/account/company (CSAID). Maps to PMOrder.PMO_CSAID.'),
|
|
303
308
|
branchId: z.string().optional().describe('Filter by the branch that owns the order account (CSA_CSBID).'),
|
|
304
309
|
enteredByUserId: z.number().optional().describe('Filter by the staff member who entered/created the order (PMOrder.PMO_CSCID).'),
|
|
@@ -315,6 +320,7 @@ strictTool('order_search', 'Search/filter orders. Supports filtering by customer
|
|
|
315
320
|
received: z.enum(['yes', 'no']).optional().describe('Whether at least one line has been received. Not mutually exclusive with `no` — an order can have both received and unreceived lines.'),
|
|
316
321
|
invoiced: z.enum(['yes', 'no']).optional().describe('Whether at least one line has been invoiced. Same "at least one line" semantics as `received`.'),
|
|
317
322
|
returned: z.enum(['yes', 'no']).optional().describe('Whether at least one line has a return reason set. Same "at least one line" semantics as `received`.'),
|
|
323
|
+
credited: z.enum(['yes', 'no']).optional().describe('Whether at least one line has supplier credit recorded.'),
|
|
318
324
|
page: z.number().optional(), pageSize: z.number().optional(),
|
|
319
325
|
}, async (args) => get('/orders/search', args));
|
|
320
326
|
strictTool('product_search', 'Search the read-only product catalog. `q` splits on whitespace and requires every word to match as a substring in code, OEM code, description, manufacturer, or category. Filter by supplier/vendor and stock availability.', {
|