@archbee/mcp 2.5.1 → 3.0.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.
@@ -1,414 +0,0 @@
1
- import { z } from 'zod'
2
-
3
- // Input shapes for every tool in index.ts, kept out of it so that file reads as
4
- // the list of tools this server exposes.
5
-
6
- const docSpaceIdArg = {
7
- docSpaceId: z
8
- .string()
9
- .optional()
10
- .describe(
11
- 'Space to act on. Required when API_KEY is a team key (starts with `abteam_`), which can reach every space in the team. Ignored with a space API key, since that key already names its space.'
12
- ),
13
- }
14
-
15
- const ICON_DESCRIPTION =
16
- 'Icon shown in the left navigation. Either an emoji ("🚀"), or a JSON string naming an icon: {"lucideIcon":"Rocket"} (lucide-react name, PascalCase), {"faIcon":"fa-solid fa-rocket"} or {"apiMethod":"GET"}. Pass an empty string to clear it. Anything else is rejected.'
17
-
18
- const iconArg = {
19
- icon: z.string().optional().describe(ICON_DESCRIPTION),
20
- }
21
-
22
- const MDX_FORMAT_DESCRIPTION =
23
- 'Format of `content`. Use `mdx` when the content contains JSX-style Archbee components such as `<hint>`, `<CtaButton />` or `<Tabs>` — with plain markdown those degrade to raw html blocks. Directive-style components (`:::hint{type="info"}`) work in both formats. Defaults to markdown when omitted.'
24
-
25
- const formatArg = {
26
- format: z
27
- .enum(['markdown', 'mdx'])
28
- .optional()
29
- .describe(MDX_FORMAT_DESCRIPTION),
30
- }
31
-
32
- const variableTypeSchema = z.enum(['variable', 'glossary'])
33
-
34
- // Shared by create_variable and update_variable so the two cannot drift; for a
35
- // glossary term readers see the VALUE (term) and DESCRIPTION (definition).
36
- const VARIABLE_NAME_DESCRIPTION =
37
- 'Key documents reference the variable by, as {{name}}. Must be unique within its type, may contain only letters, digits, "-", "_" and ".", and is at most 40 characters. For a glossary term the name is only that key — readers never see it in the glossary.'
38
-
39
- const VARIABLE_CONTENT_DESCRIPTION =
40
- 'Value the variable resolves to, at most 100 characters. For a glossary term this is the TERM readers see (the word itself, e.g. "SLA"), at most 40 characters.'
41
-
42
- const VARIABLE_DESCRIPTION_DESCRIPTION =
43
- 'Short description shown next to the variable in the app, at most 250 characters. For a glossary term this is the DEFINITION readers see, and it is required — a glossary term without one is rejected.'
44
-
45
- const VARIABLE_TYPE_DESCRIPTION =
46
- 'Defaults to variable. Use glossary for a glossary term, which requires a description (the definition readers see).'
47
-
48
- const spaceTargetMapSchema = z.record(z.string(), z.string())
49
-
50
- export const getAllDocsSchema = { ...docSpaceIdArg }
51
-
52
- export const getDocSchema = {
53
- docId: z
54
- .string()
55
- .describe(
56
- 'ID of the document to read, as returned by search_query, search_title or get_all_docs.'
57
- ),
58
- ...docSpaceIdArg,
59
- }
60
-
61
- export const searchQuerySchema = {
62
- query: z
63
- .string()
64
- .describe('Text to look for inside the content of the documents.'),
65
- ...docSpaceIdArg,
66
- }
67
-
68
- export const searchTitleSchema = {
69
- query: z.string().describe('Text to look for in the document titles.'),
70
- ...docSpaceIdArg,
71
- }
72
-
73
- export const createDocSchema = {
74
- content: z
75
- .string()
76
- .describe(
77
- 'Body of the document to create, as Markdown or MDX text. JSON document content is not accepted. Embed a content snippet as a :::ContentSnippet{docRefId="<snippet id from list_content_snippets>"} line followed by a ::: line; get_doc returns the snippets already in a document that way, so keep those lines to keep the snippets.'
78
- ),
79
- ...formatArg,
80
- title: z.string().optional().describe('Title of the document.'),
81
- parentDocId: z
82
- .string()
83
- .optional()
84
- .describe('ID of the parent document to nest this document under.'),
85
- slug: z.string().optional().describe('URL slug for the document.'),
86
- description: z
87
- .string()
88
- .optional()
89
- .describe('Short description / summary of the document.'),
90
- previewImgURL: z
91
- .string()
92
- .optional()
93
- .describe('URL of the preview / social image for the document.'),
94
- hidden: z
95
- .boolean()
96
- .optional()
97
- .describe('When true, the document is hidden from navigation.'),
98
- ...iconArg,
99
- ...docSpaceIdArg,
100
- }
101
-
102
- export const updateDocSchema = {
103
- docId: z.string().describe('ID of the document to update.'),
104
- content: z
105
- .string()
106
- .optional()
107
- .describe(
108
- 'New body for the document, as Markdown or MDX text. JSON document content is not accepted. Embed a content snippet as a :::ContentSnippet{docRefId="<snippet id from list_content_snippets>"} line followed by a ::: line; get_doc returns the snippets already in a document that way, so keep those lines to keep the snippets.'
109
- ),
110
- ...formatArg,
111
- title: z.string().optional().describe('New title of the document.'),
112
- parentDocId: z
113
- .string()
114
- .optional()
115
- .describe('ID of the parent document to move this document under.'),
116
- slug: z.string().optional().describe('New URL slug for the document.'),
117
- description: z
118
- .string()
119
- .optional()
120
- .describe('New short description / summary of the document.'),
121
- previewImgURL: z
122
- .string()
123
- .optional()
124
- .describe('New preview / social image URL for the document.'),
125
- hidden: z
126
- .boolean()
127
- .optional()
128
- .describe('When true, the document is hidden from navigation.'),
129
- ...iconArg,
130
- ...docSpaceIdArg,
131
- }
132
-
133
- export const deleteDocSchema = {
134
- docId: z.string().describe('ID of the document to delete.'),
135
- recursive: z
136
- .boolean()
137
- .optional()
138
- .describe(
139
- 'Required (set to true) to delete a document that has nested child documents, which deletes those children too. When the document has children and this is not set, the call is rejected and the response lists the child documents that would be affected.'
140
- ),
141
- ...docSpaceIdArg,
142
- }
143
-
144
- export const createDocSpaceSchema = {
145
- name: z.string().describe('Name of the new doc space.'),
146
- isReviewSystemEnabled: z
147
- .boolean()
148
- .optional()
149
- .describe(
150
- 'Enable the review/approval workflow for the space. At most one of isReviewSystemEnabled and isBranchingSystemEnabled; either needs the Scaling plan or higher.'
151
- ),
152
- isBranchingSystemEnabled: z
153
- .boolean()
154
- .optional()
155
- .describe(
156
- 'Enable the branching (git-style) workflow for the space. At most one of isReviewSystemEnabled and isBranchingSystemEnabled; either needs the Scaling plan or higher.'
157
- ),
158
- docSpaceGroupId: z
159
- .string()
160
- .optional()
161
- .describe('ID of the collection/group to place the new space in.'),
162
- ...iconArg,
163
- }
164
-
165
- // Mirrors PublicAPIUpdateDocSpaceRequestSchema in @archbee/data-access, which
166
- // this standalone package cannot import. The API re-validates with the real
167
- // schema, so this only has to describe the shape well enough for the model;
168
- // publicAccessControlPart passes unknown keys through so newer access-control
169
- // fields keep working without a release here.
170
- const emailListSchema = z.array(z.object({ email: z.string() }))
171
-
172
- const publicAccessControlPartSchema = z
173
- .object({
174
- publicProtectionTypes: z
175
- .array(
176
- z.enum([
177
- 'None',
178
- 'Password',
179
- 'Guest accounts',
180
- 'Private Accounts',
181
- 'Private Link',
182
- 'Magic Link',
183
- 'JWT',
184
- 'SAML',
185
- 'OIDC',
186
- ])
187
- )
188
- .optional(),
189
- publicPassword: z.string().optional(),
190
- publicGuestAccounts: z
191
- .array(z.object({ email: z.string(), password: z.string() }))
192
- .optional(),
193
- publicMagicLinkAccounts: emailListSchema.optional(),
194
- publicPrivateAccounts: emailListSchema.optional(),
195
- jwtValidationType: z.string().optional(),
196
- jwtKeyUrl: z.string().optional(),
197
- jwtSecret: z.string().optional(),
198
- jwtRedirectURL: z.string().optional(),
199
- samlMetadata: z.string().optional(),
200
- samlEntityId: z.string().optional(),
201
- conditionalRuleId: z.string().optional(),
202
- })
203
- .passthrough()
204
-
205
- export const updateDocSpaceSchema = {
206
- name: z
207
- .string()
208
- .optional()
209
- .describe('New display name for the space (renames it).'),
210
- hostnamePart: z
211
- .object({ hostname: z.string(), hostnamePath: z.string() })
212
- .optional()
213
- .describe('Custom hostname configuration for the space.'),
214
- spaceLinks: z
215
- .array(z.object({ label: z.string(), docSpaceId: z.string() }))
216
- .optional()
217
- .describe(
218
- 'Links to other spaces. The list should start with the current space.'
219
- ),
220
- publicAccessControlPart: publicAccessControlPartSchema
221
- .optional()
222
- .describe('Public access control and authentication configuration.'),
223
- editMode: z
224
- .enum(['free_edits', 'drafts_reviews', 'branches_reviews'])
225
- .optional()
226
- .describe(
227
- 'Edit mode of the space, as in its settings: free_edits, drafts_reviews or branches_reviews. Needs a team admin, and Drafts & Reviews or Branches & Reviews need the Scaling plan or higher. Leaving drafts_reviews permanently deletes every draft of the space, and leaving branches_reviews permanently deletes every branch. Before such a switch, warn the user, ask them to merge in Archbee whatever they want to keep, and send confirmDeletion: true only once they agree.'
228
- ),
229
- confirmDeletion: z
230
- .boolean()
231
- .optional()
232
- .describe(
233
- 'Set to true, after the user agreed, to let an editMode switch delete the drafts or branches of the space. Without it a switch that would delete any is refused and nothing changes.'
234
- ),
235
- ...iconArg,
236
- ...docSpaceIdArg,
237
- }
238
-
239
- export const deleteDocSpaceSchema = { ...docSpaceIdArg }
240
-
241
- export const createSpaceGroupSchema = {
242
- name: z.string().describe('Name of the new space group.'),
243
- isAiEnabled: z
244
- .boolean()
245
- .optional()
246
- .describe('Enable AI features for the space group.'),
247
- isReviewSystemEnabled: z
248
- .boolean()
249
- .optional()
250
- .describe('Enable the review/approval workflow for the space group.'),
251
- isBranchingSystemEnabled: z
252
- .boolean()
253
- .optional()
254
- .describe('Enable the branching (git-style) workflow for the space group.'),
255
- }
256
-
257
- export const deleteSpaceGroupSchema = {
258
- docSpaceGroupId: z.string().describe('ID of the space group to delete.'),
259
- }
260
-
261
- export const listSpaceGroupsSchema = {
262
- query: z
263
- .string()
264
- .optional()
265
- .describe(
266
- 'Optional case-insensitive filter on space group and space names. Omit to list everything.'
267
- ),
268
- }
269
-
270
- export const createCategorySchema = {
271
- categoryName: z.string().describe('Name of the category to create.'),
272
- parentDocId: z
273
- .string()
274
- .optional()
275
- .describe(
276
- 'ID of the document or category to nest this category under. Omit to create it at the top level of the space.'
277
- ),
278
- ...docSpaceIdArg,
279
- }
280
-
281
- export const deleteCategorySchema = {
282
- categoryId: z.string().describe('ID of the category to delete.'),
283
- ...docSpaceIdArg,
284
- }
285
-
286
- // Reusable resources belong to the organization, so none of these take a
287
- // docSpaceId — except apply_template, which writes its document into one.
288
-
289
- export const listTemplatesSchema = {}
290
-
291
- export const createTemplateSchema = {
292
- name: z
293
- .string()
294
- .describe(
295
- "Name of the template. When a template with this name already exists (compared case-insensitively), no second copy is created — the existing template's id is returned with alreadyExists: true and its content is KEPT (the content passed here is discarded); to publish a different body, use a new name."
296
- ),
297
- content: z
298
- .string()
299
- .optional()
300
- .describe(
301
- 'Body of the template, as Markdown or MDX text. Omit for an empty template.'
302
- ),
303
- ...formatArg,
304
- ...iconArg,
305
- }
306
-
307
- export const deleteTemplateSchema = {
308
- templateId: z
309
- .string()
310
- .describe('ID of the template to delete, as returned by list_templates.'),
311
- }
312
-
313
- export const applyTemplateSchema = {
314
- templateId: z
315
- .string()
316
- .describe('ID of the template to apply, as returned by list_templates.'),
317
- title: z
318
- .string()
319
- .optional()
320
- .describe(
321
- 'Title of the new document. Defaults to the name of the template.'
322
- ),
323
- parentDocId: z
324
- .string()
325
- .optional()
326
- .describe('ID of the document or category to nest the new document under.'),
327
- slug: z.string().optional().describe('URL slug for the new document.'),
328
- ...iconArg,
329
- ...docSpaceIdArg,
330
- }
331
-
332
- export const listContentSnippetsSchema = {}
333
-
334
- export const createContentSnippetSchema = {
335
- name: z
336
- .string()
337
- .describe(
338
- "Name of the content snippet. When a snippet with this name already exists (compared case-insensitively), no second copy is created — the existing snippet's id is returned with alreadyExists: true and its content is KEPT (the content passed here is discarded); use update_content_snippet to change its body."
339
- ),
340
- content: z
341
- .string()
342
- .optional()
343
- .describe(
344
- 'Body of the snippet, as Markdown or MDX text. Omit for an empty snippet.'
345
- ),
346
- ...formatArg,
347
- }
348
-
349
- export const updateContentSnippetSchema = {
350
- snippetId: z
351
- .string()
352
- .describe(
353
- 'ID of the snippet to update, as returned by list_content_snippets.'
354
- ),
355
- name: z.string().optional().describe('New name for the snippet.'),
356
- content: z
357
- .string()
358
- .optional()
359
- .describe('New body for the snippet, as Markdown or MDX text.'),
360
- ...formatArg,
361
- }
362
-
363
- export const deleteContentSnippetSchema = {
364
- snippetId: z
365
- .string()
366
- .describe(
367
- 'ID of the snippet to delete, as returned by list_content_snippets.'
368
- ),
369
- }
370
-
371
- export const listVariablesSchema = {
372
- variableType: variableTypeSchema
373
- .optional()
374
- .describe('Return only variables, or only glossary terms. Omit for both.'),
375
- }
376
-
377
- export const createVariableSchema = {
378
- name: z.string().describe(VARIABLE_NAME_DESCRIPTION),
379
- variableContent: z.string().describe(VARIABLE_CONTENT_DESCRIPTION),
380
- description: z.string().optional().describe(VARIABLE_DESCRIPTION_DESCRIPTION),
381
- variableType: variableTypeSchema
382
- .optional()
383
- .describe(VARIABLE_TYPE_DESCRIPTION),
384
- spaceTargetMap: spaceTargetMapSchema
385
- .optional()
386
- .describe(
387
- 'Overrides of the value, keyed by space id (per-space value) or by language code (translated value).'
388
- ),
389
- }
390
-
391
- export const updateVariableSchema = {
392
- variableId: z
393
- .string()
394
- .describe('ID of the variable to update, as returned by list_variables.'),
395
- name: z.string().optional().describe(VARIABLE_NAME_DESCRIPTION),
396
- variableContent: z.string().optional().describe(VARIABLE_CONTENT_DESCRIPTION),
397
- description: z.string().optional().describe(VARIABLE_DESCRIPTION_DESCRIPTION),
398
- variableType: variableTypeSchema
399
- .optional()
400
- .describe(
401
- `Change whether this is a variable or a glossary term. ${VARIABLE_TYPE_DESCRIPTION}`
402
- ),
403
- spaceTargetMap: spaceTargetMapSchema
404
- .optional()
405
- .describe(
406
- 'Replaces the per-space / per-language overrides with this map in full.'
407
- ),
408
- }
409
-
410
- export const deleteVariableSchema = {
411
- variableId: z
412
- .string()
413
- .describe('ID of the variable to delete, as returned by list_variables.'),
414
- }