@papermark/mcp-server 0.0.1 → 0.2.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.
- package/README.md +63 -4
- package/dist/chunk-S3ALJ4YG.js +606 -0
- package/dist/chunk-S3ALJ4YG.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1072 -0
- package/dist/index.js.map +1 -0
- package/dist/tools-contract.d.ts +617 -0
- package/dist/tools-contract.js +90 -0
- package/dist/tools-contract.js.map +1 -0
- package/package.json +50 -8
package/README.md
CHANGED
|
@@ -1,11 +1,70 @@
|
|
|
1
1
|
# @papermark/mcp-server
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Model Context Protocol server for [Papermark](https://www.papermark.com). Exposes
|
|
4
|
+
your data rooms — plus documents, share links, visitors, and analytics — as
|
|
5
|
+
tools any MCP-compliant client can call (Claude Desktop, Claude Code, ChatGPT,
|
|
6
|
+
Cursor, Zed, Continue, Windsurf, …).
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
## Quick start — stdio mode (local)
|
|
6
9
|
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
1. Create an API token at `papermark.com/settings/tokens` (or via
|
|
11
|
+
`papermark login` in the CLI, which stores one to `~/Library/Preferences/papermark-nodejs/config.json` on macOS).
|
|
12
|
+
2. Add this to your MCP client config. For Claude Desktop,
|
|
13
|
+
`~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"mcpServers": {
|
|
18
|
+
"papermark": {
|
|
19
|
+
"command": "npx",
|
|
20
|
+
"args": ["-y", "@papermark/mcp-server"],
|
|
21
|
+
"env": { "PAPERMARK_TOKEN": "pm_live_xxx" }
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
3. Restart the MCP client. Ask it something like *"List my Papermark data
|
|
28
|
+
rooms"* — it'll call `list_datarooms` and stream the result back.
|
|
29
|
+
|
|
30
|
+
To run locally against a dev API instead of production:
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{ "env": {
|
|
34
|
+
"PAPERMARK_TOKEN": "pm_live_xxx",
|
|
35
|
+
"PAPERMARK_API_URL": "http://localhost:3000/api"
|
|
36
|
+
} }
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Smoke test
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
PAPERMARK_TOKEN=pm_live_xxx npm run smoke
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Walks the stdio server through `initialize`, `tools/list`, a `tools/call`
|
|
46
|
+
success, and an error path — useful for verifying a local build before
|
|
47
|
+
pointing a client at it.
|
|
48
|
+
|
|
49
|
+
## Tools
|
|
50
|
+
|
|
51
|
+
- `list_documents`, `get_document`, `search_documents`, `upload_document`
|
|
52
|
+
- `list_links`, `create_link`, `list_link_views`
|
|
53
|
+
- `list_datarooms`, `search_datarooms`, `get_dataroom`, `create_dataroom`,
|
|
54
|
+
`list_dataroom_documents`
|
|
55
|
+
- `list_visitors`, `list_visitor_views`
|
|
56
|
+
- `get_document_analytics`, `get_link_analytics`, `get_dataroom_analytics`,
|
|
57
|
+
`get_view_analytics`
|
|
58
|
+
|
|
59
|
+
## Environment
|
|
60
|
+
|
|
61
|
+
- `PAPERMARK_TOKEN` — bearer token (required for stdio mode)
|
|
62
|
+
- `PAPERMARK_API_URL` — override the API base (default `https://api.papermark.com`)
|
|
63
|
+
|
|
64
|
+
## Remote deployment
|
|
65
|
+
|
|
66
|
+
A hosted version is available at `mcp.papermark.com` using Streamable HTTP
|
|
67
|
+
transport and OAuth 2.1.
|
|
9
68
|
|
|
10
69
|
## License
|
|
11
70
|
|
|
@@ -0,0 +1,606 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/tools-contract.ts
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
var listDocumentsContract = {
|
|
6
|
+
name: "list_documents",
|
|
7
|
+
title: "List documents",
|
|
8
|
+
description: "List documents in the authenticated Papermark team. Returns up to `limit` results (default 25, max 100) and a `next_cursor` for pagination. Use this before any tool that takes a `document_id` \u2014 never fabricate ids. Requires scope `documents.read`.",
|
|
9
|
+
inputSchema: {
|
|
10
|
+
limit: z.number().int().min(1).max(100).optional().describe("Page size (1-100, default 25)"),
|
|
11
|
+
cursor: z.string().optional().describe("Opaque cursor from the previous page's `next_cursor`"),
|
|
12
|
+
query: z.string().optional().describe(
|
|
13
|
+
"Optional substring filter on document name \u2014 for richer search use `search_documents`"
|
|
14
|
+
)
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var getDocumentContract = {
|
|
18
|
+
name: "get_document",
|
|
19
|
+
title: "Get document",
|
|
20
|
+
description: "Fetch a single document by id. `document_id` must come from `list_documents` or `search_documents` \u2014 never invent one. If the user referred to a document by name, call `search_documents` first. Requires scope `documents.read`.",
|
|
21
|
+
inputSchema: {
|
|
22
|
+
document_id: z.string().min(1).describe("Document id (e.g. `doc_abc123`)")
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
var searchDocumentsContract = {
|
|
26
|
+
name: "search_documents",
|
|
27
|
+
title: "Search documents",
|
|
28
|
+
description: "Substring-search document names in the authenticated team. Use this when the user refers to a document by name or topic rather than id. Requires scope `documents.read`.",
|
|
29
|
+
inputSchema: {
|
|
30
|
+
query: z.string().min(1).describe("Search string (matched against document name)"),
|
|
31
|
+
limit: z.number().int().min(1).max(50).optional().describe("Max results (default 10)")
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
var createLinkContract = {
|
|
35
|
+
name: "create_link",
|
|
36
|
+
title: "Create share link",
|
|
37
|
+
description: `Create a share link for a document (or dataroom). The returned \`url\` is what users share.
|
|
38
|
+
|
|
39
|
+
WORKFLOW:
|
|
40
|
+
(1) Resolve the target: the user may say "the Q3 deck" or "the Acme dataroom" \u2014 call \`search_documents\` (for a document) or \`search_datarooms\` (for a dataroom) first to get a real id. Set exactly one of \`document_id\` or \`dataroom_id\` on the created link.
|
|
41
|
+
(2) Clarify ANY of these that the user didn't state explicitly \u2014 do NOT invent values:
|
|
42
|
+
\u2022 expiry (\`expires_at\`, ISO 8601) \u2014 confirm with the user, default is no expiry
|
|
43
|
+
\u2022 password \u2014 if the user wants password protection, either ASK them for a password OR generate a random one AND tell the user the exact value you set
|
|
44
|
+
\u2022 email gating (\`email_protected\`) \u2014 ask if unclear
|
|
45
|
+
\u2022 downloads (\`allow_download\`) \u2014 default off for external sharing
|
|
46
|
+
(3) Create the link, then surface both the URL and the security settings so the user can verify.
|
|
47
|
+
|
|
48
|
+
Never share a link to a document the user didn't explicitly name. Requires scope \`links.write\`.`,
|
|
49
|
+
inputSchema: {
|
|
50
|
+
document_id: z.string().optional().describe("Document id \u2014 required unless `dataroom_id` is set"),
|
|
51
|
+
dataroom_id: z.string().optional().describe("Dataroom id \u2014 alternative to document_id"),
|
|
52
|
+
name: z.string().optional().describe("Human-readable label for the link"),
|
|
53
|
+
expires_at: z.string().datetime().optional().describe("ISO 8601 timestamp after which the link stops working"),
|
|
54
|
+
password: z.string().optional().describe("Require viewers to enter this password"),
|
|
55
|
+
email_protected: z.boolean().optional().describe("Require viewers enter an email address before viewing"),
|
|
56
|
+
allow_download: z.boolean().optional().describe("Let viewers download the underlying file")
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
var listLinksContract = {
|
|
60
|
+
name: "list_links",
|
|
61
|
+
title: "List share links",
|
|
62
|
+
description: "List share links in the authenticated team. Optionally filter by `document_id` or `dataroom_id`. Requires scope `links.read`.",
|
|
63
|
+
inputSchema: {
|
|
64
|
+
document_id: z.string().optional().describe("Filter links for a specific document"),
|
|
65
|
+
dataroom_id: z.string().optional().describe("Filter links for a specific dataroom"),
|
|
66
|
+
limit: z.number().int().min(1).max(100).optional().describe("Page size"),
|
|
67
|
+
cursor: z.string().optional().describe("Pagination cursor")
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
var listLinkViewsContract = {
|
|
71
|
+
name: "list_link_views",
|
|
72
|
+
title: "List a link's view events",
|
|
73
|
+
description: "Return the raw view events for a share link, newest first. Each view includes viewer email (if captured), view timestamp, and download status. For aggregate metrics (total views, total read time), use `get_link_analytics` instead. Requires scope `analytics.read`.",
|
|
74
|
+
inputSchema: {
|
|
75
|
+
link_id: z.string().min(1).describe("Link id (e.g. `lnk_abc123`)"),
|
|
76
|
+
limit: z.number().int().min(1).max(100).optional().describe("Page size (default 25)"),
|
|
77
|
+
cursor: z.string().optional().describe("Pagination cursor")
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
var listDataroomsContract = {
|
|
81
|
+
name: "list_datarooms",
|
|
82
|
+
title: "List datarooms",
|
|
83
|
+
description: "List datarooms in the authenticated team. Returns up to `limit` results with a cursor. Requires scope `datarooms.read`.",
|
|
84
|
+
inputSchema: {
|
|
85
|
+
limit: z.number().int().min(1).max(100).optional(),
|
|
86
|
+
cursor: z.string().optional(),
|
|
87
|
+
query: z.string().optional().describe("Optional substring filter on dataroom name")
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
var searchDataroomsContract = {
|
|
91
|
+
name: "search_datarooms",
|
|
92
|
+
title: "Search datarooms",
|
|
93
|
+
description: "Substring-search dataroom names in the authenticated team. Use when the user refers to a dataroom by name (e.g. 'the Acme room') rather than id \u2014 before calling `create_link`, `get_dataroom_analytics`, or any other tool that takes a `dataroom_id`. Requires scope `datarooms.read`.",
|
|
94
|
+
inputSchema: {
|
|
95
|
+
query: z.string().min(1).describe("Search string (matched against dataroom name)"),
|
|
96
|
+
limit: z.number().int().min(1).max(50).optional().describe("Max results (default 10)")
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
var getDataroomContract = {
|
|
100
|
+
name: "get_dataroom",
|
|
101
|
+
title: "Get a dataroom",
|
|
102
|
+
description: "Fetch a single dataroom by its id (accepts either the internal cuid or the `dr_...` public id). Requires scope `datarooms.read`.",
|
|
103
|
+
inputSchema: {
|
|
104
|
+
dataroom_id: z.string().min(1).describe("Dataroom id or `dr_...` public id")
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
var createDataroomContract = {
|
|
108
|
+
name: "create_dataroom",
|
|
109
|
+
title: "Create a dataroom",
|
|
110
|
+
description: `Create a new (empty) dataroom. Documents can be added using the \`attach_dataroom_document\` tool after creating the dataroom.
|
|
111
|
+
|
|
112
|
+
WORKFLOW:
|
|
113
|
+
(1) Confirm with the user: exact dataroom name, optional internal_name, optional description. Do NOT invent these.
|
|
114
|
+
(2) Check \`list_datarooms\` first if the user said "my Acme room" \u2014 they may already have one and not want a duplicate.
|
|
115
|
+
(3) Create the dataroom; return the new dataroom id so the caller can add documents with \`attach_dataroom_document\`.
|
|
116
|
+
|
|
117
|
+
Requires scope \`datarooms.write\`.`,
|
|
118
|
+
inputSchema: {
|
|
119
|
+
name: z.string().min(1).describe("Human-visible dataroom name"),
|
|
120
|
+
internal_name: z.string().optional().describe("Private alias visible only to the team"),
|
|
121
|
+
description: z.string().optional()
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
var listDataroomDocumentsContract = {
|
|
125
|
+
name: "list_dataroom_documents",
|
|
126
|
+
title: "List documents in a dataroom",
|
|
127
|
+
description: "Return the documents contained in a dataroom, ordered by folder and custom order. Requires scope `datarooms.read`.",
|
|
128
|
+
inputSchema: {
|
|
129
|
+
dataroom_id: z.string().min(1),
|
|
130
|
+
folder_id: z.string().optional().describe("Filter to documents inside a specific folder"),
|
|
131
|
+
limit: z.number().int().min(1).max(100).optional(),
|
|
132
|
+
cursor: z.string().optional()
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
var listVisitorsContract = {
|
|
136
|
+
name: "list_visitors",
|
|
137
|
+
title: "List visitors",
|
|
138
|
+
description: "Persistent visitors (Viewer rows) for the team. Use `email` to find a specific person; use `dataroom_id` to scope to visitors of a particular dataroom. For anonymous views that never tied to a Viewer row, use `list_link_views` against the relevant link. Requires scope `visitors.read`.",
|
|
139
|
+
inputSchema: {
|
|
140
|
+
email: z.string().optional().describe("Exact email match, case-insensitive"),
|
|
141
|
+
dataroom_id: z.string().optional(),
|
|
142
|
+
limit: z.number().int().min(1).max(100).optional(),
|
|
143
|
+
cursor: z.string().optional()
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
var listVisitorViewsContract = {
|
|
147
|
+
name: "list_visitor_views",
|
|
148
|
+
title: "List a visitor's views",
|
|
149
|
+
description: "All view events tied to a single visitor, newest first. Useful for answering questions like 'what has jane@acme.com looked at?'. Use `list_visitors` with an email filter to find the visitor id. Requires scope `visitors.read`.",
|
|
150
|
+
inputSchema: {
|
|
151
|
+
visitor_id: z.string().min(1),
|
|
152
|
+
limit: z.number().int().min(1).max(100).optional(),
|
|
153
|
+
cursor: z.string().optional()
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
var getDocumentAnalyticsContract = {
|
|
157
|
+
name: "get_document_analytics",
|
|
158
|
+
title: "Get document analytics",
|
|
159
|
+
description: "Aggregate analytics for a document over a time window: total views, unique viewers, total read time (seconds), and per-page average duration. Defaults to the last 30 days. Requires scope `analytics.read`. NOTE: Subject to a tighter rate limit \u2014 cache results when possible.",
|
|
160
|
+
inputSchema: {
|
|
161
|
+
document_id: z.string().min(1),
|
|
162
|
+
since: z.number().int().optional().describe("Unix milliseconds \u2014 start of window (default: 30 days ago)"),
|
|
163
|
+
until: z.number().int().optional().describe("Unix milliseconds \u2014 end of window (default: now)")
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
var getLinkAnalyticsContract = {
|
|
167
|
+
name: "get_link_analytics",
|
|
168
|
+
title: "Get link analytics",
|
|
169
|
+
description: "Aggregate analytics for a single share link: total views, unique viewers, total read time over the selected window. For the raw event list (one row per view), use `list_link_views`. Requires scope `analytics.read`.",
|
|
170
|
+
inputSchema: {
|
|
171
|
+
link_id: z.string().min(1),
|
|
172
|
+
since: z.number().int().optional(),
|
|
173
|
+
until: z.number().int().optional()
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
var getDataroomAnalyticsContract = {
|
|
177
|
+
name: "get_dataroom_analytics",
|
|
178
|
+
title: "Get dataroom analytics",
|
|
179
|
+
description: "Aggregate analytics across all documents in a dataroom: total views, unique viewers, total read time. Defaults to the last 30 days. Requires scope `analytics.read`.",
|
|
180
|
+
inputSchema: {
|
|
181
|
+
dataroom_id: z.string().min(1),
|
|
182
|
+
since: z.number().int().optional(),
|
|
183
|
+
until: z.number().int().optional()
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
var getViewAnalyticsContract = {
|
|
187
|
+
name: "get_view_analytics",
|
|
188
|
+
title: "Get per-view breakdown",
|
|
189
|
+
description: "For a single view event: page-by-page time spent, total duration, and the viewer's country/city/browser/os/device. Use `list_link_views` or `list_visitor_views` to discover view ids. Requires scope `analytics.read`.",
|
|
190
|
+
inputSchema: {
|
|
191
|
+
view_id: z.string().min(1)
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
var FolderIconEnum = z.enum([
|
|
195
|
+
"folder",
|
|
196
|
+
"folder-open",
|
|
197
|
+
"briefcase",
|
|
198
|
+
"archive",
|
|
199
|
+
"box",
|
|
200
|
+
"file",
|
|
201
|
+
"book",
|
|
202
|
+
"bookmark",
|
|
203
|
+
"star",
|
|
204
|
+
"heart",
|
|
205
|
+
"lock",
|
|
206
|
+
"shield",
|
|
207
|
+
"users",
|
|
208
|
+
"settings",
|
|
209
|
+
"tag",
|
|
210
|
+
"layers",
|
|
211
|
+
"globe",
|
|
212
|
+
"home",
|
|
213
|
+
"mail",
|
|
214
|
+
"image",
|
|
215
|
+
"video",
|
|
216
|
+
"music",
|
|
217
|
+
"palette",
|
|
218
|
+
"pen-tool",
|
|
219
|
+
"lightbulb",
|
|
220
|
+
"zap",
|
|
221
|
+
"wrench",
|
|
222
|
+
"sparkles",
|
|
223
|
+
"cloud",
|
|
224
|
+
"flag",
|
|
225
|
+
"award",
|
|
226
|
+
"flame",
|
|
227
|
+
"bell",
|
|
228
|
+
"sun",
|
|
229
|
+
"hash"
|
|
230
|
+
]);
|
|
231
|
+
var FolderColorEnum = z.enum([
|
|
232
|
+
"gray",
|
|
233
|
+
"red",
|
|
234
|
+
"orange",
|
|
235
|
+
"yellow",
|
|
236
|
+
"green",
|
|
237
|
+
"blue",
|
|
238
|
+
"black"
|
|
239
|
+
]);
|
|
240
|
+
var updateDocumentContract = {
|
|
241
|
+
name: "update_document",
|
|
242
|
+
title: "Update a document",
|
|
243
|
+
description: `Rename a document or move it to a different team-library folder. Replacing the file content is a separate operation \u2014 use \`add_document_version\`.
|
|
244
|
+
|
|
245
|
+
WORKFLOW:
|
|
246
|
+
(1) Resolve the document via \`search_documents\` or \`list_documents\` \u2014 never invent ids.
|
|
247
|
+
(2) Confirm with the user what they want to change. Pass \`folder_id: null\` to move the document back to the library root. Pass a real folder id (resolved via \`list_folders\`) to relocate it.
|
|
248
|
+
|
|
249
|
+
Requires scope \`documents.write\`.`,
|
|
250
|
+
inputSchema: {
|
|
251
|
+
document_id: z.string().min(1),
|
|
252
|
+
name: z.string().min(1).max(512).optional(),
|
|
253
|
+
folder_id: z.string().nullable().optional().describe(
|
|
254
|
+
"Target folder id, or null to move to the library root. Omit to leave the folder unchanged."
|
|
255
|
+
)
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
var deleteDocumentContract = {
|
|
259
|
+
name: "delete_document",
|
|
260
|
+
title: "Delete a document",
|
|
261
|
+
description: `Permanently delete a document. This is irreversible: every share link, version, and view history attached to the document goes with it.
|
|
262
|
+
|
|
263
|
+
WORKFLOW:
|
|
264
|
+
(1) Resolve the document via \`search_documents\` \u2014 never delete based on a guessed id.
|
|
265
|
+
(2) Confirm with the user (echo the document name) before calling. Treat this like \`rm -rf\`: don't infer intent from passing references.
|
|
266
|
+
|
|
267
|
+
Requires scope \`documents.write\`.`,
|
|
268
|
+
inputSchema: {
|
|
269
|
+
document_id: z.string().min(1)
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
var listDocumentVersionsContract = {
|
|
273
|
+
name: "list_document_versions",
|
|
274
|
+
title: "List document versions",
|
|
275
|
+
description: "List every version of a document, primary first. Use this to find a version id before promoting an older one with `promote_document_version`. Requires scope `documents.read`.",
|
|
276
|
+
inputSchema: {
|
|
277
|
+
document_id: z.string().min(1)
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
var getDocumentVersionContract = {
|
|
281
|
+
name: "get_document_version",
|
|
282
|
+
title: "Get a document version",
|
|
283
|
+
description: "Fetch a single version of a document by its id. Requires scope `documents.read`.",
|
|
284
|
+
inputSchema: {
|
|
285
|
+
document_id: z.string().min(1),
|
|
286
|
+
version_id: z.string().min(1)
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
var addDocumentVersionContract = {
|
|
290
|
+
name: "add_document_version",
|
|
291
|
+
title: "Add a new document version",
|
|
292
|
+
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.
|
|
293
|
+
|
|
294
|
+
WORKFLOW:
|
|
295
|
+
(1) Resolve the target document via \`search_documents\` or \`list_documents\`.
|
|
296
|
+
(2) The user must give you a public HTTPS URL the API can fetch. Don't fabricate URLs.
|
|
297
|
+
(3) After creation, mention the version_number so the user can promote/rollback later.
|
|
298
|
+
|
|
299
|
+
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.
|
|
300
|
+
|
|
301
|
+
Requires scope \`documents.write\`.`,
|
|
302
|
+
inputSchema: {
|
|
303
|
+
document_id: z.string().min(1),
|
|
304
|
+
source_url: z.string().url().refine((s) => s.startsWith("https://"), {
|
|
305
|
+
message: "source_url must use https://"
|
|
306
|
+
}).describe("Public HTTPS URL the server should fetch as the new version")
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
var promoteDocumentVersionContract = {
|
|
310
|
+
name: "promote_document_version",
|
|
311
|
+
title: "Promote a version to primary",
|
|
312
|
+
description: `Roll back (or roll forward) by making a non-primary version the active one. The previous primary is demoted in the same transaction; share links immediately serve the new primary.
|
|
313
|
+
|
|
314
|
+
WORKFLOW:
|
|
315
|
+
(1) Call \`list_document_versions\` to find the right version id.
|
|
316
|
+
(2) Confirm with the user before promoting \u2014 this changes what every existing link serves.
|
|
317
|
+
|
|
318
|
+
Requires scope \`documents.write\`.`,
|
|
319
|
+
inputSchema: {
|
|
320
|
+
document_id: z.string().min(1),
|
|
321
|
+
version_id: z.string().min(1)
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
var listFoldersContract = {
|
|
325
|
+
name: "list_folders",
|
|
326
|
+
title: "List folders",
|
|
327
|
+
description: `List folders in the team library. Pass \`parent_id: "root"\` to list top-level folders, a folder id to list direct children, or omit \`parent_id\` to list every folder.
|
|
328
|
+
|
|
329
|
+
USE THIS when the user wants to know which folders exist, or you need a \`folder_id\` to pass to \`update_document\` / \`upload_document\` / \`create_folder\`. Requires scope \`documents.read\`.`,
|
|
330
|
+
inputSchema: {
|
|
331
|
+
parent_id: z.string().optional().describe(
|
|
332
|
+
"Restrict to direct children of this folder. Use 'root' for top-level folders. Omit for all folders."
|
|
333
|
+
),
|
|
334
|
+
limit: z.number().int().min(1).max(100).optional(),
|
|
335
|
+
cursor: z.string().optional()
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
var getFolderContract = {
|
|
339
|
+
name: "get_folder",
|
|
340
|
+
title: "Get a folder",
|
|
341
|
+
description: "Fetch a single team-library folder by id. Requires scope `documents.read`.",
|
|
342
|
+
inputSchema: {
|
|
343
|
+
folder_id: z.string().min(1)
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
var createFolderContract = {
|
|
347
|
+
name: "create_folder",
|
|
348
|
+
title: "Create a folder",
|
|
349
|
+
description: `Create a folder in the team library. Pass an existing folder id as \`parent_id\` to nest, or omit it for the root.
|
|
350
|
+
|
|
351
|
+
WORKFLOW:
|
|
352
|
+
(1) Confirm name and parent with the user. Don't invent folder names.
|
|
353
|
+
(2) If they referred to "the Pitches folder" but didn't give an id, call \`list_folders\` first.
|
|
354
|
+
|
|
355
|
+
Requires scope \`documents.write\`.`,
|
|
356
|
+
inputSchema: {
|
|
357
|
+
name: z.string().min(1).max(256),
|
|
358
|
+
parent_id: z.string().nullable().optional().describe("Parent folder id; omit or pass null for the team-library root"),
|
|
359
|
+
icon: FolderIconEnum.optional(),
|
|
360
|
+
color: FolderColorEnum.optional()
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
var updateFolderContract = {
|
|
364
|
+
name: "update_folder",
|
|
365
|
+
title: "Update a folder",
|
|
366
|
+
description: "Rename a folder, change its icon or color. Pass null to clear icon/color. Use `move_folder` to change its parent. Requires scope `documents.write`.",
|
|
367
|
+
inputSchema: {
|
|
368
|
+
folder_id: z.string().min(1),
|
|
369
|
+
name: z.string().min(1).max(256).optional(),
|
|
370
|
+
icon: FolderIconEnum.nullable().optional(),
|
|
371
|
+
color: FolderColorEnum.nullable().optional()
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
var deleteFolderContract = {
|
|
375
|
+
name: "delete_folder",
|
|
376
|
+
title: "Delete a folder",
|
|
377
|
+
description: `Delete a folder. By default this only succeeds if the folder is empty. Pass \`cascade: true\` to also delete every nested folder and document \u2014 this is destructive and irreversible.
|
|
378
|
+
|
|
379
|
+
Always confirm with the user before passing cascade. Requires scope \`documents.write\`.`,
|
|
380
|
+
inputSchema: {
|
|
381
|
+
folder_id: z.string().min(1),
|
|
382
|
+
cascade: z.boolean().optional().describe(
|
|
383
|
+
"When true, deletes the folder and every nested folder + document. Defaults to false."
|
|
384
|
+
)
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
var moveFolderContract = {
|
|
388
|
+
name: "move_folder",
|
|
389
|
+
title: "Move a folder",
|
|
390
|
+
description: "Move a folder under a different parent. Pass `parent_id: null` to move it to the library root. Requires scope `documents.write`.",
|
|
391
|
+
inputSchema: {
|
|
392
|
+
folder_id: z.string().min(1),
|
|
393
|
+
parent_id: z.string().nullable().describe("Target parent folder id, or null for the library root")
|
|
394
|
+
}
|
|
395
|
+
};
|
|
396
|
+
var getLinkContract = {
|
|
397
|
+
name: "get_link",
|
|
398
|
+
title: "Get a share link",
|
|
399
|
+
description: "Fetch a single share link by id. Use this to confirm current settings before calling `update_link` so you don't accidentally clobber other fields. Requires scope `links.read`.",
|
|
400
|
+
inputSchema: {
|
|
401
|
+
link_id: z.string().min(1)
|
|
402
|
+
}
|
|
403
|
+
};
|
|
404
|
+
var updateLinkContract = {
|
|
405
|
+
name: "update_link",
|
|
406
|
+
title: "Update a share link",
|
|
407
|
+
description: `Change the security settings of an existing share link. The URL stays the same \u2014 viewers don't need to be re-notified.
|
|
408
|
+
|
|
409
|
+
WORKFLOW:
|
|
410
|
+
(1) Get the current settings via \`get_link\` first if you're not certain. PATCH semantics: omitted fields are unchanged, but a passed value REPLACES the current one.
|
|
411
|
+
(2) Pass \`expires_at: null\` or \`password: null\` to clear those fields. \`allow_list: []\` empties the list.
|
|
412
|
+
(3) Confirm any change to password / expiry / email gating with the user.
|
|
413
|
+
|
|
414
|
+
Requires scope \`links.write\`.`,
|
|
415
|
+
inputSchema: {
|
|
416
|
+
link_id: z.string().min(1),
|
|
417
|
+
name: z.string().optional(),
|
|
418
|
+
expires_at: z.string().datetime().nullable().optional().describe("ISO 8601 timestamp, or null to clear the expiry"),
|
|
419
|
+
password: z.string().min(1).nullable().optional().describe("New password, or null to remove password protection"),
|
|
420
|
+
email_protected: z.boolean().optional(),
|
|
421
|
+
email_authenticated: z.boolean().optional(),
|
|
422
|
+
allow_download: z.boolean().optional(),
|
|
423
|
+
allow_list: z.array(z.string()).optional().describe("Email or domain allow list (e.g. ['@acme.com', 'bob@x.com'])"),
|
|
424
|
+
deny_list: z.array(z.string()).optional(),
|
|
425
|
+
enable_watermark: z.boolean().optional(),
|
|
426
|
+
enable_screenshot_protection: z.boolean().optional()
|
|
427
|
+
}
|
|
428
|
+
};
|
|
429
|
+
var deleteLinkContract = {
|
|
430
|
+
name: "delete_link",
|
|
431
|
+
title: "Revoke a share link",
|
|
432
|
+
description: `Revoke a share link (soft delete). Anyone who tries to open the URL will see a "link unavailable" page. The view history is preserved for analytics.
|
|
433
|
+
|
|
434
|
+
Confirm with the user before revoking \u2014 they may have already shared the URL. Requires scope \`links.write\`.`,
|
|
435
|
+
inputSchema: {
|
|
436
|
+
link_id: z.string().min(1)
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
var updateDataroomContract = {
|
|
440
|
+
name: "update_dataroom",
|
|
441
|
+
title: "Update a dataroom",
|
|
442
|
+
description: `Change a dataroom's name, internal alias, description, or whether viewers can bulk-download. PATCH semantics \u2014 omitted fields stay as they are.
|
|
443
|
+
|
|
444
|
+
WORKFLOW:
|
|
445
|
+
(1) Resolve the dataroom via \`search_datarooms\` or \`list_datarooms\`.
|
|
446
|
+
(2) Confirm any toggle of \`allow_bulk_download\` with the user \u2014 it affects every link tied to this dataroom.
|
|
447
|
+
|
|
448
|
+
Requires scope \`datarooms.write\`.`,
|
|
449
|
+
inputSchema: {
|
|
450
|
+
dataroom_id: z.string().min(1),
|
|
451
|
+
name: z.string().min(1).optional(),
|
|
452
|
+
internal_name: z.string().nullable().optional(),
|
|
453
|
+
description: z.string().nullable().optional(),
|
|
454
|
+
allow_bulk_download: z.boolean().optional()
|
|
455
|
+
}
|
|
456
|
+
};
|
|
457
|
+
var deleteDataroomContract = {
|
|
458
|
+
name: "delete_dataroom",
|
|
459
|
+
title: "Delete a dataroom",
|
|
460
|
+
description: `Permanently delete a dataroom. Every link and folder attached to it goes with it. Documents themselves stay in the team library \u2014 only their attachments to this dataroom are removed.
|
|
461
|
+
|
|
462
|
+
ALWAYS confirm with the user (echo the dataroom name and how many documents it contains, via \`get_dataroom\`) before calling. This is irreversible. Requires scope \`datarooms.write\`.`,
|
|
463
|
+
inputSchema: {
|
|
464
|
+
dataroom_id: z.string().min(1)
|
|
465
|
+
}
|
|
466
|
+
};
|
|
467
|
+
var attachDataroomDocumentContract = {
|
|
468
|
+
name: "attach_dataroom_document",
|
|
469
|
+
title: "Attach a document to a dataroom",
|
|
470
|
+
description: `Add an existing team-library document to a dataroom. The document stays in the library; this only creates the attachment.
|
|
471
|
+
|
|
472
|
+
WORKFLOW:
|
|
473
|
+
(1) Resolve both ids \u2014 the dataroom via \`search_datarooms\`, the document via \`search_documents\`.
|
|
474
|
+
(2) Optionally pass a dataroom \`folder_id\` (created via \`create_dataroom_folder\`) to nest the attachment under a folder.
|
|
475
|
+
|
|
476
|
+
Requires scope \`datarooms.write\`.`,
|
|
477
|
+
inputSchema: {
|
|
478
|
+
dataroom_id: z.string().min(1),
|
|
479
|
+
document_id: z.string().min(1),
|
|
480
|
+
folder_id: z.string().optional().describe(
|
|
481
|
+
"Optional dataroom-folder id to place the attachment under. Folder must belong to this dataroom."
|
|
482
|
+
)
|
|
483
|
+
}
|
|
484
|
+
};
|
|
485
|
+
var listDataroomFoldersContract = {
|
|
486
|
+
name: "list_dataroom_folders",
|
|
487
|
+
title: "List folders in a dataroom",
|
|
488
|
+
description: `List folders inside a dataroom. Pass \`parent_id: "root"\` for top-level, a folder id for direct children, or omit for every folder in the dataroom.
|
|
489
|
+
|
|
490
|
+
USE THIS when you need a dataroom \`folder_id\` for \`attach_dataroom_document\` or \`create_dataroom_folder\`. Requires scope \`datarooms.read\`.`,
|
|
491
|
+
inputSchema: {
|
|
492
|
+
dataroom_id: z.string().min(1),
|
|
493
|
+
parent_id: z.string().optional(),
|
|
494
|
+
limit: z.number().int().min(1).max(100).optional(),
|
|
495
|
+
cursor: z.string().optional()
|
|
496
|
+
}
|
|
497
|
+
};
|
|
498
|
+
var getDataroomFolderContract = {
|
|
499
|
+
name: "get_dataroom_folder",
|
|
500
|
+
title: "Get a dataroom folder",
|
|
501
|
+
description: "Fetch a single dataroom folder. Requires scope `datarooms.read`.",
|
|
502
|
+
inputSchema: {
|
|
503
|
+
dataroom_id: z.string().min(1),
|
|
504
|
+
folder_id: z.string().min(1)
|
|
505
|
+
}
|
|
506
|
+
};
|
|
507
|
+
var createDataroomFolderContract = {
|
|
508
|
+
name: "create_dataroom_folder",
|
|
509
|
+
title: "Create a folder in a dataroom",
|
|
510
|
+
description: "Create a folder inside a dataroom. Pass an existing dataroom-folder id as `parent_id` to nest, omit for the dataroom root. Folders here are scoped to a single dataroom and are separate from team-library folders. Requires scope `datarooms.write`.",
|
|
511
|
+
inputSchema: {
|
|
512
|
+
dataroom_id: z.string().min(1),
|
|
513
|
+
name: z.string().min(1).max(256),
|
|
514
|
+
parent_id: z.string().nullable().optional(),
|
|
515
|
+
icon: FolderIconEnum.optional(),
|
|
516
|
+
color: FolderColorEnum.optional()
|
|
517
|
+
}
|
|
518
|
+
};
|
|
519
|
+
var updateDataroomFolderContract = {
|
|
520
|
+
name: "update_dataroom_folder",
|
|
521
|
+
title: "Update a dataroom folder",
|
|
522
|
+
description: "Rename a dataroom folder, change its icon/color. Pass null to clear icon/color. Use `move_dataroom_folder` to change its parent. Requires scope `datarooms.write`.",
|
|
523
|
+
inputSchema: {
|
|
524
|
+
dataroom_id: z.string().min(1),
|
|
525
|
+
folder_id: z.string().min(1),
|
|
526
|
+
name: z.string().min(1).max(256).optional(),
|
|
527
|
+
icon: FolderIconEnum.nullable().optional(),
|
|
528
|
+
color: FolderColorEnum.nullable().optional()
|
|
529
|
+
}
|
|
530
|
+
};
|
|
531
|
+
var deleteDataroomFolderContract = {
|
|
532
|
+
name: "delete_dataroom_folder",
|
|
533
|
+
title: "Delete a dataroom folder",
|
|
534
|
+
description: `Delete a dataroom folder. By default this only succeeds if the folder is empty. Pass \`cascade: true\` to also delete every nested folder + dataroom-document attachment beneath it. The underlying documents in the team library are NOT deleted \u2014 only their attachments to this dataroom.
|
|
535
|
+
|
|
536
|
+
Confirm with the user before passing cascade. Requires scope \`datarooms.write\`.`,
|
|
537
|
+
inputSchema: {
|
|
538
|
+
dataroom_id: z.string().min(1),
|
|
539
|
+
folder_id: z.string().min(1),
|
|
540
|
+
cascade: z.boolean().optional()
|
|
541
|
+
}
|
|
542
|
+
};
|
|
543
|
+
var moveDataroomFolderContract = {
|
|
544
|
+
name: "move_dataroom_folder",
|
|
545
|
+
title: "Move a dataroom folder",
|
|
546
|
+
description: "Move a folder under a different parent within the same dataroom. Pass `parent_id: null` to move to the dataroom root. Requires scope `datarooms.write`.",
|
|
547
|
+
inputSchema: {
|
|
548
|
+
dataroom_id: z.string().min(1),
|
|
549
|
+
folder_id: z.string().min(1),
|
|
550
|
+
parent_id: z.string().nullable()
|
|
551
|
+
}
|
|
552
|
+
};
|
|
553
|
+
var getVisitorContract = {
|
|
554
|
+
name: "get_visitor",
|
|
555
|
+
title: "Get a visitor",
|
|
556
|
+
description: "Fetch a single visitor (Viewer row) by id, including total view count and last-seen timestamp. Use `list_visitors` with an email filter to find the id. Requires scope `visitors.read`.",
|
|
557
|
+
inputSchema: {
|
|
558
|
+
visitor_id: z.string().min(1)
|
|
559
|
+
}
|
|
560
|
+
};
|
|
561
|
+
|
|
562
|
+
export {
|
|
563
|
+
listDocumentsContract,
|
|
564
|
+
getDocumentContract,
|
|
565
|
+
searchDocumentsContract,
|
|
566
|
+
createLinkContract,
|
|
567
|
+
listLinksContract,
|
|
568
|
+
listLinkViewsContract,
|
|
569
|
+
listDataroomsContract,
|
|
570
|
+
searchDataroomsContract,
|
|
571
|
+
getDataroomContract,
|
|
572
|
+
createDataroomContract,
|
|
573
|
+
listDataroomDocumentsContract,
|
|
574
|
+
listVisitorsContract,
|
|
575
|
+
listVisitorViewsContract,
|
|
576
|
+
getDocumentAnalyticsContract,
|
|
577
|
+
getLinkAnalyticsContract,
|
|
578
|
+
getDataroomAnalyticsContract,
|
|
579
|
+
getViewAnalyticsContract,
|
|
580
|
+
updateDocumentContract,
|
|
581
|
+
deleteDocumentContract,
|
|
582
|
+
listDocumentVersionsContract,
|
|
583
|
+
getDocumentVersionContract,
|
|
584
|
+
addDocumentVersionContract,
|
|
585
|
+
promoteDocumentVersionContract,
|
|
586
|
+
listFoldersContract,
|
|
587
|
+
getFolderContract,
|
|
588
|
+
createFolderContract,
|
|
589
|
+
updateFolderContract,
|
|
590
|
+
deleteFolderContract,
|
|
591
|
+
moveFolderContract,
|
|
592
|
+
getLinkContract,
|
|
593
|
+
updateLinkContract,
|
|
594
|
+
deleteLinkContract,
|
|
595
|
+
updateDataroomContract,
|
|
596
|
+
deleteDataroomContract,
|
|
597
|
+
attachDataroomDocumentContract,
|
|
598
|
+
listDataroomFoldersContract,
|
|
599
|
+
getDataroomFolderContract,
|
|
600
|
+
createDataroomFolderContract,
|
|
601
|
+
updateDataroomFolderContract,
|
|
602
|
+
deleteDataroomFolderContract,
|
|
603
|
+
moveDataroomFolderContract,
|
|
604
|
+
getVisitorContract
|
|
605
|
+
};
|
|
606
|
+
//# sourceMappingURL=chunk-S3ALJ4YG.js.map
|