@papermark/mcp-server 0.6.0 → 0.8.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.
@@ -67,6 +67,9 @@ var documentObjectOutputSchema = z.object({
67
67
  content_type: nullableStringOutputSchema(
68
68
  "Document MIME type, such as `application/pdf`, or null when unknown."
69
69
  ),
70
+ url: nullableStringOutputSchema(
71
+ "For `link` and `notion` documents, the external target URL the document points to. Null for file-based documents."
72
+ ),
70
73
  num_pages: nullableIntegerOutputSchema(
71
74
  "Number of pages, or null when unknown."
72
75
  ),
@@ -85,6 +88,12 @@ var linkObjectOutputSchema = z.object({
85
88
  target_type: z.enum(["document", "dataroom"]).describe(
86
89
  "The kind of resource this link points at. The matching `document_id` / `dataroom_id` field is populated; the other is null."
87
90
  ),
91
+ audience_type: z.enum(["general", "group", "team"]).describe(
92
+ "Who the link is for. `general` links are open to anyone passing the access controls; `group` links admit only members of the dataroom group in `group_id`."
93
+ ),
94
+ group_id: nullableStringOutputSchema(
95
+ "Dataroom group this link is scoped to. Only set when `audience_type` is `group`."
96
+ ),
88
97
  document_id: nullableStringOutputSchema(
89
98
  "Target document id when this is a document link, otherwise null."
90
99
  ),
@@ -371,6 +380,92 @@ var foldersListOutputSchema = z.object({
371
380
  var versionsListOutputSchema = z.object({
372
381
  versions: z.array(documentVersionObjectOutputSchema).describe("Document versions.")
373
382
  });
383
+ var dataroomGroupObjectOutputSchema = z.object({
384
+ id: z.string().describe("Unique dataroom group id."),
385
+ object: z.literal("dataroom_group").describe(
386
+ "String representing the object's type. Always `dataroom_group`."
387
+ ),
388
+ name: z.string().describe("Group name."),
389
+ allow_all: z.boolean().describe(
390
+ "When true, anyone passing the link's other access gates is treated as a member \u2014 the email/domain membership check is skipped."
391
+ ),
392
+ domains: z.array(z.string()).describe(
393
+ "Email domains whose addresses are automatically treated as members (e.g. `acme.com`)."
394
+ ),
395
+ member_count: integerOutputSchema("Number of explicit email members."),
396
+ link_count: integerOutputSchema("Number of links scoped to this group."),
397
+ dataroom_id: z.string().describe("Dataroom the group belongs to."),
398
+ created: dateTimeOutputSchema("When the group was created."),
399
+ updated_at: dateTimeOutputSchema("When the group was last updated.")
400
+ }).passthrough().describe("Papermark dataroom viewer group object.");
401
+ var dataroomGroupMemberObjectOutputSchema = z.object({
402
+ id: z.string().describe("Membership id \u2014 use it to remove the member."),
403
+ object: z.literal("dataroom_group_member").describe(
404
+ "String representing the object's type. Always `dataroom_group_member`."
405
+ ),
406
+ email: z.string().describe("Member's email address."),
407
+ viewer_id: z.string().describe("Id of the team-level viewer this membership points at."),
408
+ created: dateTimeOutputSchema("When the member was added.")
409
+ }).passthrough().describe("Dataroom group membership object.");
410
+ var permissionItemTypeEnum = z.enum(["dataroom_document", "dataroom_folder"]).describe(
411
+ "Kind of dataroom item. `dataroom_document` targets a dataroom-document attachment id (from `list_dataroom_documents`); `dataroom_folder` targets a dataroom folder id (from `list_dataroom_folders`)."
412
+ );
413
+ var dataroomGroupPermissionObjectOutputSchema = z.object({
414
+ object: z.literal("dataroom_group_permission").describe(
415
+ "String representing the object's type. Always `dataroom_group_permission`."
416
+ ),
417
+ item_id: z.string().describe("Dataroom-document or dataroom-folder id."),
418
+ item_type: permissionItemTypeEnum,
419
+ can_view: z.boolean().describe("Whether the group can view the item."),
420
+ can_download: z.boolean().describe("Whether the group can download the item."),
421
+ updated_at: dateTimeOutputSchema("When the permission was last changed.")
422
+ }).passthrough().describe("Per-item access control for a dataroom group.");
423
+ var linkPermissionObjectOutputSchema = z.object({
424
+ object: z.literal("link_permission").describe(
425
+ "String representing the object's type. Always `link_permission`."
426
+ ),
427
+ item_id: z.string().describe("Dataroom-document or dataroom-folder id."),
428
+ item_type: permissionItemTypeEnum,
429
+ can_view: z.boolean().describe("Whether viewers can view the item."),
430
+ can_download: z.boolean().describe("Whether viewers can download the item."),
431
+ can_download_original: z.boolean().describe(
432
+ "Whether the original (non-watermarked) file can be downloaded. Always false for permissions written via the API."
433
+ ),
434
+ updated_at: dateTimeOutputSchema("When the permission was last changed.")
435
+ }).passthrough().describe("Per-item file permission override on a dataroom link.");
436
+ var permissionEntryInputSchema = z.object({
437
+ item_id: z.string().min(1).describe(
438
+ "Dataroom-document attachment id (from `list_dataroom_documents`) or dataroom folder id (from `list_dataroom_folders`) \u2014 NOT the team-library document id."
439
+ ),
440
+ item_type: permissionItemTypeEnum,
441
+ can_view: z.boolean().describe("Allow viewing the item."),
442
+ can_download: z.boolean().describe("Allow downloading the item.")
443
+ }).describe("One per-item permission entry.");
444
+ var dataroomGroupOutputSchema = z.object({
445
+ group: dataroomGroupObjectOutputSchema.describe(
446
+ "Dataroom group returned by the tool."
447
+ )
448
+ });
449
+ var dataroomGroupsListOutputSchema = z.object({
450
+ groups: z.array(dataroomGroupObjectOutputSchema).describe("Dataroom groups in the current page."),
451
+ next_cursor: cursorOutputSchema
452
+ });
453
+ var dataroomGroupMembersListOutputSchema = z.object({
454
+ members: z.array(dataroomGroupMemberObjectOutputSchema).describe("Group members in the current page."),
455
+ next_cursor: cursorOutputSchema
456
+ });
457
+ var dataroomGroupPermissionsListOutputSchema = z.object({
458
+ permissions: z.array(dataroomGroupPermissionObjectOutputSchema).describe("Per-item access controls."),
459
+ next_cursor: cursorOutputSchema
460
+ });
461
+ var dataroomGroupPermissionsSetOutputSchema = z.object({
462
+ permissions: z.array(dataroomGroupPermissionObjectOutputSchema).describe(
463
+ "Effective rows for every touched item \u2014 the entries sent plus auto-shown ancestor folders."
464
+ )
465
+ });
466
+ var linkPermissionsListOutputSchema = z.object({
467
+ permissions: z.array(linkPermissionObjectOutputSchema).describe("Per-item permission overrides on the link.")
468
+ });
374
469
  var deletedObjectOutputSchema = z.object({
375
470
  id: z.string().describe("ID of the deleted object."),
376
471
  object: z.enum([
@@ -379,7 +474,9 @@ var deletedObjectOutputSchema = z.object({
379
474
  "link",
380
475
  "dataroom",
381
476
  "dataroom_folder",
382
- "dataroom_document"
477
+ "dataroom_document",
478
+ "dataroom_group",
479
+ "dataroom_group_member"
383
480
  ]).describe("The type of object that was deleted."),
384
481
  deleted: z.literal(true).describe("Always `true`. Confirms the object was deleted.")
385
482
  });
@@ -430,6 +527,12 @@ Never share a link to a document the user didn't explicitly name. Requires scope
430
527
  inputSchema: {
431
528
  document_id: z.string().optional().describe("Document id \u2014 required unless `dataroom_id` is set"),
432
529
  dataroom_id: z.string().optional().describe("Dataroom id \u2014 alternative to document_id"),
530
+ audience_type: z.enum(["general", "group"]).optional().describe(
531
+ "Set to `group` (dataroom links only, together with `group_id`) to scope the link to a dataroom group. Group links are always email-protected; only group members (by email or domain) can open them."
532
+ ),
533
+ group_id: z.string().optional().describe(
534
+ "Dataroom group id from `list_dataroom_groups` \u2014 required when `audience_type` is `group`; must belong to the same dataroom"
535
+ ),
433
536
  name: z.string().optional().describe("Human-readable label for the link"),
434
537
  expires_at: z.string().datetime().optional().describe("ISO 8601 timestamp after which the link stops working"),
435
538
  password: z.string().optional().describe("Require viewers to enter this password"),
@@ -453,6 +556,7 @@ var listLinksContract = {
453
556
  inputSchema: {
454
557
  document_id: z.string().optional().describe("Filter links for a specific document"),
455
558
  dataroom_id: z.string().optional().describe("Filter links for a specific dataroom"),
559
+ group_id: z.string().optional().describe("Filter to group links scoped to a specific dataroom group"),
456
560
  limit: z.number().int().min(1).max(100).optional().describe("Page size"),
457
561
  cursor: z.string().optional().describe("Pagination cursor")
458
562
  }
@@ -679,11 +783,13 @@ var getDocumentVersionContract = {
679
783
  var addDocumentVersionContract = {
680
784
  name: "add_document_version",
681
785
  title: "Add a new document version",
682
- description: `Upload a new version of an existing document, fetched from a public HTTPS URL. The new version becomes primary by default; live links automatically serve the new file.
786
+ description: `Add a new version of an existing document. The new version becomes primary by default; live links automatically serve it.
787
+
788
+ For a file document, pass \`source_url\` \u2014 a public HTTPS URL the server fetches as the new file. For a \`link\`/\`notion\` document, pass \`external_url\` to repoint it at a new URL (its type is preserved; the URL is stored as-is, not downloaded). Provide exactly one.
683
789
 
684
790
  WORKFLOW:
685
791
  (1) Resolve the target document via \`search_documents\` or \`list_documents\`.
686
- (2) The user must give you a public HTTPS URL the API can fetch. Don't fabricate URLs.
792
+ (2) The user must give you the URL \u2014 don't fabricate one.
687
793
  (3) After creation, mention the version_number so the user can promote/rollback later.
688
794
 
689
795
  NOTE: Adding a version from a local file path is not supported by this MCP tool \u2014 for that, use the \`upload_document\` tool to create a new document, or have the user upload via the Papermark UI.
@@ -693,7 +799,14 @@ Requires scope \`documents.write\`.`,
693
799
  document_id: z.string().min(1),
694
800
  source_url: z.string().url().refine((s) => s.startsWith("https://"), {
695
801
  message: "source_url must use https://"
696
- }).describe("Public HTTPS URL the server should fetch as the new version")
802
+ }).optional().describe(
803
+ "Public HTTPS URL the server fetches as the new version (file documents only)"
804
+ ),
805
+ external_url: z.string().url().refine((s) => s.startsWith("https://"), {
806
+ message: "external_url must use https://"
807
+ }).optional().describe(
808
+ "New target URL for a link/notion document, stored as-is (not downloaded). The document's type is preserved."
809
+ )
697
810
  }
698
811
  };
699
812
  var promoteDocumentVersionContract = {
@@ -809,6 +922,12 @@ Requires scope \`links.write\`.`,
809
922
  name: z.string().optional(),
810
923
  expires_at: z.string().datetime().nullable().optional().describe("ISO 8601 timestamp, or null to clear the expiry"),
811
924
  password: z.string().min(1).nullable().optional().describe("New password, or null to remove password protection"),
925
+ audience_type: z.enum(["general", "group"]).optional().describe(
926
+ "Switch the link's audience. `group` (dataroom links only) needs a `group_id` here or already on the link and forces email protection; `general` clears the group scope."
927
+ ),
928
+ group_id: z.string().nullable().optional().describe(
929
+ 'Dataroom group id from `list_dataroom_groups`. Set with `audience_type: "group"`, or alone to swap the group of an existing group link.'
930
+ ),
812
931
  email_protected: z.boolean().optional(),
813
932
  email_authenticated: z.boolean().optional(),
814
933
  allow_download: z.boolean().optional(),
@@ -969,6 +1088,150 @@ var moveDataroomFolderContract = {
969
1088
  parent_id: z.string().nullable()
970
1089
  }
971
1090
  };
1091
+ var listDataroomGroupsContract = {
1092
+ name: "list_dataroom_groups",
1093
+ title: "List dataroom groups",
1094
+ description: 'List viewer groups in a dataroom. Groups define an audience (members by email or domain) plus per-item view/download permissions, and are shared via group links (`create_link` with `audience_type: "group"`). Requires scope `datarooms.read`.',
1095
+ inputSchema: {
1096
+ dataroom_id: z.string().min(1),
1097
+ limit: z.number().int().min(1).max(100).optional(),
1098
+ cursor: z.string().optional()
1099
+ }
1100
+ };
1101
+ var getDataroomGroupContract = {
1102
+ name: "get_dataroom_group",
1103
+ title: "Get a dataroom group",
1104
+ description: "Fetch a single dataroom group with its domain rules, allow-all flag, and member/link counts. Requires scope `datarooms.read`.",
1105
+ inputSchema: {
1106
+ dataroom_id: z.string().min(1),
1107
+ group_id: z.string().min(1)
1108
+ }
1109
+ };
1110
+ var createDataroomGroupContract = {
1111
+ name: "create_dataroom_group",
1112
+ title: "Create a dataroom group",
1113
+ description: `Create a viewer group in a dataroom.
1114
+
1115
+ WORKFLOW:
1116
+ (1) Create the group (optionally with \`domains\` or \`allow_all\`).
1117
+ (2) Add explicit members via \`add_dataroom_group_members\`.
1118
+ (3) Grant document/folder access via \`set_dataroom_group_permissions\` \u2014 a new group sees NOTHING until permissions are set.
1119
+ (4) Share it by creating a link with \`audience_type: "group"\`.
1120
+
1121
+ Requires scope \`datarooms.write\`.`,
1122
+ inputSchema: {
1123
+ dataroom_id: z.string().min(1),
1124
+ name: z.string().min(1).max(255).describe("Group name"),
1125
+ allow_all: z.boolean().optional().describe(
1126
+ "Treat anyone passing the link's access gates as a member (skips the email/domain membership check)"
1127
+ ),
1128
+ domains: z.array(z.string().min(1)).max(100).optional().describe(
1129
+ "Email domains treated as members, e.g. ['acme.com'] admits jane@acme.com"
1130
+ )
1131
+ }
1132
+ };
1133
+ var updateDataroomGroupContract = {
1134
+ name: "update_dataroom_group",
1135
+ title: "Update a dataroom group",
1136
+ description: "Rename a dataroom group or change its `domains` / `allow_all` audience rules. PATCH semantics \u2014 omitted fields stay as they are; a passed `domains` array REPLACES the current one. Requires scope `datarooms.write`.",
1137
+ inputSchema: {
1138
+ dataroom_id: z.string().min(1),
1139
+ group_id: z.string().min(1),
1140
+ name: z.string().min(1).max(255).optional(),
1141
+ allow_all: z.boolean().optional(),
1142
+ domains: z.array(z.string().min(1)).max(100).optional()
1143
+ }
1144
+ };
1145
+ var deleteDataroomGroupContract = {
1146
+ name: "delete_dataroom_group",
1147
+ title: "Delete a dataroom group",
1148
+ description: `Delete a dataroom group, its memberships, its permissions, AND every share link pointing at it \u2014 active group links stop resolving immediately.
1149
+
1150
+ ALWAYS confirm with the user before calling (echo the group name and its link count via \`get_dataroom_group\`). This is irreversible. Requires scope \`datarooms.write\`.`,
1151
+ inputSchema: {
1152
+ dataroom_id: z.string().min(1),
1153
+ group_id: z.string().min(1)
1154
+ }
1155
+ };
1156
+ var listDataroomGroupMembersContract = {
1157
+ name: "list_dataroom_group_members",
1158
+ title: "List dataroom group members",
1159
+ description: "List a group's explicit email members with their membership ids (needed for `remove_dataroom_group_member`). Viewers admitted via the group's `domains` or `allow_all` are not listed. Requires scope `datarooms.read`.",
1160
+ inputSchema: {
1161
+ dataroom_id: z.string().min(1),
1162
+ group_id: z.string().min(1),
1163
+ limit: z.number().int().min(1).max(100).optional(),
1164
+ cursor: z.string().optional()
1165
+ }
1166
+ };
1167
+ var addDataroomGroupMembersContract = {
1168
+ name: "add_dataroom_group_members",
1169
+ title: "Add dataroom group members",
1170
+ description: "Add members to a dataroom group by email (up to 500 per call). Idempotent \u2014 already-present members are skipped. NO invitation emails are sent; members gain access the next time they open a group link. Requires scope `datarooms.write`.",
1171
+ inputSchema: {
1172
+ dataroom_id: z.string().min(1),
1173
+ group_id: z.string().min(1),
1174
+ emails: z.array(z.string().email()).min(1).max(500).describe("Email addresses to add as members")
1175
+ }
1176
+ };
1177
+ var removeDataroomGroupMemberContract = {
1178
+ name: "remove_dataroom_group_member",
1179
+ title: "Remove a dataroom group member",
1180
+ description: "Remove a member from a dataroom group by membership id (from `list_dataroom_group_members` \u2014 NOT the email or viewer id). The viewer itself is kept; only this group membership is removed. Requires scope `datarooms.write`.",
1181
+ inputSchema: {
1182
+ dataroom_id: z.string().min(1),
1183
+ group_id: z.string().min(1),
1184
+ member_id: z.string().min(1).describe("Membership id from `list_dataroom_group_members`")
1185
+ }
1186
+ };
1187
+ var getDataroomGroupPermissionsContract = {
1188
+ name: "get_dataroom_group_permissions",
1189
+ title: "Get dataroom group permissions",
1190
+ description: "List a group's per-item access controls. Items WITHOUT an entry are invisible to the group's viewers. Requires scope `datarooms.read`.",
1191
+ inputSchema: {
1192
+ dataroom_id: z.string().min(1),
1193
+ group_id: z.string().min(1),
1194
+ limit: z.number().int().min(1).max(100).optional(),
1195
+ cursor: z.string().optional()
1196
+ }
1197
+ };
1198
+ var setDataroomGroupPermissionsContract = {
1199
+ name: "set_dataroom_group_permissions",
1200
+ title: "Set dataroom group permissions",
1201
+ description: `Upsert per-item view/download permissions for a dataroom group. DELTA semantics: entries you send are upserted, entries you omit keep their current state. Ancestor folders of any item made visible are automatically set to \`can_view: true\`.
1202
+
1203
+ WORKFLOW:
1204
+ (1) Get item ids from \`list_dataroom_documents\` (attachment ids) / \`list_dataroom_folders\` (folder ids) \u2014 NOT team-library document ids.
1205
+ (2) Send one entry per item to change. To hide an item, send it with \`can_view: false, can_download: false\`.
1206
+
1207
+ Requires scope \`datarooms.write\`.`,
1208
+ inputSchema: {
1209
+ dataroom_id: z.string().min(1),
1210
+ group_id: z.string().min(1),
1211
+ permissions: z.array(permissionEntryInputSchema).min(1).max(1e3).describe("Permission entries to upsert")
1212
+ }
1213
+ };
1214
+ var getLinkPermissionsContract = {
1215
+ name: "get_link_permissions",
1216
+ title: "Get link permissions",
1217
+ description: "List a dataroom link's per-item file permission overrides. Empty when the link has no overrides \u2014 viewers then see items per the link's group (group links) or the full dataroom. On group-audience links the group's permissions win and these overrides are ignored. Requires scope `links.read`.",
1218
+ inputSchema: {
1219
+ link_id: z.string().min(1)
1220
+ }
1221
+ };
1222
+ var setLinkPermissionsContract = {
1223
+ name: "set_link_permissions",
1224
+ title: "Set link permissions",
1225
+ description: `Replace a dataroom link's per-item file permissions. FULL-REPLACE semantics: the payload is the complete desired state \u2014 items not listed lose their override, and an empty array clears everything (hiding every item on this link). Ancestor folders of visible items stay visible automatically.
1226
+
1227
+ Item ids come from \`list_dataroom_documents\` / \`list_dataroom_folders\`. Has no effect on links with \`audience_type: "group"\` \u2014 their group's permissions take precedence. Requires scope \`links.write\`.`,
1228
+ inputSchema: {
1229
+ link_id: z.string().min(1),
1230
+ permissions: z.array(permissionEntryInputSchema).max(1e3).describe(
1231
+ "Complete desired permission state. Empty array clears all overrides."
1232
+ )
1233
+ }
1234
+ };
972
1235
  var getVisitorContract = {
973
1236
  name: "get_visitor",
974
1237
  title: "Get a visitor",
@@ -1021,6 +1284,18 @@ var SHARED_TOOL_OUTPUT_SCHEMAS = {
1021
1284
  [updateDataroomFolderContract.name]: folderOutputSchema,
1022
1285
  [deleteDataroomFolderContract.name]: deletedObjectOutputSchema,
1023
1286
  [moveDataroomFolderContract.name]: folderOutputSchema,
1287
+ [listDataroomGroupsContract.name]: dataroomGroupsListOutputSchema,
1288
+ [getDataroomGroupContract.name]: dataroomGroupObjectOutputSchema,
1289
+ [createDataroomGroupContract.name]: dataroomGroupOutputSchema,
1290
+ [updateDataroomGroupContract.name]: dataroomGroupOutputSchema,
1291
+ [deleteDataroomGroupContract.name]: deletedObjectOutputSchema,
1292
+ [listDataroomGroupMembersContract.name]: dataroomGroupMembersListOutputSchema,
1293
+ [addDataroomGroupMembersContract.name]: dataroomGroupMembersListOutputSchema,
1294
+ [removeDataroomGroupMemberContract.name]: deletedObjectOutputSchema,
1295
+ [getDataroomGroupPermissionsContract.name]: dataroomGroupPermissionsListOutputSchema,
1296
+ [setDataroomGroupPermissionsContract.name]: dataroomGroupPermissionsSetOutputSchema,
1297
+ [getLinkPermissionsContract.name]: linkPermissionsListOutputSchema,
1298
+ [setLinkPermissionsContract.name]: linkPermissionsListOutputSchema,
1024
1299
  [getVisitorContract.name]: visitorObjectOutputSchema
1025
1300
  };
1026
1301
 
@@ -1055,6 +1330,17 @@ export {
1055
1330
  visitorViewsListOutputSchema,
1056
1331
  foldersListOutputSchema,
1057
1332
  versionsListOutputSchema,
1333
+ dataroomGroupObjectOutputSchema,
1334
+ dataroomGroupMemberObjectOutputSchema,
1335
+ dataroomGroupPermissionObjectOutputSchema,
1336
+ linkPermissionObjectOutputSchema,
1337
+ permissionEntryInputSchema,
1338
+ dataroomGroupOutputSchema,
1339
+ dataroomGroupsListOutputSchema,
1340
+ dataroomGroupMembersListOutputSchema,
1341
+ dataroomGroupPermissionsListOutputSchema,
1342
+ dataroomGroupPermissionsSetOutputSchema,
1343
+ linkPermissionsListOutputSchema,
1058
1344
  deletedObjectOutputSchema,
1059
1345
  listDocumentsContract,
1060
1346
  getDocumentContract,
@@ -1099,7 +1385,19 @@ export {
1099
1385
  updateDataroomFolderContract,
1100
1386
  deleteDataroomFolderContract,
1101
1387
  moveDataroomFolderContract,
1388
+ listDataroomGroupsContract,
1389
+ getDataroomGroupContract,
1390
+ createDataroomGroupContract,
1391
+ updateDataroomGroupContract,
1392
+ deleteDataroomGroupContract,
1393
+ listDataroomGroupMembersContract,
1394
+ addDataroomGroupMembersContract,
1395
+ removeDataroomGroupMemberContract,
1396
+ getDataroomGroupPermissionsContract,
1397
+ setDataroomGroupPermissionsContract,
1398
+ getLinkPermissionsContract,
1399
+ setLinkPermissionsContract,
1102
1400
  getVisitorContract,
1103
1401
  SHARED_TOOL_OUTPUT_SCHEMAS
1104
1402
  };
1105
- //# sourceMappingURL=chunk-DA26JZA2.js.map
1403
+ //# sourceMappingURL=chunk-IKMPOGEB.js.map