@assetlab/mcp-server 1.24.0 → 1.25.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.
@@ -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("When true, overwrites the asset's purchase_cost with replacement_cost (CRV). The prior purchase cost is preserved on this assessment as previous_purchase_cost. Create-only side-effect."),
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 = [