@assetlab/mcp-server 1.24.0 → 1.25.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/dist/tools-write.js +68 -0
- package/dist/tools-write.js.map +1 -1
- package/dist/tools.d.ts +1 -1
- package/dist/tools.js +41 -0
- package/dist/tools.js.map +1 -1
- package/package.json +2 -2
package/dist/tools-write.js
CHANGED
|
@@ -4603,6 +4603,74 @@ export function registerWriteTools(server, client) {
|
|
|
4603
4603
|
}
|
|
4604
4604
|
});
|
|
4605
4605
|
// ============================================================
|
|
4606
|
+
// Asset Condition Assessments (scope: asset_condition_assessments)
|
|
4607
|
+
// ============================================================
|
|
4608
|
+
server.tool('create_asset_condition_assessment', 'Record a point-in-time condition assessment against an asset. Requires asset_condition_assessments:write scope. Call list_assets first to resolve asset_id.', {
|
|
4609
|
+
asset_id: z.string().uuid().describe('Asset ID (required)'),
|
|
4610
|
+
assessed_on: z.string().describe('Assessment date (YYYY-MM-DD, required)'),
|
|
4611
|
+
condition_score: z
|
|
4612
|
+
.number()
|
|
4613
|
+
.int()
|
|
4614
|
+
.min(0)
|
|
4615
|
+
.max(100)
|
|
4616
|
+
.optional()
|
|
4617
|
+
.describe('Condition score (0-100)'),
|
|
4618
|
+
replacement_cost: z
|
|
4619
|
+
.number()
|
|
4620
|
+
.min(0)
|
|
4621
|
+
.optional()
|
|
4622
|
+
.describe('Current replacement value / CRV at assessment time'),
|
|
4623
|
+
assessor_id: z.string().optional().describe('Assessor user ID'),
|
|
4624
|
+
method: z.enum(['visual', 'detailed', 'vendor']).optional().describe('Assessment method'),
|
|
4625
|
+
notes: z.string().optional().describe('Free-form notes'),
|
|
4626
|
+
defects: z.record(z.unknown()).optional().describe('Structured defect findings (JSON)'),
|
|
4627
|
+
update_purchase_cost: z
|
|
4628
|
+
.boolean()
|
|
4629
|
+
.optional()
|
|
4630
|
+
.describe("Default OFF — omit unless the user explicitly asks to update/overwrite the asset's purchase cost, or says their org treats purchase cost as the current replacement value. Recording an assessment does NOT by itself change purchase cost. When true, overwrites assets.purchase_cost with this replacement_cost (CRV); the prior value is preserved on the assessment as previous_purchase_cost (read-only). Create-only and not reversible via update — when unsure, leave it off and ask."),
|
|
4631
|
+
}, async (params) => {
|
|
4632
|
+
try {
|
|
4633
|
+
const result = await client.create('asset-condition-assessments', buildBody(params));
|
|
4634
|
+
return formatResult(result);
|
|
4635
|
+
}
|
|
4636
|
+
catch (err) {
|
|
4637
|
+
return formatError(err);
|
|
4638
|
+
}
|
|
4639
|
+
});
|
|
4640
|
+
server.tool('update_asset_condition_assessment', 'Update an existing asset condition assessment by ID. Requires asset_condition_assessments:write scope. Note: the purchase-cost writeback is create-only and cannot be triggered by an update.', {
|
|
4641
|
+
id: z.string().uuid().describe('Assessment ID'),
|
|
4642
|
+
assessed_on: z.string().optional().describe('Assessment date (YYYY-MM-DD)'),
|
|
4643
|
+
condition_score: z
|
|
4644
|
+
.number()
|
|
4645
|
+
.int()
|
|
4646
|
+
.min(0)
|
|
4647
|
+
.max(100)
|
|
4648
|
+
.optional()
|
|
4649
|
+
.describe('Condition score (0-100)'),
|
|
4650
|
+
replacement_cost: z.number().min(0).optional().describe('Current replacement value / CRV'),
|
|
4651
|
+
assessor_id: z.string().optional().describe('Assessor user ID'),
|
|
4652
|
+
method: z.enum(['visual', 'detailed', 'vendor']).optional().describe('Assessment method'),
|
|
4653
|
+
notes: z.string().optional().describe('Free-form notes'),
|
|
4654
|
+
defects: z.record(z.unknown()).optional().describe('Structured defect findings (JSON)'),
|
|
4655
|
+
}, async ({ id, ...rest }) => {
|
|
4656
|
+
try {
|
|
4657
|
+
const result = await client.update('asset-condition-assessments', id, buildBody(rest));
|
|
4658
|
+
return formatResult(result);
|
|
4659
|
+
}
|
|
4660
|
+
catch (err) {
|
|
4661
|
+
return formatError(err);
|
|
4662
|
+
}
|
|
4663
|
+
});
|
|
4664
|
+
server.tool('delete_asset_condition_assessment', 'Soft-delete an asset condition assessment by ID. Requires asset_condition_assessments:write scope.', { id: z.string().uuid().describe('Assessment ID') }, async ({ id }) => {
|
|
4665
|
+
try {
|
|
4666
|
+
const result = await client.remove('asset-condition-assessments', id);
|
|
4667
|
+
return formatResult(result);
|
|
4668
|
+
}
|
|
4669
|
+
catch (err) {
|
|
4670
|
+
return formatError(err);
|
|
4671
|
+
}
|
|
4672
|
+
});
|
|
4673
|
+
// ============================================================
|
|
4606
4674
|
// Infrastructure Asset Costs (scope: infrastructure_asset_costs)
|
|
4607
4675
|
// ============================================================
|
|
4608
4676
|
const INFRA_COST_CATEGORIES = [
|