@assetlab/mcp-server 1.14.1 → 1.14.2
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/tools-write.js +17 -3
- package/dist/tools-write.js.map +1 -1
- package/dist/tools.d.ts +1 -1
- package/dist/tools.js +14 -1
- package/dist/tools.js.map +1 -1
- package/package.json +1 -1
package/dist/tools-write.js
CHANGED
|
@@ -32,12 +32,12 @@ export function registerWriteTools(server, client) {
|
|
|
32
32
|
// ============================================================
|
|
33
33
|
// 1. Work Orders (scope: work_orders)
|
|
34
34
|
// ============================================================
|
|
35
|
-
server.tool('create_work_order', 'Create a new work order. Requires work_orders:write scope.
|
|
35
|
+
server.tool('create_work_order', 'Create a new work order. Requires work_orders:write scope. REQUIRED fields: title, site_id, building_id, AND at least one association (asset_id OR location_id). A work order with no asset/location association is not valid — ask the user which one applies before calling. RECOMMENDED: work_category_id (look up via list_work_categories; omit only if no reasonable match exists). Location hierarchy: always resolve top-down by calling list_sites first, then list_buildings filtered by site_id, then list_locations filtered by building_id.', {
|
|
36
36
|
title: z.string().min(1).max(500).describe('Work order title (required)'),
|
|
37
37
|
description: z.string().optional().describe('Detailed description'),
|
|
38
38
|
priority: z.enum(['LOW', 'MEDIUM', 'HIGH', 'URGENT']).optional().describe('Priority level'),
|
|
39
39
|
status: z.enum(['NEW', 'IN_PROGRESS', 'ON_HOLD', 'REJECTED', 'COMPLETED', 'CANCELLED']).optional().describe('Status'),
|
|
40
|
-
type: z.enum(['PM', '
|
|
40
|
+
type: z.enum(['PM', 'REACTIVE']).optional().describe('Work order type'),
|
|
41
41
|
site_id: z.string().uuid().optional().describe('Site ID — resolve first via list_sites'),
|
|
42
42
|
building_id: z.string().uuid().optional().describe('Building ID — resolve second via list_buildings filtered by site_id'),
|
|
43
43
|
location_id: z.string().uuid().optional().describe('Location ID — resolve last via list_locations filtered by building_id'),
|
|
@@ -50,6 +50,8 @@ export function registerWriteTools(server, client) {
|
|
|
50
50
|
assigned_to: z.string().optional().describe('Assigned user ID (mapped to assignees array)'),
|
|
51
51
|
assignees: z.array(z.string()).optional().describe('Array of assigned user IDs (alternative to assigned_to for multiple assignees)'),
|
|
52
52
|
image_url: z.string().max(2000).optional().describe('Image URL (upload via create_upload_url with bucket "attachments", then set this to the public_url)'),
|
|
53
|
+
meter_reading: z.number().min(0).optional().describe('Meter/odometer reading at time of service'),
|
|
54
|
+
meter_unit: z.string().max(50).optional().describe('Meter unit (km, miles, hours, cycles)'),
|
|
53
55
|
}, async (params) => {
|
|
54
56
|
try {
|
|
55
57
|
const result = await client.create('work-orders', buildBody(params));
|
|
@@ -65,7 +67,7 @@ export function registerWriteTools(server, client) {
|
|
|
65
67
|
description: z.string().optional().describe('Detailed description'),
|
|
66
68
|
priority: z.enum(['LOW', 'MEDIUM', 'HIGH', 'URGENT']).optional().describe('Priority level'),
|
|
67
69
|
status: z.enum(['NEW', 'IN_PROGRESS', 'ON_HOLD', 'REJECTED', 'COMPLETED', 'CANCELLED']).optional().describe('Status'),
|
|
68
|
-
type: z.enum(['PM', '
|
|
70
|
+
type: z.enum(['PM', 'REACTIVE']).optional().describe('Work order type'),
|
|
69
71
|
site_id: z.string().uuid().optional().describe('Site ID — resolve first via list_sites'),
|
|
70
72
|
building_id: z.string().uuid().optional().describe('Building ID — resolve second via list_buildings filtered by site_id'),
|
|
71
73
|
location_id: z.string().uuid().optional().describe('Location ID — resolve last via list_locations filtered by building_id'),
|
|
@@ -78,6 +80,8 @@ export function registerWriteTools(server, client) {
|
|
|
78
80
|
assigned_to: z.string().optional().describe('Assigned user ID (mapped to assignees array)'),
|
|
79
81
|
assignees: z.array(z.string()).optional().describe('Array of assigned user IDs (alternative to assigned_to for multiple assignees)'),
|
|
80
82
|
image_url: z.string().max(2000).optional().describe('Image URL (upload via create_upload_url with bucket "attachments", then set this to the public_url)'),
|
|
83
|
+
meter_reading: z.number().min(0).optional().describe('Meter/odometer reading at time of service'),
|
|
84
|
+
meter_unit: z.string().max(50).optional().describe('Meter unit (km, miles, hours, cycles)'),
|
|
81
85
|
}, async ({ id, ...rest }) => {
|
|
82
86
|
try {
|
|
83
87
|
const result = await client.update('work-orders', id, buildBody(rest));
|
|
@@ -134,6 +138,8 @@ export function registerWriteTools(server, client) {
|
|
|
134
138
|
environmental_impact: z.enum(['LOW', 'MEDIUM', 'HIGH', 'CRITICAL']).optional().describe('Environmental impact level (LOW, MEDIUM, HIGH, CRITICAL)'),
|
|
135
139
|
regulatory_impact: z.enum(['LOW', 'MEDIUM', 'HIGH', 'CRITICAL']).optional().describe('Regulatory impact level (LOW, MEDIUM, HIGH, CRITICAL)'),
|
|
136
140
|
reputation_impact: z.enum(['LOW', 'MEDIUM', 'HIGH', 'CRITICAL']).optional().describe('Reputation impact level (LOW, MEDIUM, HIGH, CRITICAL)'),
|
|
141
|
+
current_meter_reading: z.number().min(0).optional().describe('Current meter/odometer reading'),
|
|
142
|
+
meter_unit: z.string().max(50).optional().describe('Meter unit (km, miles, hours, cycles)'),
|
|
137
143
|
}, async (params) => {
|
|
138
144
|
try {
|
|
139
145
|
const result = await client.create('assets', buildBody(params));
|
|
@@ -166,6 +172,8 @@ export function registerWriteTools(server, client) {
|
|
|
166
172
|
system_id: z.string().uuid().optional().describe('System ID — resolve last via list_systems filtered by system_group_id'),
|
|
167
173
|
image_url: z.string().max(2000).optional().describe('Image URL'),
|
|
168
174
|
last_maintenance_date: z.string().optional().describe('Last maintenance date (ISO 8601)'),
|
|
175
|
+
current_meter_reading: z.number().min(0).optional().describe('Current meter/odometer reading'),
|
|
176
|
+
meter_unit: z.string().max(50).optional().describe('Meter unit (km, miles, hours, cycles)'),
|
|
169
177
|
quantity: z.number().min(0).optional().describe('Quantity'),
|
|
170
178
|
unit_of_measure: z.string().max(100).optional().describe('Unit of measure'),
|
|
171
179
|
unit_replacement_value: z.number().min(0).optional().describe('Unit replacement value'),
|
|
@@ -485,6 +493,9 @@ export function registerWriteTools(server, client) {
|
|
|
485
493
|
status: z.enum(['active', 'inactive']).optional().describe('Schedule status'),
|
|
486
494
|
auto_generate_wo: z.boolean().optional().describe('Auto-generate work orders'),
|
|
487
495
|
floating: z.boolean().optional().describe('Floating schedule (due date based on completion)'),
|
|
496
|
+
meter_based: z.boolean().optional().describe('Whether this PM triggers at meter intervals (e.g. every 5000 km)'),
|
|
497
|
+
meter_interval: z.number().min(0).optional().describe('Meter interval — trigger every N units'),
|
|
498
|
+
meter_unit: z.string().max(50).optional().describe('Meter unit (km, miles, hours, cycles)'),
|
|
488
499
|
start_date: z.string().optional().describe('Start date (ISO 8601)'),
|
|
489
500
|
asset_ids: z.array(z.string().uuid()).optional().describe('Array of asset IDs'),
|
|
490
501
|
system_ids: z.array(z.string().uuid()).optional().describe('Array of system IDs'),
|
|
@@ -524,6 +535,9 @@ export function registerWriteTools(server, client) {
|
|
|
524
535
|
status: z.enum(['active', 'inactive']).optional().describe('Schedule status'),
|
|
525
536
|
auto_generate_wo: z.boolean().optional().describe('Auto-generate work orders'),
|
|
526
537
|
floating: z.boolean().optional().describe('Floating schedule (due date based on completion)'),
|
|
538
|
+
meter_based: z.boolean().optional().describe('Whether this PM triggers at meter intervals'),
|
|
539
|
+
meter_interval: z.number().min(0).optional().describe('Meter interval — trigger every N units'),
|
|
540
|
+
meter_unit: z.string().max(50).optional().describe('Meter unit (km, miles, hours, cycles)'),
|
|
527
541
|
start_date: z.string().optional().describe('Start date (ISO 8601)'),
|
|
528
542
|
asset_ids: z.array(z.string().uuid()).optional().describe('Array of asset IDs'),
|
|
529
543
|
system_ids: z.array(z.string().uuid()).optional().describe('Array of system IDs'),
|