@assetlab/mcp-server 1.19.4 → 1.19.6

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.
@@ -1922,6 +1922,43 @@ export function registerWriteTools(server, client) {
1922
1922
  }
1923
1923
  });
1924
1924
  // ============================================================
1925
+ // Asset Parts (scope: asset_parts)
1926
+ // ============================================================
1927
+ server.tool('create_asset_part', 'Link a part to an asset (creates an asset-part association). Requires asset_parts:write scope.', {
1928
+ asset_id: z.string().uuid().describe('Asset ID (required)'),
1929
+ part_id: z.string().uuid().describe('Part ID (required)'),
1930
+ quantity: z.number().min(0).optional().describe('Quantity of this part on the asset'),
1931
+ }, async (params) => {
1932
+ try {
1933
+ const result = await client.create('asset-parts', buildBody(params));
1934
+ return formatResult(result);
1935
+ }
1936
+ catch (err) {
1937
+ return formatError(err);
1938
+ }
1939
+ });
1940
+ server.tool('update_asset_part', 'Update the quantity of an asset-part association by ID. Requires asset_parts:write scope.', {
1941
+ id: z.string().uuid().describe('Asset-part association ID'),
1942
+ quantity: z.number().min(0).optional().describe('New quantity'),
1943
+ }, async ({ id, ...rest }) => {
1944
+ try {
1945
+ const result = await client.update('asset-parts', id, buildBody(rest));
1946
+ return formatResult(result);
1947
+ }
1948
+ catch (err) {
1949
+ return formatError(err);
1950
+ }
1951
+ });
1952
+ server.tool('delete_asset_part', 'Remove a part from an asset by association ID. Requires asset_parts:write scope.', { id: z.string().uuid().describe('Asset-part association ID') }, async ({ id }) => {
1953
+ try {
1954
+ const result = await client.remove('asset-parts', id);
1955
+ return formatResult(result);
1956
+ }
1957
+ catch (err) {
1958
+ return formatError(err);
1959
+ }
1960
+ });
1961
+ // ============================================================
1925
1962
  // 32. Systems (scope: systems)
1926
1963
  // ============================================================
1927
1964
  server.tool('create_system', 'Create a new system. Requires systems:write scope.', {