@assetlab/mcp-server 1.23.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.
@@ -4409,6 +4409,11 @@ export function registerWriteTools(server, client) {
4409
4409
  feature_type: z.enum(FEATURE_TYPES).describe('"segment" (LineString) or "node" (Point)'),
4410
4410
  geometry: featureGeometry.describe('GeoJSON geometry — Point for nodes, LineString for segments'),
4411
4411
  name: z.string().max(500).optional().describe('Feature name'),
4412
+ feature_code: z
4413
+ .string()
4414
+ .max(100)
4415
+ .optional()
4416
+ .describe('Feature ID — human-readable asset identifier, unique per tenant (typically the source GIS asset id)'),
4412
4417
  description: z.string().optional().describe('Description'),
4413
4418
  external_ids: z.record(z.unknown()).optional().describe('Free-form external ID map'),
4414
4419
  from_street: z.string().max(200).optional().describe('From street (segments)'),
@@ -4478,6 +4483,7 @@ export function registerWriteTools(server, client) {
4478
4483
  id: z.string().uuid().describe('Infrastructure asset ID'),
4479
4484
  geometry: featureGeometry.optional().describe('Replacement GeoJSON geometry'),
4480
4485
  name: z.string().max(500).optional(),
4486
+ feature_code: z.string().max(100).optional(),
4481
4487
  description: z.string().optional(),
4482
4488
  external_ids: z.record(z.unknown()).optional(),
4483
4489
  from_street: z.string().max(200).optional(),
@@ -4597,6 +4603,74 @@ export function registerWriteTools(server, client) {
4597
4603
  }
4598
4604
  });
4599
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
+ // ============================================================
4600
4674
  // Infrastructure Asset Costs (scope: infrastructure_asset_costs)
4601
4675
  // ============================================================
4602
4676
  const INFRA_COST_CATEGORIES = [
@@ -4605,6 +4679,7 @@ export function registerWriteTools(server, client) {
4605
4679
  'Operation',
4606
4680
  'Replacement',
4607
4681
  'Decommission',
4682
+ 'Other',
4608
4683
  ];
4609
4684
  server.tool('create_infrastructure_asset_cost', 'Record a cost against an infrastructure feature. work_order_number is derived server-side from work_order_id; do not set it. Requires infrastructure_asset_costs:write scope.', {
4610
4685
  feature_id: z.string().uuid().describe('Infrastructure feature ID (required)'),