@mediagraph/mcp 1.0.7 → 1.0.8

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.
Files changed (2) hide show
  1. package/dist/index.js +355 -93
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -651,7 +651,7 @@ var MediagraphClient = class {
651
651
  return this.request("GET", "/api/assets/updated_since_last_sync", { params });
652
652
  }
653
653
  async addTagsToAsset(id, tags) {
654
- return this.request("POST", `/api/assets/${id}/tag`, { body: { tags } });
654
+ return this.request("PUT", `/api/assets/${id}/tag`, { body: { asset: { add_tag_names: tags } } });
655
655
  }
656
656
  async getAssetAutoTags(id) {
657
657
  return this.request("GET", `/api/assets/${id}/auto_tags`);
@@ -659,16 +659,20 @@ var MediagraphClient = class {
659
659
  async getAssetFaceTaggings(id) {
660
660
  return this.request("GET", `/api/assets/${id}/face_taggings`);
661
661
  }
662
- async getAssetDownload(id, rendition) {
662
+ async getAssetDownload(id, options) {
663
663
  const params = {};
664
- if (rendition) params.rendition = rendition;
664
+ if (options?.size) params.size = options.size;
665
+ if (options?.watermarked) params.watermarked = true;
666
+ if (options?.version_number) params.version_number = options.version_number;
667
+ if (options?.via) params.via = options.via;
668
+ if (options?.skip_meta) params.skip_meta = true;
665
669
  return this.request("GET", `/api/assets/${id}/download`, { params });
666
670
  }
667
671
  async addAssetVersion(id, data) {
668
672
  return this.request("POST", `/api/assets/${id}/add_version`, { body: data });
669
673
  }
670
- async revertAsset(id, versionNumber) {
671
- return this.request("POST", `/api/assets/${id}/revert`, { body: { version_number: versionNumber } });
674
+ async revertAsset(id, version) {
675
+ return this.request("POST", `/api/assets/${id}/revert`, { body: { version } });
672
676
  }
673
677
  async requestAssetOptimization(id) {
674
678
  return this.request("POST", `/api/assets/${id}/request_optimization`);
@@ -677,14 +681,17 @@ var MediagraphClient = class {
677
681
  return this.request("POST", `/api/assets/${id}/complete_optimization`);
678
682
  }
679
683
  async removeAssetOptimizationRequest(id) {
680
- return this.request("DELETE", `/api/assets/${id}/remove_optimization_request`);
684
+ return this.request("POST", `/api/assets/${id}/remove_optimization_request`);
681
685
  }
682
686
  async updateAssetCollectiveWork(id, data) {
683
687
  return this.request("PUT", `/api/assets/${id}/update_collective_work`, { body: data });
684
688
  }
685
- async addAssetsToGroup(assetIds, groupId, groupType) {
689
+ async addAssetsToGroup(assetIds, groupId) {
686
690
  await this.request("POST", "/api/assets/add_group", {
687
- body: { asset_ids: assetIds, group_id: groupId, group_type: groupType }
691
+ body: {
692
+ ids: assetIds,
693
+ asset_group_id: groupId
694
+ }
688
695
  });
689
696
  }
690
697
  // ============================================================================
@@ -721,7 +728,9 @@ var MediagraphClient = class {
721
728
  return this.request("GET", "/api/collections/tree");
722
729
  }
723
730
  async getCollectionVisibleAssetCounts(ids) {
724
- return this.request("GET", "/api/collections/visible_asset_counts", { params: { ids } });
731
+ return this.request("POST", "/api/collections/visible_asset_counts", {
732
+ body: { asset_groups: ids.map((id) => ({ id })) }
733
+ });
725
734
  }
726
735
  async addAssetToCollection(collectionId, assetId) {
727
736
  await this.request("POST", `/api/collections/${collectionId}/add_asset`, { body: { asset_id: assetId } });
@@ -751,7 +760,7 @@ var MediagraphClient = class {
751
760
  return this.request("POST", `/api/lightboxes/${id}/transfer_ownership`, { body: { user_id: userId } });
752
761
  }
753
762
  async addAssetToLightbox(lightboxId, assetId) {
754
- await this.request("POST", `/api/lightboxes/${lightboxId}/add_asset`, { body: { asset_id: assetId } });
763
+ await this.addAssetsToGroup([Number(assetId)], Number(lightboxId));
755
764
  }
756
765
  // ============================================================================
757
766
  // Storage Folders
@@ -799,10 +808,10 @@ var MediagraphClient = class {
799
808
  return this.request("POST", "/api/tags/bulk_find", { body: { names } });
800
809
  }
801
810
  async addTagToTaxonomy(id, taxonomyId) {
802
- return this.request("POST", `/api/tags/${id}/add_taxonomy`, { body: { taxonomy_id: taxonomyId } });
811
+ return this.request("PUT", `/api/tags/${id}/add_taxonomy`, { body: { taxonomy_id: taxonomyId } });
803
812
  }
804
813
  async mergeTagInto(id, targetTagId) {
805
- await this.request("POST", `/api/tags/${id}/merge_into`, { body: { target_tag_id: targetTagId } });
814
+ await this.request("POST", `/api/tags/${id}/merge_into`, { body: { tag_2_id: targetTagId } });
806
815
  }
807
816
  async getTagEvents(params) {
808
817
  return this.request("GET", "/api/tags/events", { params });
@@ -816,8 +825,11 @@ var MediagraphClient = class {
816
825
  async getAutoTag(id) {
817
826
  return this.request("GET", `/api/auto_tags/${id}`);
818
827
  }
819
- async bulkFindAutoTags(names) {
820
- return this.request("POST", "/api/auto_tags/bulk_find", { body: { names } });
828
+ async bulkFindAutoTags(tagNames) {
829
+ return this.request("POST", "/api/auto_tags/bulk_find", { body: { tag_names: tagNames } });
830
+ }
831
+ async deleteAutoTag(id) {
832
+ await this.request("DELETE", `/api/auto_tags/${id}`);
821
833
  }
822
834
  // ============================================================================
823
835
  // Taggings
@@ -936,8 +948,10 @@ var MediagraphClient = class {
936
948
  async getShareLink(id) {
937
949
  return this.request("GET", `/api/share_links/${id}`);
938
950
  }
939
- async createShareLink(data) {
940
- return this.request("POST", "/api/share_links", { body: { share_link: data } });
951
+ async createShareLink(assetGroupId, data) {
952
+ return this.request("POST", `/api/asset_groups/${assetGroupId}/share_links`, {
953
+ body: data ? { share_link: data } : void 0
954
+ });
941
955
  }
942
956
  async updateShareLink(id, data) {
943
957
  return this.request("PUT", `/api/share_links/${id}`, { body: { share_link: data } });
@@ -1014,8 +1028,14 @@ var MediagraphClient = class {
1014
1028
  async listUploads(params) {
1015
1029
  return this.request("GET", "/api/uploads", { params });
1016
1030
  }
1017
- async createUpload() {
1018
- return this.request("POST", "/api/uploads");
1031
+ async createUpload(data) {
1032
+ return this.request("POST", "/api/uploads", data ? { body: { upload: data } } : void 0);
1033
+ }
1034
+ /**
1035
+ * Create upload session from a contribution - assets will go to the contribution's configured destination
1036
+ */
1037
+ async createUploadFromContribution(contributionId, data) {
1038
+ return this.request("POST", `/api/contributions/${contributionId}/uploads`, data ? { body: { upload: data } } : void 0);
1019
1039
  }
1020
1040
  async getUploadAssets(guid, params) {
1021
1041
  return this.request("GET", `/api/uploads/${guid}/assets`, { params });
@@ -1054,7 +1074,7 @@ var MediagraphClient = class {
1054
1074
  }
1055
1075
  }
1056
1076
  async setUploadDone(id) {
1057
- return this.request("POST", `/api/uploads/${id}/set_done`);
1077
+ return this.request("PUT", `/api/uploads/${id}/set_done`);
1058
1078
  }
1059
1079
  async canUpload() {
1060
1080
  return this.request("GET", "/api/can_upload");
@@ -1143,8 +1163,8 @@ var MediagraphClient = class {
1143
1163
  async exportCustomMetaField(id) {
1144
1164
  return this.request("GET", `/api/custom_meta_fields/${id}/export`);
1145
1165
  }
1146
- async importCustomMetaFields(data) {
1147
- return this.request("POST", "/api/custom_meta_fields/import", { body: data });
1166
+ async importCustomMetaFields(settings) {
1167
+ return this.request("POST", "/api/custom_meta_fields/import", { body: { settings } });
1148
1168
  }
1149
1169
  async getAccessRequestCustomMetaFields() {
1150
1170
  return this.request("GET", "/api/custom_meta_fields/access_requests");
@@ -1185,8 +1205,8 @@ var MediagraphClient = class {
1185
1205
  async deleteWorkflowStep(id) {
1186
1206
  await this.request("DELETE", `/api/workflow_steps/${id}`);
1187
1207
  }
1188
- async approveWorkflowStep(id) {
1189
- return this.request("POST", `/api/workflow_steps/${id}/approve`);
1208
+ async approveWorkflowStep(id, assetIds) {
1209
+ return this.request("POST", `/api/workflow_steps/${id}/approve`, { body: { asset_ids: assetIds } });
1190
1210
  }
1191
1211
  // ============================================================================
1192
1212
  // Comments
@@ -1197,8 +1217,11 @@ var MediagraphClient = class {
1197
1217
  async getComment(id) {
1198
1218
  return this.request("GET", `/api/comments/${id}`);
1199
1219
  }
1200
- async createComment(data) {
1201
- return this.request("POST", "/api/comments", { body: { comment: data } });
1220
+ async createComment(type, id, data) {
1221
+ return this.request("POST", "/api/comments", {
1222
+ params: { type, id },
1223
+ body: { comment: data }
1224
+ });
1202
1225
  }
1203
1226
  async updateComment(id, data) {
1204
1227
  return this.request("PUT", `/api/comments/${id}`, { body: { comment: data } });
@@ -1248,8 +1271,8 @@ var MediagraphClient = class {
1248
1271
  async getWebhookLogs(id, params) {
1249
1272
  return this.request("GET", `/api/webhooks/${id}/logs`, { params });
1250
1273
  }
1251
- async testWebhook(data) {
1252
- return this.request("POST", "/api/webhooks/test", { body: data });
1274
+ async testWebhook(url) {
1275
+ return this.request("POST", "/api/webhooks/test", { body: { url } });
1253
1276
  }
1254
1277
  async getWebhookPayload() {
1255
1278
  return this.request("GET", "/api/webhooks/payload");
@@ -1300,7 +1323,7 @@ var MediagraphClient = class {
1300
1323
  return this.request("GET", "/api/invites/find", { params });
1301
1324
  }
1302
1325
  async checkInviteEmail(email) {
1303
- return this.request("GET", "/api/invites/check_email", { params: { email } });
1326
+ return this.request("POST", "/api/invites/check_email", { body: { email } });
1304
1327
  }
1305
1328
  async getAvailableRoleLevels() {
1306
1329
  return this.request("GET", "/api/invites/available_role_levels");
@@ -1323,8 +1346,10 @@ var MediagraphClient = class {
1323
1346
  async deleteFilterGroup(id) {
1324
1347
  await this.request("DELETE", `/api/filter_groups/${id}`);
1325
1348
  }
1326
- async updateFilterGroupVisibility(id, shared) {
1327
- return this.request("PUT", `/api/filter_groups/${id}/update_visibility`, { body: { shared } });
1349
+ async updateFilterGroupVisibility(id, data) {
1350
+ return this.request("PUT", `/api/filter_groups/${id}/update_visibility`, {
1351
+ body: { name: data.name, type: data.type, visible: String(data.visible) }
1352
+ });
1328
1353
  }
1329
1354
  // ============================================================================
1330
1355
  // Search Queries
@@ -1362,8 +1387,8 @@ var MediagraphClient = class {
1362
1387
  async deleteCropPreset(id) {
1363
1388
  await this.request("DELETE", `/api/crop_presets/${id}`);
1364
1389
  }
1365
- async updateCropPresetPosition(id, position) {
1366
- return this.request("PUT", "/api/crop_presets/update_position", { body: { id, position } });
1390
+ async updateCropPresetPosition(oldIndex, newIndex) {
1391
+ return this.request("PUT", "/api/crop_presets/update_position", { body: { oldIndex, newIndex } });
1367
1392
  }
1368
1393
  // ============================================================================
1369
1394
  // Ingestions
@@ -1614,7 +1639,13 @@ COMMON SEARCH FIELDS:
1614
1639
  type: "object",
1615
1640
  properties: {
1616
1641
  id: idParam,
1617
- rendition: { type: "string", description: "Specific rendition (original, full, medium, small)" }
1642
+ size: {
1643
+ type: "string",
1644
+ enum: ["small", "permalink", "full", "original"],
1645
+ description: "Maximum size for the download (default: original)"
1646
+ },
1647
+ watermarked: { type: "boolean", description: "Request watermarked version" },
1648
+ version_number: { type: "number", description: "Specific version number to download" }
1618
1649
  },
1619
1650
  required: ["id"]
1620
1651
  }
@@ -1641,9 +1672,9 @@ COMMON SEARCH FIELDS:
1641
1672
  type: "object",
1642
1673
  properties: {
1643
1674
  id: idParam,
1644
- version_number: { type: "number", description: "Version number to revert to" }
1675
+ version: { type: "number", description: "Version number to revert to" }
1645
1676
  },
1646
- required: ["id", "version_number"]
1677
+ required: ["id", "version"]
1647
1678
  }
1648
1679
  },
1649
1680
  {
@@ -1692,7 +1723,11 @@ COMMON SEARCH FIELDS:
1692
1723
  return successResult(await client2.addTagsToAsset(args.id, args.tags));
1693
1724
  },
1694
1725
  async get_asset_download(args, { client: client2 }) {
1695
- return successResult(await client2.getAssetDownload(args.id, args.rendition));
1726
+ return successResult(await client2.getAssetDownload(args.id, {
1727
+ size: args.size,
1728
+ watermarked: args.watermarked,
1729
+ version_number: args.version_number
1730
+ }));
1696
1731
  },
1697
1732
  async get_asset_auto_tags(args, { client: client2 }) {
1698
1733
  return successResult(await client2.getAssetAutoTags(args.id));
@@ -1704,7 +1739,7 @@ COMMON SEARCH FIELDS:
1704
1739
  return successResult(await client2.getAssetDataVersions(args.asset_id));
1705
1740
  },
1706
1741
  async revert_asset(args, { client: client2 }) {
1707
- return successResult(await client2.revertAsset(args.id, args.version_number));
1742
+ return successResult(await client2.revertAsset(args.id, args.version));
1708
1743
  },
1709
1744
  async get_asset_counts(args, { client: client2 }) {
1710
1745
  return successResult(await client2.getAssetCounts(args));
@@ -1781,6 +1816,19 @@ var groupTools = {
1781
1816
  description: "Get collections hierarchy as a tree",
1782
1817
  inputSchema: { type: "object", properties: {}, required: [] }
1783
1818
  },
1819
+ // Multi-asset group operations
1820
+ {
1821
+ name: "add_assets_to_group",
1822
+ description: "Add multiple assets to a Collection or Lightbox at once",
1823
+ inputSchema: {
1824
+ type: "object",
1825
+ properties: {
1826
+ ids: { type: "array", items: { type: "number" }, description: "Array of asset IDs to add" },
1827
+ asset_group_id: { ...idParam, description: "ID of Collection or Lightbox" }
1828
+ },
1829
+ required: ["ids", "asset_group_id"]
1830
+ }
1831
+ },
1784
1832
  // Lightboxes
1785
1833
  {
1786
1834
  name: "list_lightboxes",
@@ -1893,6 +1941,13 @@ var groupTools = {
1893
1941
  async get_collections_tree(_args, { client: client2 }) {
1894
1942
  return successResult(await client2.getCollectionsTree());
1895
1943
  },
1944
+ async add_assets_to_group(args, { client: client2 }) {
1945
+ await client2.addAssetsToGroup(
1946
+ args.ids,
1947
+ args.asset_group_id
1948
+ );
1949
+ return successResult({ success: true, added_count: args.ids.length });
1950
+ },
1896
1951
  // Lightboxes
1897
1952
  async list_lightboxes(args, { client: client2 }) {
1898
1953
  return successResult(await client2.listLightboxes(args));
@@ -1990,6 +2045,11 @@ var tagTools = {
1990
2045
  description: "Get details of a specific tagging (tag-to-asset relationship)",
1991
2046
  inputSchema: { type: "object", properties: { id: idParam }, required: ["id"] }
1992
2047
  },
2048
+ {
2049
+ name: "delete_tagging",
2050
+ description: "Remove a tagging (untag an asset)",
2051
+ inputSchema: { type: "object", properties: { id: idParam }, required: ["id"] }
2052
+ },
1993
2053
  // Auto Tags
1994
2054
  {
1995
2055
  name: "list_auto_tags",
@@ -2000,6 +2060,25 @@ var tagTools = {
2000
2060
  required: []
2001
2061
  }
2002
2062
  },
2063
+ {
2064
+ name: "get_auto_tag",
2065
+ description: "Get auto tag details",
2066
+ inputSchema: { type: "object", properties: { id: idParam }, required: ["id"] }
2067
+ },
2068
+ {
2069
+ name: "bulk_find_auto_tags",
2070
+ description: "Find multiple auto tags by their names at once",
2071
+ inputSchema: {
2072
+ type: "object",
2073
+ properties: { tag_names: { type: "array", items: { type: "string" }, description: "Array of auto tag names to find" } },
2074
+ required: ["tag_names"]
2075
+ }
2076
+ },
2077
+ {
2078
+ name: "delete_auto_tag",
2079
+ description: "Delete/dismiss an auto tag",
2080
+ inputSchema: { type: "object", properties: { id: idParam }, required: ["id"] }
2081
+ },
2003
2082
  // Taxonomies
2004
2083
  {
2005
2084
  name: "list_taxonomies",
@@ -2085,10 +2164,24 @@ var tagTools = {
2085
2164
  async get_tagging(args, { client: client2 }) {
2086
2165
  return successResult(await client2.getTagging(args.id));
2087
2166
  },
2167
+ async delete_tagging(args, { client: client2 }) {
2168
+ await client2.deleteTagging(args.id);
2169
+ return successResult({ success: true });
2170
+ },
2088
2171
  // Auto Tags
2089
2172
  async list_auto_tags(args, { client: client2 }) {
2090
2173
  return successResult(await client2.listAutoTags(args));
2091
2174
  },
2175
+ async get_auto_tag(args, { client: client2 }) {
2176
+ return successResult(await client2.getAutoTag(args.id));
2177
+ },
2178
+ async bulk_find_auto_tags(args, { client: client2 }) {
2179
+ return successResult(await client2.bulkFindAutoTags(args.tag_names));
2180
+ },
2181
+ async delete_auto_tag(args, { client: client2 }) {
2182
+ await client2.deleteAutoTag(args.id);
2183
+ return successResult({ success: true });
2184
+ },
2092
2185
  // Taxonomies
2093
2186
  async list_taxonomies(args, { client: client2 }) {
2094
2187
  return successResult(await client2.listTaxonomies(args));
@@ -2173,18 +2266,27 @@ var sharingTools = {
2173
2266
  },
2174
2267
  {
2175
2268
  name: "create_share_link",
2176
- description: "Create a share link for assets, collection, or lightbox",
2269
+ description: "Create a share link for a Collection, Lightbox, or Storage Folder",
2177
2270
  inputSchema: {
2178
2271
  type: "object",
2179
2272
  properties: {
2180
- asset_ids: { type: "array", items: { type: "number" } },
2181
- collection_id: { type: "number" },
2182
- lightbox_id: { type: "number" },
2183
- name: { type: "string" },
2184
- password: { type: "string" },
2185
- expires_at: { type: "string" }
2273
+ asset_group_id: { ...idParam, description: "ID of the Collection, Lightbox, or Storage Folder to share" },
2274
+ enabled: { type: "boolean", description: "Enable the share link (default: true)" },
2275
+ image_and_video_permission: {
2276
+ type: "string",
2277
+ enum: ["view", "download_small", "download_large", "download_original"],
2278
+ description: "Permission level for images and videos"
2279
+ },
2280
+ other_permission: {
2281
+ type: "string",
2282
+ enum: ["view", "download"],
2283
+ description: "Permission level for other file types"
2284
+ },
2285
+ watermark_all: { type: "boolean", description: "Apply watermark to all downloads" },
2286
+ note: { type: "string", description: "Internal note" },
2287
+ expires_at: { type: "string", description: "Expiration date/time in ISO 8601 format" }
2186
2288
  },
2187
- required: []
2289
+ required: ["asset_group_id"]
2188
2290
  }
2189
2291
  },
2190
2292
  {
@@ -2226,7 +2328,8 @@ var sharingTools = {
2226
2328
  return successResult(await client2.getShareLink(args.id));
2227
2329
  },
2228
2330
  async create_share_link(args, { client: client2 }) {
2229
- return successResult(await client2.createShareLink(args));
2331
+ const { asset_group_id, ...data } = args;
2332
+ return successResult(await client2.createShareLink(asset_group_id, data));
2230
2333
  },
2231
2334
  async delete_share_link(args, { client: client2 }) {
2232
2335
  await client2.deleteShareLink(args.id);
@@ -2261,15 +2364,41 @@ var jobTools = {
2261
2364
  },
2262
2365
  {
2263
2366
  name: "create_bulk_job",
2264
- description: "Create a bulk job for batch operations on assets",
2367
+ description: `Create a bulk job for batch operations on assets. Supports multiple operation types:
2368
+ - Tag management: use tag_names + tag_mode (add/remove/replace)
2369
+ - Metadata updates: use description + description_mode (set/append/prepend), rating, rights_package_id
2370
+ - Organization: use add_asset_group_id + add_asset_group_type (Collection/Lightbox/StorageFolder)
2371
+ - AI processing: use run_custom_meta_field_ids + cmf_overwrite_mode (skip/overwrite)
2372
+ - Bulk actions: use destroy_all, restore_all, or generate_alt_text`,
2265
2373
  inputSchema: {
2266
2374
  type: "object",
2267
2375
  properties: {
2268
2376
  asset_ids: { type: "array", items: { type: "number" }, description: "Asset IDs to process" },
2269
- action: { type: "string", description: "Bulk action (add_tags, remove_tags, add_to_collection, etc.)" },
2270
- params: { type: "object", description: "Action parameters" }
2377
+ // Tag operations
2378
+ tag_names: { type: "array", items: { type: "string" }, description: "Tag names to add/remove/replace" },
2379
+ tag_mode: { type: "string", enum: ["add", "remove", "replace"], description: "Tag operation mode" },
2380
+ // Metadata operations
2381
+ description: { type: "string", description: "Description text to set/append/prepend" },
2382
+ description_mode: { type: "string", enum: ["set", "append", "prepend"], description: "Description operation mode" },
2383
+ rights_package_id: { type: "number", description: "Rights Package ID to assign" },
2384
+ rights_status: { type: "string", description: "Rights status code" },
2385
+ rating: { type: "number", minimum: 0, maximum: 5, description: "Rating value (0-5)" },
2386
+ // Organization operations
2387
+ add_asset_group_id: { type: "number", description: "ID of Collection/Lightbox/StorageFolder to add assets to" },
2388
+ add_asset_group_type: { type: "string", enum: ["Collection", "Lightbox", "StorageFolder"], description: "Type of asset group" },
2389
+ remove_asset_group_id: { type: "number", description: "ID of Collection/Lightbox to remove assets from" },
2390
+ remove_asset_group_type: { type: "string", description: "Type of asset group to remove from" },
2391
+ // Custom meta operations
2392
+ custom_meta: { type: "object", description: "Custom meta field values to set (keyed by field name)" },
2393
+ run_custom_meta_field_ids: { type: "array", items: { type: "number" }, description: "Custom Meta Field IDs to run AI on" },
2394
+ cmf_overwrite_mode: { type: "string", enum: ["skip", "overwrite"], description: "Whether to overwrite existing values when running AI" },
2395
+ // Bulk actions
2396
+ destroy_all: { type: "boolean", description: "Delete all specified assets" },
2397
+ restore_all: { type: "boolean", description: "Restore all specified assets from trash" },
2398
+ generate_alt_text: { type: "boolean", description: "Generate alt text using AI" },
2399
+ alt_text_generation_prompt: { type: "string", description: "Custom prompt for alt text generation" }
2271
2400
  },
2272
- required: ["asset_ids", "action"]
2401
+ required: ["asset_ids"]
2273
2402
  }
2274
2403
  },
2275
2404
  {
@@ -2415,34 +2544,45 @@ var socialTools = {
2415
2544
  // Comments
2416
2545
  {
2417
2546
  name: "list_comments",
2418
- description: "List comments on a resource",
2547
+ description: "List comments on a Lightbox or Collection",
2419
2548
  inputSchema: {
2420
2549
  type: "object",
2421
2550
  properties: {
2422
- commentable_type: { type: "string", enum: ["Asset", "Collection", "Lightbox"] },
2423
- commentable_id: { type: "number" },
2551
+ type: { type: "string", enum: ["Lightbox", "Collection"], description: "Type of commentable object" },
2552
+ id: { type: "number", description: "ID of the commentable object" },
2424
2553
  ...paginationParams
2425
2554
  },
2426
- required: ["commentable_type", "commentable_id"]
2555
+ required: ["type", "id"]
2427
2556
  }
2428
2557
  },
2429
2558
  {
2430
2559
  name: "create_comment",
2431
- description: "Create a comment",
2560
+ description: "Create a new comment on a Lightbox or Collection. Supports markdown and @mentions.",
2432
2561
  inputSchema: {
2433
2562
  type: "object",
2434
2563
  properties: {
2435
- body: { type: "string" },
2436
- commentable_type: { type: "string", enum: ["Asset", "Collection", "Lightbox"] },
2437
- commentable_id: { type: "number" },
2438
- parent_id: { type: "number" }
2564
+ type: { type: "string", enum: ["Lightbox", "Collection"], description: "Type of commentable object" },
2565
+ id: { type: "number", description: "ID of the commentable object" },
2566
+ text: { type: "string", description: "Comment text (supports markdown and @mentions)" }
2439
2567
  },
2440
- required: ["body", "commentable_type", "commentable_id"]
2568
+ required: ["type", "id", "text"]
2569
+ }
2570
+ },
2571
+ {
2572
+ name: "update_comment",
2573
+ description: "Update a comment. Only the comment author can update their own comments.",
2574
+ inputSchema: {
2575
+ type: "object",
2576
+ properties: {
2577
+ id: idParam,
2578
+ text: { type: "string", description: "Updated comment text" }
2579
+ },
2580
+ required: ["id", "text"]
2441
2581
  }
2442
2582
  },
2443
2583
  {
2444
2584
  name: "delete_comment",
2445
- description: "Delete a comment",
2585
+ description: "Delete a comment. Only the comment author can delete their own comments.",
2446
2586
  inputSchema: { type: "object", properties: { id: idParam }, required: ["id"] }
2447
2587
  },
2448
2588
  // Notifications
@@ -2463,7 +2603,17 @@ var socialTools = {
2463
2603
  return successResult(await client2.listComments(args));
2464
2604
  },
2465
2605
  async create_comment(args, { client: client2 }) {
2466
- return successResult(await client2.createComment(args));
2606
+ return successResult(await client2.createComment(
2607
+ args.type,
2608
+ args.id,
2609
+ { text: args.text }
2610
+ ));
2611
+ },
2612
+ async update_comment(args, { client: client2 }) {
2613
+ return successResult(await client2.updateComment(
2614
+ args.id,
2615
+ { text: args.text }
2616
+ ));
2467
2617
  },
2468
2618
  async delete_comment(args, { client: client2 }) {
2469
2619
  await client2.deleteComment(args.id);
@@ -2489,7 +2639,11 @@ var downloadTools = {
2489
2639
  type: "object",
2490
2640
  properties: {
2491
2641
  asset_ids: { type: "array", items: { type: "number" } },
2492
- rendition: { type: "string" }
2642
+ size: {
2643
+ type: "string",
2644
+ enum: ["small", "small-watermark", "permalink", "permalink-watermark", "full", "full-watermark", "original"],
2645
+ description: "Maximum size requested for assets in the download"
2646
+ }
2493
2647
  },
2494
2648
  required: ["asset_ids"]
2495
2649
  }
@@ -2565,7 +2719,10 @@ var uploadTools = {
2565
2719
 
2566
2720
  This creates a new asset in the user's Mediagraph library.
2567
2721
  Supports images, videos, audio, documents, and other media files.
2568
- The file will be processed and thumbnails/previews generated automatically.`,
2722
+ The file will be processed and thumbnails/previews generated automatically.
2723
+
2724
+ By default, assets are uploaded to the default storage folder. To upload to a specific destination,
2725
+ provide a contribution_id - the asset will go to the contribution's configured storage folder or lightbox.`,
2569
2726
  inputSchema: {
2570
2727
  type: "object",
2571
2728
  properties: {
@@ -2581,9 +2738,9 @@ The file will be processed and thumbnails/previews generated automatically.`,
2581
2738
  type: "string",
2582
2739
  description: "Filename with extension (required when using file_data)"
2583
2740
  },
2584
- storage_folder_id: {
2741
+ contribution_id: {
2585
2742
  type: "number",
2586
- description: "Optional: ID of the storage folder to upload into"
2743
+ description: "Optional: ID of a contribution (upload link) to upload through. Assets will go to the contribution's configured storage folder or lightbox."
2587
2744
  }
2588
2745
  },
2589
2746
  required: []
@@ -2593,7 +2750,10 @@ The file will be processed and thumbnails/previews generated automatically.`,
2593
2750
  name: "upload_files",
2594
2751
  description: `Upload multiple files from the local filesystem to Mediagraph.
2595
2752
  Creates new assets for each file in the user's Mediagraph library.
2596
- All files are uploaded in a single upload session.`,
2753
+ All files are uploaded in a single upload session.
2754
+
2755
+ By default, assets are uploaded to the default storage folder. To upload to a specific destination,
2756
+ provide a contribution_id - assets will go to the contribution's configured storage folder or lightbox.`,
2597
2757
  inputSchema: {
2598
2758
  type: "object",
2599
2759
  properties: {
@@ -2602,9 +2762,9 @@ All files are uploaded in a single upload session.`,
2602
2762
  items: { type: "string" },
2603
2763
  description: "Array of absolute paths to files on the local filesystem"
2604
2764
  },
2605
- storage_folder_id: {
2765
+ contribution_id: {
2606
2766
  type: "number",
2607
- description: "Optional: ID of the storage folder to upload into"
2767
+ description: "Optional: ID of a contribution (upload link) to upload through. Assets will go to the contribution's configured storage folder or lightbox."
2608
2768
  }
2609
2769
  },
2610
2770
  required: ["file_paths"]
@@ -2616,6 +2776,7 @@ All files are uploaded in a single upload session.`,
2616
2776
  const filePath = args.file_path;
2617
2777
  const fileDataB64 = args.file_data;
2618
2778
  const providedFilename = args.filename;
2779
+ const contributionId = args.contribution_id;
2619
2780
  let fileData;
2620
2781
  let filename;
2621
2782
  let fileSize;
@@ -2643,7 +2804,7 @@ All files are uploaded in a single upload session.`,
2643
2804
  return errorResult("Either file_path or file_data (with filename) is required");
2644
2805
  }
2645
2806
  const contentType = getMimeType(filename);
2646
- const upload = await client2.createUpload();
2807
+ const upload = contributionId ? await client2.createUploadFromContribution(contributionId) : await client2.createUpload();
2647
2808
  const preparedAsset = await client2.prepareAssetUpload(upload.guid, {
2648
2809
  filename,
2649
2810
  file_size: fileSize,
@@ -2653,7 +2814,7 @@ All files are uploaded in a single upload session.`,
2653
2814
  const asset = await client2.setAssetUploaded(preparedAsset.guid);
2654
2815
  await client2.setUploadDone(upload.id);
2655
2816
  return successResult({
2656
- message: `Successfully uploaded ${filename}`,
2817
+ message: `Successfully uploaded ${filename}${contributionId ? ` via contribution ${contributionId}` : ""}`,
2657
2818
  asset: {
2658
2819
  id: asset.id,
2659
2820
  guid: asset.guid,
@@ -2661,15 +2822,17 @@ All files are uploaded in a single upload session.`,
2661
2822
  file_size: asset.file_size,
2662
2823
  mime_type: asset.mime_type
2663
2824
  },
2664
- upload_guid: upload.guid
2825
+ upload_guid: upload.guid,
2826
+ contribution_id: contributionId
2665
2827
  });
2666
2828
  },
2667
2829
  async upload_files(args, { client: client2 }) {
2668
2830
  const filePaths = args.file_paths;
2831
+ const contributionId = args.contribution_id;
2669
2832
  if (!filePaths || filePaths.length === 0) {
2670
2833
  return errorResult("No files provided");
2671
2834
  }
2672
- const upload = await client2.createUpload();
2835
+ const upload = contributionId ? await client2.createUploadFromContribution(contributionId) : await client2.createUpload();
2673
2836
  const results = [];
2674
2837
  for (const filePath of filePaths) {
2675
2838
  try {
@@ -2705,8 +2868,9 @@ All files are uploaded in a single upload session.`,
2705
2868
  await client2.setUploadDone(upload.id);
2706
2869
  const successCount = results.filter((r) => r.success).length;
2707
2870
  return successResult({
2708
- message: `Uploaded ${successCount} of ${filePaths.length} files`,
2871
+ message: `Uploaded ${successCount} of ${filePaths.length} files${contributionId ? ` via contribution ${contributionId}` : ""}`,
2709
2872
  upload_guid: upload.guid,
2873
+ contribution_id: contributionId,
2710
2874
  results
2711
2875
  });
2712
2876
  }
@@ -2728,15 +2892,24 @@ var webhookTools = {
2728
2892
  },
2729
2893
  {
2730
2894
  name: "create_webhook",
2731
- description: "Create a webhook",
2895
+ description: "Create a webhook to receive event notifications",
2732
2896
  inputSchema: {
2733
2897
  type: "object",
2734
2898
  properties: {
2735
- name: { type: "string" },
2736
- url: { type: "string" },
2737
- events: { type: "array", items: { type: "string" } }
2899
+ name: { type: "string", description: "Webhook name" },
2900
+ url: { type: "string", description: "Destination URL to POST events to" },
2901
+ events: {
2902
+ type: "string",
2903
+ description: "Comma-separated list of events: asset.created, asset.updated, asset.deleted, asset.restored, collection.updated"
2904
+ },
2905
+ enabled: { type: "boolean", description: "Enable the webhook (default: true)" },
2906
+ asset_group_id: { type: "number", description: "Scope to specific Collection or StorageFolder" },
2907
+ include_download_url: { type: "boolean", description: "Include asset download URL in payload" },
2908
+ group_assets: { type: "boolean", description: "Group multiple asset events into single request" },
2909
+ trash: { type: "boolean", description: "Include trash events" },
2910
+ note: { type: "string", description: "Internal notes" }
2738
2911
  },
2739
- required: ["name", "url", "events"]
2912
+ required: ["name", "url"]
2740
2913
  }
2741
2914
  },
2742
2915
  {
@@ -2800,21 +2973,22 @@ var adminTools = {
2800
2973
  inputSchema: {
2801
2974
  type: "object",
2802
2975
  properties: {
2803
- email: { type: "string" },
2804
- role: { type: "string", enum: ["admin", "global_content", "global_library", "global_tagger", "general", "restricted"] }
2976
+ email: { type: "string", description: "Email address(es) to invite (comma/semicolon separated for multiple)" },
2977
+ role_level: { type: "string", enum: ["admin", "global_content", "global_library", "global_tagger", "general", "restricted"] },
2978
+ note: { type: "string", description: "Note to include in invite email" }
2805
2979
  },
2806
- required: ["email", "role"]
2980
+ required: ["email", "role_level"]
2807
2981
  }
2808
2982
  },
2809
2983
  {
2810
2984
  name: "update_invite",
2811
- description: "Update an invite (change email or role)",
2985
+ description: "Update an invite (change role or note)",
2812
2986
  inputSchema: {
2813
2987
  type: "object",
2814
2988
  properties: {
2815
2989
  id: idParam,
2816
- email: { type: "string" },
2817
- role: { type: "string", enum: ["admin", "global_content", "global_library", "global_tagger", "general", "restricted"] }
2990
+ role_level: { type: "string", enum: ["admin", "global_content", "global_library", "global_tagger", "general", "restricted"] },
2991
+ note: { type: "string" }
2818
2992
  },
2819
2993
  required: ["id"]
2820
2994
  }
@@ -2830,37 +3004,97 @@ var adminTools = {
2830
3004
  description: "List saved filter groups",
2831
3005
  inputSchema: { type: "object", properties: { ...paginationParams }, required: [] }
2832
3006
  },
3007
+ {
3008
+ name: "get_filter_group",
3009
+ description: "Get filter group details",
3010
+ inputSchema: { type: "object", properties: { id: idParam }, required: ["id"] }
3011
+ },
2833
3012
  {
2834
3013
  name: "create_filter_group",
2835
- description: "Save a filter group",
3014
+ description: "Create a new filter group with saved filter configurations",
3015
+ inputSchema: {
3016
+ type: "object",
3017
+ properties: {
3018
+ name: { type: "string" },
3019
+ filter_order: { type: "array", items: { type: "string" }, description: "Array of filter names in display order" }
3020
+ },
3021
+ required: ["name"]
3022
+ }
3023
+ },
3024
+ {
3025
+ name: "update_filter_group",
3026
+ description: "Update a filter group",
2836
3027
  inputSchema: {
2837
3028
  type: "object",
2838
3029
  properties: {
3030
+ id: idParam,
2839
3031
  name: { type: "string" },
2840
- filters: { type: "object", description: "Filter parameters to save" }
3032
+ filter_order: { type: "array", items: { type: "string" }, description: "Array of filter names in display order" }
3033
+ },
3034
+ required: ["id"]
3035
+ }
3036
+ },
3037
+ {
3038
+ name: "update_filter_group_visibility",
3039
+ description: "Update the visibility of a specific filter within a filter group",
3040
+ inputSchema: {
3041
+ type: "object",
3042
+ properties: {
3043
+ id: idParam,
3044
+ name: { type: "string", description: "Filter name" },
3045
+ type: { type: "string", enum: ["explore", "manage"], description: "Visibility type" },
3046
+ visible: { type: "boolean", description: "Visibility status" }
2841
3047
  },
2842
- required: ["name", "filters"]
3048
+ required: ["id", "name", "type", "visible"]
2843
3049
  }
2844
3050
  },
3051
+ {
3052
+ name: "delete_filter_group",
3053
+ description: "Delete a filter group",
3054
+ inputSchema: { type: "object", properties: { id: idParam }, required: ["id"] }
3055
+ },
2845
3056
  // Search Queries
2846
3057
  {
2847
3058
  name: "list_search_queries",
2848
3059
  description: "List saved search queries",
2849
3060
  inputSchema: { type: "object", properties: { ...paginationParams }, required: [] }
2850
3061
  },
3062
+ {
3063
+ name: "get_search_query",
3064
+ description: "Get search query details",
3065
+ inputSchema: { type: "object", properties: { id: idParam }, required: ["id"] }
3066
+ },
2851
3067
  {
2852
3068
  name: "create_search_query",
2853
- description: "Save a search query",
3069
+ description: "Save a new search query. The sql field should contain an Elasticsearch SQL WHERE clause.",
2854
3070
  inputSchema: {
2855
3071
  type: "object",
2856
3072
  properties: {
3073
+ name: { type: "string", description: "Search name" },
3074
+ description: { type: "string", description: "Search description" },
3075
+ sql: { type: "string", description: "SQL WHERE clause (Elasticsearch SQL syntax)" }
3076
+ },
3077
+ required: ["name", "sql"]
3078
+ }
3079
+ },
3080
+ {
3081
+ name: "update_search_query",
3082
+ description: "Update a saved search query name or description. Note: The SQL query cannot be changed after creation.",
3083
+ inputSchema: {
3084
+ type: "object",
3085
+ properties: {
3086
+ id: idParam,
2857
3087
  name: { type: "string" },
2858
- query: { type: "string" },
2859
- filters: { type: "object" }
3088
+ description: { type: "string" }
2860
3089
  },
2861
- required: ["name", "query"]
3090
+ required: ["id"]
2862
3091
  }
2863
3092
  },
3093
+ {
3094
+ name: "delete_search_query",
3095
+ description: "Delete a saved search query",
3096
+ inputSchema: { type: "object", properties: { id: idParam }, required: ["id"] }
3097
+ },
2864
3098
  // Crop Presets
2865
3099
  {
2866
3100
  name: "list_crop_presets",
@@ -2906,7 +3140,7 @@ var adminTools = {
2906
3140
  // Contributions
2907
3141
  {
2908
3142
  name: "list_contributions",
2909
- description: "List contribution portals",
3143
+ description: "List contribution portals (upload links). Use contribution_id with upload_file/upload_files to upload to a specific storage folder or lightbox.",
2910
3144
  inputSchema: { type: "object", properties: { ...paginationParams }, required: [] }
2911
3145
  },
2912
3146
  {
@@ -2964,16 +3198,44 @@ var adminTools = {
2964
3198
  async list_filter_groups(args, { client: client2 }) {
2965
3199
  return successResult(await client2.listFilterGroups(args));
2966
3200
  },
3201
+ async get_filter_group(args, { client: client2 }) {
3202
+ return successResult(await client2.getFilterGroup(args.id));
3203
+ },
2967
3204
  async create_filter_group(args, { client: client2 }) {
2968
3205
  return successResult(await client2.createFilterGroup(args));
2969
3206
  },
3207
+ async update_filter_group(args, { client: client2 }) {
3208
+ const { id, ...data } = args;
3209
+ return successResult(await client2.updateFilterGroup(id, data));
3210
+ },
3211
+ async update_filter_group_visibility(args, { client: client2 }) {
3212
+ return successResult(await client2.updateFilterGroupVisibility(
3213
+ args.id,
3214
+ { name: args.name, type: args.type, visible: args.visible }
3215
+ ));
3216
+ },
3217
+ async delete_filter_group(args, { client: client2 }) {
3218
+ await client2.deleteFilterGroup(args.id);
3219
+ return successResult({ success: true });
3220
+ },
2970
3221
  // Search Queries
2971
3222
  async list_search_queries(args, { client: client2 }) {
2972
3223
  return successResult(await client2.listSearchQueries(args));
2973
3224
  },
3225
+ async get_search_query(args, { client: client2 }) {
3226
+ return successResult(await client2.getSearchQuery(args.id));
3227
+ },
2974
3228
  async create_search_query(args, { client: client2 }) {
2975
3229
  return successResult(await client2.createSearchQuery(args));
2976
3230
  },
3231
+ async update_search_query(args, { client: client2 }) {
3232
+ const { id, ...data } = args;
3233
+ return successResult(await client2.updateSearchQuery(id, data));
3234
+ },
3235
+ async delete_search_query(args, { client: client2 }) {
3236
+ await client2.deleteSearchQuery(args.id);
3237
+ return successResult({ success: true });
3238
+ },
2977
3239
  // Crop Presets
2978
3240
  async list_crop_presets(args, { client: client2 }) {
2979
3241
  return successResult(await client2.listCropPresets(args));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediagraph/mcp",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "MCP server for Mediagraph - Media Asset Management Platform",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",