@teamnetwork-nz/teamlink-mcp-server 0.4.0 → 0.5.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.
- package/build/index.js +39 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -136,10 +136,48 @@ server.tool('lookup_branches', 'List branches.', {}, async () => get('/lookups/b
|
|
|
136
136
|
// --- Tasks / time (read) ---
|
|
137
137
|
server.tool('task_get', 'Get a task by id.', { taskId: z.number() }, async ({ taskId }) => get(`/tasks/${taskId}`));
|
|
138
138
|
server.tool('task_list_time_entries', 'List time/incidental entries + totals for a task.', { taskId: z.number(), type: z.enum(['time', 'incidentals', 'all']).optional() }, async ({ taskId, type }) => get(`/tasks/${taskId}/time-entries`, { type }));
|
|
139
|
+
server.tool('task_search', 'Search/filter tasks. Supports filtering by customer/account, assigned staff member, who requested it, who created it, call type, open/closed status, a date-logged range, and/or free text. Defaults to open tasks only unless status is set. Every filter is optional and combinable.', {
|
|
140
|
+
q: z.string().optional().describe('Free text: exact task ID match, or partial match on task name/description.'),
|
|
141
|
+
accountId: z.number().optional().describe('Filter by customer/account/company (CSAID). Maps to TMTask.TMT_CSAID — the account the task was logged for.'),
|
|
142
|
+
loggedForUserId: z.number().optional().describe('Filter by the customer contact who requested/is authorising the task (TMTask.TMTLoggedBy_CSCID).'),
|
|
143
|
+
assignedToUserId: z.number().optional().describe('Filter by the staff member currently assigned to the task (TMTask.TMTAssignedTo_CSCID).'),
|
|
144
|
+
enteredByUserId: z.number().optional().describe('Filter by the staff member who created/logged the task (TMTask.TMTEnteredBY_CSCID).'),
|
|
145
|
+
callType: z.string().optional().describe('Task/call type code: S=Support, P=T&A Project, F=FP Project, H=phoneSERVICE, I=siteSERVICE, A=Account Fee.'),
|
|
146
|
+
status: z.enum(['open', 'closed', 'all']).optional().describe('Task status (TMTStatus). Default: open.'),
|
|
147
|
+
dateFrom: z.string().optional().describe('Date-logged range start (inclusive), e.g. 2026-01-01.'),
|
|
148
|
+
dateTo: z.string().optional().describe('Date-logged range end (inclusive).'),
|
|
149
|
+
page: z.number().optional(), pageSize: z.number().optional(),
|
|
150
|
+
}, async (args) => get('/tasks/search', args));
|
|
139
151
|
// --- Orders / PM (read) ---
|
|
140
152
|
server.tool('order_get', 'Get an order header + totals.', { orderId: z.number() }, async ({ orderId }) => get(`/orders/${orderId}`));
|
|
141
153
|
server.tool('order_list_items', 'List order line items.', { orderId: z.number() }, async ({ orderId }) => get(`/orders/${orderId}/items`));
|
|
142
|
-
server.tool('
|
|
154
|
+
server.tool('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.', {
|
|
155
|
+
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.'),
|
|
156
|
+
advanced: z.boolean().optional().describe('Widen `q` to also match order notes and line product code/OEM code/descriptions.'),
|
|
157
|
+
accountId: z.number().optional().describe('Filter by customer/account/company (CSAID). Maps to PMOrder.PMO_CSAID.'),
|
|
158
|
+
branchId: z.string().optional().describe('Filter by the branch that owns the order account (CSA_CSBID).'),
|
|
159
|
+
enteredByUserId: z.number().optional().describe('Filter by the staff member who entered/created the order (PMOrder.PMO_CSCID).'),
|
|
160
|
+
authorisedByUserId: z.number().optional().describe('Filter by who authorised the order (PMOrder.PMO_AuthBy_CSCID).'),
|
|
161
|
+
vendorId: z.number().optional().describe('Filter by supplier/vendor account on at least one order line (PMDetails.PMD_CSAID).'),
|
|
162
|
+
receivedByUserId: z.number().optional().describe('Filter by the staff member who received at least one line (PMDetails.PMDRecBy_CSCID).'),
|
|
163
|
+
approvedByUserId: z.number().optional().describe('Filter by the staff member who approved at least one line (PMDetails.PMDApprBy_CSCID).'),
|
|
164
|
+
invoicedByUserId: z.number().optional().describe('Filter by the staff member who recorded a supplier invoice on at least one line (PMDetails.PMDInvBy_CSCID).'),
|
|
165
|
+
returnAuthorisedByUserId: z.number().optional().describe('Filter by the staff member who authorised a return on at least one line (PMDetails.PMDRABy_CSCID).'),
|
|
166
|
+
creditedByUserId: z.number().optional().describe('Filter by the staff member who recorded a supplier credit on at least one line (PMDetails.PMDCdtBy_CSCID).'),
|
|
167
|
+
orderType: z.string().optional().describe('Order type selector code (PMOrder.PMOType).'),
|
|
168
|
+
dateFrom: z.string().optional().describe('Order-date range start (inclusive), e.g. 2026-01-01.'),
|
|
169
|
+
dateTo: z.string().optional().describe('Order-date range end (inclusive).'),
|
|
170
|
+
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.'),
|
|
171
|
+
invoiced: z.enum(['yes', 'no']).optional().describe('Whether at least one line has been invoiced. Same "at least one line" semantics as `received`.'),
|
|
172
|
+
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`.'),
|
|
173
|
+
page: z.number().optional(), pageSize: z.number().optional(),
|
|
174
|
+
}, async (args) => get('/orders/search', args));
|
|
175
|
+
server.tool('product_search', 'Search the (read-only) product catalog. `q` splits on whitespace and requires every word to match description/code/OEM code.', {
|
|
176
|
+
q: z.string().optional(), vendorId: z.number().optional(),
|
|
177
|
+
manufacturer: z.string().optional().describe('Exact match on PMPManufacturer.'),
|
|
178
|
+
category: z.string().optional().describe('Exact match on PMPProductCategory_ID.'),
|
|
179
|
+
page: z.number().optional(), pageSize: z.number().optional(),
|
|
180
|
+
}, async (args) => get('/orders/products/search', args));
|
|
143
181
|
async function main() {
|
|
144
182
|
if (!API_KEY) {
|
|
145
183
|
console.error('[teamlink-mcp] WARNING: TEAMLINK_API_KEY is not set; all tool calls will fail until it is configured.');
|