@assetlab/mcp-server 1.11.0 → 1.12.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/README.md +4 -0
- package/dist/tools-write.js +151 -1
- package/dist/tools-write.js.map +1 -1
- package/dist/tools.d.ts +1 -1
- package/dist/tools.js +84 -0
- package/dist/tools.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -86,6 +86,7 @@ Works with **Claude**, **ChatGPT**, **Microsoft Copilot**, and any MCP-compatibl
|
|
|
86
86
|
| Invoices | `list_invoices` | `get_invoice` |
|
|
87
87
|
| Purchase Orders | `list_purchase_orders` | `get_purchase_order` |
|
|
88
88
|
| Expenses | `list_expenses` | `get_expense` |
|
|
89
|
+
| Change Orders | `list_change_orders` | `get_change_order` |
|
|
89
90
|
| Budgets | `list_budgets` | `get_budget` |
|
|
90
91
|
| Parts | `list_parts` | `get_part` |
|
|
91
92
|
| Part Categories | `list_part_categories` | `get_part_category` |
|
|
@@ -100,6 +101,7 @@ Works with **Claude**, **ChatGPT**, **Microsoft Copilot**, and any MCP-compatibl
|
|
|
100
101
|
| Project Budget Items | `list_project_budget_items` | `get_project_budget_item` |
|
|
101
102
|
| Project Time Entries | `list_project_time_entries` | `get_project_time_entry` |
|
|
102
103
|
| Project Comments | `list_project_comments` | `get_project_comment` |
|
|
104
|
+
| Project Document Folder Templates | `list_project_document_folder_templates` | `get_project_document_folder_template` |
|
|
103
105
|
| Site FCI History | `list_site_fci_history` | `get_site_fci_history_entry` |
|
|
104
106
|
| Vendor Site Assignments | `list_vendor_site_assignments` | `get_vendor_site_assignment` |
|
|
105
107
|
| Contract Sites | `list_contract_sites` | — |
|
|
@@ -131,6 +133,7 @@ Works with **Claude**, **ChatGPT**, **Microsoft Copilot**, and any MCP-compatibl
|
|
|
131
133
|
| Invoices | `create_invoice` | `update_invoice` | `delete_invoice` |
|
|
132
134
|
| Purchase Orders | `create_purchase_order` | `update_purchase_order` | `delete_purchase_order` |
|
|
133
135
|
| Expenses | `create_expense` | `update_expense` | `delete_expense` |
|
|
136
|
+
| Change Orders | `create_change_order` | `update_change_order` | `delete_change_order` |
|
|
134
137
|
| Budgets | `create_budget` | `update_budget` | `delete_budget` |
|
|
135
138
|
| Parts | `create_part` | `update_part` | `delete_part` |
|
|
136
139
|
| Part Categories | `create_part_category` | `update_part_category` | `delete_part_category` |
|
|
@@ -144,6 +147,7 @@ Works with **Claude**, **ChatGPT**, **Microsoft Copilot**, and any MCP-compatibl
|
|
|
144
147
|
| Project Budget Items | `create_project_budget_item` | `update_project_budget_item` | `delete_project_budget_item` |
|
|
145
148
|
| Project Time Entries | `create_project_time_entry` | `update_project_time_entry` | `delete_project_time_entry` |
|
|
146
149
|
| Project Comments | `create_project_comment` | `update_project_comment` | `delete_project_comment` |
|
|
150
|
+
| Project Document Folder Templates | `create_project_document_folder_template` | `update_project_document_folder_template` | `delete_project_document_folder_template` |
|
|
147
151
|
| Vendor Site Assignments | `create_vendor_site_assignment` | — | `delete_vendor_site_assignment` |
|
|
148
152
|
| Contract Sites | `create_contract_site` | — | `delete_contract_site` |
|
|
149
153
|
| Custom Field Definitions | `create_custom_field_definition` | `update_custom_field_definition` | `delete_custom_field_definition` |
|
package/dist/tools-write.js
CHANGED
|
@@ -831,6 +831,100 @@ export function registerWriteTools(server, client) {
|
|
|
831
831
|
}
|
|
832
832
|
});
|
|
833
833
|
// ============================================================
|
|
834
|
+
// Change Orders (scope: change_orders)
|
|
835
|
+
// ============================================================
|
|
836
|
+
server.tool('create_change_order', 'Create a new change order. Requires change_orders:write scope.', {
|
|
837
|
+
co_number: z.string().min(1).max(200).describe('Change order number (required)'),
|
|
838
|
+
description: z.string().min(1).describe('Description (required)'),
|
|
839
|
+
amount: z.number().describe('Amount (required, negative for credits)'),
|
|
840
|
+
status: z.enum(['draft', 'submitted', 'approved', 'rejected']).optional().describe('Status'),
|
|
841
|
+
reason: z.string().optional().describe('Reason for the change order'),
|
|
842
|
+
notes: z.string().optional().describe('Additional notes'),
|
|
843
|
+
project_id: z.string().uuid().optional().describe('Project ID'),
|
|
844
|
+
vendor_id: z.string().uuid().optional().describe('Vendor ID'),
|
|
845
|
+
category_id: z.string().uuid().optional().describe('Cost category ID'),
|
|
846
|
+
}, async (params) => {
|
|
847
|
+
try {
|
|
848
|
+
const result = await client.create('change-orders', buildBody(params));
|
|
849
|
+
return formatResult(result);
|
|
850
|
+
}
|
|
851
|
+
catch (err) {
|
|
852
|
+
return formatError(err);
|
|
853
|
+
}
|
|
854
|
+
});
|
|
855
|
+
server.tool('update_change_order', 'Update an existing change order by ID. Requires change_orders:write scope.', {
|
|
856
|
+
id: z.string().uuid().describe('Change order ID'),
|
|
857
|
+
co_number: z.string().min(1).max(200).optional().describe('Change order number'),
|
|
858
|
+
description: z.string().optional().describe('Description'),
|
|
859
|
+
amount: z.number().optional().describe('Amount (negative for credits)'),
|
|
860
|
+
status: z.enum(['draft', 'submitted', 'approved', 'rejected']).optional().describe('Status'),
|
|
861
|
+
reason: z.string().optional().describe('Reason'),
|
|
862
|
+
notes: z.string().optional().describe('Notes'),
|
|
863
|
+
project_id: z.string().uuid().optional().describe('Project ID'),
|
|
864
|
+
vendor_id: z.string().uuid().optional().describe('Vendor ID'),
|
|
865
|
+
category_id: z.string().uuid().optional().describe('Cost category ID'),
|
|
866
|
+
approved_by: z.string().optional().describe('Approved by (user ID)'),
|
|
867
|
+
approved_at: z.string().optional().describe('Approval date (ISO 8601)'),
|
|
868
|
+
}, async ({ id, ...rest }) => {
|
|
869
|
+
try {
|
|
870
|
+
const result = await client.update('change-orders', id, buildBody(rest));
|
|
871
|
+
return formatResult(result);
|
|
872
|
+
}
|
|
873
|
+
catch (err) {
|
|
874
|
+
return formatError(err);
|
|
875
|
+
}
|
|
876
|
+
});
|
|
877
|
+
server.tool('delete_change_order', 'Delete a change order by ID. Requires change_orders:write scope.', { id: z.string().uuid().describe('Change order ID') }, async ({ id }) => {
|
|
878
|
+
try {
|
|
879
|
+
const result = await client.remove('change-orders', id);
|
|
880
|
+
return formatResult(result);
|
|
881
|
+
}
|
|
882
|
+
catch (err) {
|
|
883
|
+
return formatError(err);
|
|
884
|
+
}
|
|
885
|
+
});
|
|
886
|
+
// ============================================================
|
|
887
|
+
// Project Document Folder Templates (scope: project_document_folder_templates)
|
|
888
|
+
// ============================================================
|
|
889
|
+
server.tool('create_project_document_folder_template', 'Create a project document folder template. Requires project_document_folder_templates:write scope.', {
|
|
890
|
+
name: z.string().min(1).max(500).describe('Template name (required)'),
|
|
891
|
+
description: z.string().max(2000).optional().describe('Template description'),
|
|
892
|
+
structure: z.array(z.any()).optional().describe('Folder hierarchy as JSON array'),
|
|
893
|
+
is_default: z.boolean().optional().describe('Whether this is the default template'),
|
|
894
|
+
}, async (params) => {
|
|
895
|
+
try {
|
|
896
|
+
const result = await client.create('project-document-folder-templates', buildBody(params));
|
|
897
|
+
return formatResult(result);
|
|
898
|
+
}
|
|
899
|
+
catch (err) {
|
|
900
|
+
return formatError(err);
|
|
901
|
+
}
|
|
902
|
+
});
|
|
903
|
+
server.tool('update_project_document_folder_template', 'Update a project document folder template by ID. Requires project_document_folder_templates:write scope.', {
|
|
904
|
+
id: z.string().uuid().describe('Template ID'),
|
|
905
|
+
name: z.string().min(1).max(500).optional().describe('Template name'),
|
|
906
|
+
description: z.string().max(2000).optional().describe('Template description'),
|
|
907
|
+
structure: z.array(z.any()).optional().describe('Folder hierarchy as JSON array'),
|
|
908
|
+
is_default: z.boolean().optional().describe('Whether this is the default template'),
|
|
909
|
+
}, async ({ id, ...rest }) => {
|
|
910
|
+
try {
|
|
911
|
+
const result = await client.update('project-document-folder-templates', id, buildBody(rest));
|
|
912
|
+
return formatResult(result);
|
|
913
|
+
}
|
|
914
|
+
catch (err) {
|
|
915
|
+
return formatError(err);
|
|
916
|
+
}
|
|
917
|
+
});
|
|
918
|
+
server.tool('delete_project_document_folder_template', 'Delete a project document folder template by ID. Requires project_document_folder_templates:write scope.', { id: z.string().uuid().describe('Template ID') }, async ({ id }) => {
|
|
919
|
+
try {
|
|
920
|
+
const result = await client.remove('project-document-folder-templates', id);
|
|
921
|
+
return formatResult(result);
|
|
922
|
+
}
|
|
923
|
+
catch (err) {
|
|
924
|
+
return formatError(err);
|
|
925
|
+
}
|
|
926
|
+
});
|
|
927
|
+
// ============================================================
|
|
834
928
|
// 14. Budgets (scope: budgets)
|
|
835
929
|
// ============================================================
|
|
836
930
|
server.tool('create_budget', 'Create a new budget. Requires budgets:write scope.', {
|
|
@@ -2490,6 +2584,62 @@ export function registerWriteTools(server, client) {
|
|
|
2490
2584
|
}
|
|
2491
2585
|
});
|
|
2492
2586
|
// ============================================================
|
|
2587
|
+
// Project Risks (scope: project_risks)
|
|
2588
|
+
// ============================================================
|
|
2589
|
+
server.tool('create_project_risk', 'Create a new project risk. Requires project_risks:write scope.', {
|
|
2590
|
+
project_id: z.string().uuid().describe('Project ID (required)'),
|
|
2591
|
+
title: z.string().min(1).max(500).describe('Risk title (required)'),
|
|
2592
|
+
description: z.string().optional().describe('Risk description'),
|
|
2593
|
+
category: z.enum(['technical', 'financial', 'schedule', 'resource', 'external']).optional().describe('Risk category'),
|
|
2594
|
+
probability: z.enum(['low', 'medium', 'high']).optional().describe('Probability level'),
|
|
2595
|
+
impact: z.enum(['low', 'medium', 'high', 'critical']).optional().describe('Impact level'),
|
|
2596
|
+
status: z.enum(['identified', 'analyzing', 'mitigating', 'resolved', 'accepted']).optional().describe('Risk status (default: identified)'),
|
|
2597
|
+
mitigation_plan: z.string().optional().describe('Mitigation plan'),
|
|
2598
|
+
contingency_plan: z.string().optional().describe('Contingency plan'),
|
|
2599
|
+
owner_id: z.string().max(200).optional().describe('Risk owner (Clerk user ID)'),
|
|
2600
|
+
due_date: z.string().optional().describe('Due date (ISO 8601)'),
|
|
2601
|
+
created_by: z.string().max(200).optional().describe('Creator (Clerk user ID)'),
|
|
2602
|
+
}, async (params) => {
|
|
2603
|
+
try {
|
|
2604
|
+
const result = await client.create('project-risks', buildBody(params));
|
|
2605
|
+
return formatResult(result);
|
|
2606
|
+
}
|
|
2607
|
+
catch (err) {
|
|
2608
|
+
return formatError(err);
|
|
2609
|
+
}
|
|
2610
|
+
});
|
|
2611
|
+
server.tool('update_project_risk', 'Update an existing project risk by ID. Requires project_risks:write scope.', {
|
|
2612
|
+
id: z.string().uuid().describe('Project risk ID'),
|
|
2613
|
+
project_id: z.string().uuid().optional().describe('Project ID'),
|
|
2614
|
+
title: z.string().min(1).max(500).optional().describe('Risk title'),
|
|
2615
|
+
description: z.string().optional().describe('Risk description'),
|
|
2616
|
+
category: z.enum(['technical', 'financial', 'schedule', 'resource', 'external']).optional().describe('Risk category'),
|
|
2617
|
+
probability: z.enum(['low', 'medium', 'high']).optional().describe('Probability level'),
|
|
2618
|
+
impact: z.enum(['low', 'medium', 'high', 'critical']).optional().describe('Impact level'),
|
|
2619
|
+
status: z.enum(['identified', 'analyzing', 'mitigating', 'resolved', 'accepted']).optional().describe('Risk status'),
|
|
2620
|
+
mitigation_plan: z.string().optional().describe('Mitigation plan'),
|
|
2621
|
+
contingency_plan: z.string().optional().describe('Contingency plan'),
|
|
2622
|
+
owner_id: z.string().max(200).optional().describe('Risk owner (Clerk user ID)'),
|
|
2623
|
+
due_date: z.string().optional().describe('Due date (ISO 8601)'),
|
|
2624
|
+
}, async ({ id, ...rest }) => {
|
|
2625
|
+
try {
|
|
2626
|
+
const result = await client.update('project-risks', id, buildBody(rest));
|
|
2627
|
+
return formatResult(result);
|
|
2628
|
+
}
|
|
2629
|
+
catch (err) {
|
|
2630
|
+
return formatError(err);
|
|
2631
|
+
}
|
|
2632
|
+
});
|
|
2633
|
+
server.tool('delete_project_risk', 'Delete a project risk by ID. Requires project_risks:write scope.', { id: z.string().uuid().describe('Project risk ID') }, async ({ id }) => {
|
|
2634
|
+
try {
|
|
2635
|
+
const result = await client.remove('project-risks', id);
|
|
2636
|
+
return formatResult(result);
|
|
2637
|
+
}
|
|
2638
|
+
catch (err) {
|
|
2639
|
+
return formatError(err);
|
|
2640
|
+
}
|
|
2641
|
+
});
|
|
2642
|
+
// ============================================================
|
|
2493
2643
|
// Project Assets
|
|
2494
2644
|
// ============================================================
|
|
2495
2645
|
server.tool('create_project_asset', 'Link an asset to a project. Requires project_assets:write scope.', {
|
|
@@ -2530,7 +2680,7 @@ export function registerWriteTools(server, client) {
|
|
|
2530
2680
|
'project-comments', 'project-team-members', 'project-task-dependencies',
|
|
2531
2681
|
'project-updates', 'project-cost-snapshots', 'project-locations',
|
|
2532
2682
|
'project-sites', 'project-buildings', 'project-systems',
|
|
2533
|
-
'project-system-classes', 'project-system-groups', 'project-assets',
|
|
2683
|
+
'project-system-classes', 'project-system-groups', 'project-assets', 'project-risks',
|
|
2534
2684
|
'parts', 'part-categories',
|
|
2535
2685
|
'custom-field-definitions', 'custom-field-values',
|
|
2536
2686
|
'vendor-site-assignments', 'contract-sites',
|