@archbee/mcp 2.1.0 → 2.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 +70 -4
- package/dist/index.js +29 -221
- package/dist/index.js.map +1 -1
- package/dist/tool-schemas.js +306 -0
- package/dist/tool-schemas.js.map +1 -0
- package/package.json +1 -1
- package/src/index.ts +133 -249
- package/src/tool-schemas.ts +372 -0
|
@@ -0,0 +1,372 @@
|
|
|
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
|
+
const spaceTargetMapSchema = z.record(z.string(), z.string())
|
|
35
|
+
|
|
36
|
+
export const getAllDocsSchema = { ...docSpaceIdArg }
|
|
37
|
+
|
|
38
|
+
export const getDocSchema = {
|
|
39
|
+
docId: z
|
|
40
|
+
.string()
|
|
41
|
+
.describe(
|
|
42
|
+
'ID of the document to read, as returned by search_query, search_title or get_all_docs.'
|
|
43
|
+
),
|
|
44
|
+
...docSpaceIdArg,
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const searchQuerySchema = {
|
|
48
|
+
query: z
|
|
49
|
+
.string()
|
|
50
|
+
.describe('Text to look for inside the content of the documents.'),
|
|
51
|
+
...docSpaceIdArg,
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export const searchTitleSchema = {
|
|
55
|
+
query: z.string().describe('Text to look for in the document titles.'),
|
|
56
|
+
...docSpaceIdArg,
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export const createDocSchema = {
|
|
60
|
+
content: z
|
|
61
|
+
.string()
|
|
62
|
+
.describe(
|
|
63
|
+
'Body of the document to create, as Markdown or MDX text. JSON document content is not accepted.'
|
|
64
|
+
),
|
|
65
|
+
...formatArg,
|
|
66
|
+
title: z.string().optional().describe('Title of the document.'),
|
|
67
|
+
parentDocId: z
|
|
68
|
+
.string()
|
|
69
|
+
.optional()
|
|
70
|
+
.describe('ID of the parent document to nest this document under.'),
|
|
71
|
+
slug: z.string().optional().describe('URL slug for the document.'),
|
|
72
|
+
description: z
|
|
73
|
+
.string()
|
|
74
|
+
.optional()
|
|
75
|
+
.describe('Short description / summary of the document.'),
|
|
76
|
+
previewImgURL: z
|
|
77
|
+
.string()
|
|
78
|
+
.optional()
|
|
79
|
+
.describe('URL of the preview / social image for the document.'),
|
|
80
|
+
hidden: z
|
|
81
|
+
.boolean()
|
|
82
|
+
.optional()
|
|
83
|
+
.describe('When true, the document is hidden from navigation.'),
|
|
84
|
+
...iconArg,
|
|
85
|
+
...docSpaceIdArg,
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export const updateDocSchema = {
|
|
89
|
+
docId: z.string().describe('ID of the document to update.'),
|
|
90
|
+
content: z
|
|
91
|
+
.string()
|
|
92
|
+
.optional()
|
|
93
|
+
.describe(
|
|
94
|
+
'New body for the document, as Markdown or MDX text. JSON document content is not accepted.'
|
|
95
|
+
),
|
|
96
|
+
...formatArg,
|
|
97
|
+
title: z.string().optional().describe('New title of the document.'),
|
|
98
|
+
parentDocId: z
|
|
99
|
+
.string()
|
|
100
|
+
.optional()
|
|
101
|
+
.describe('ID of the parent document to move this document under.'),
|
|
102
|
+
slug: z.string().optional().describe('New URL slug for the document.'),
|
|
103
|
+
description: z
|
|
104
|
+
.string()
|
|
105
|
+
.optional()
|
|
106
|
+
.describe('New short description / summary of the document.'),
|
|
107
|
+
previewImgURL: z
|
|
108
|
+
.string()
|
|
109
|
+
.optional()
|
|
110
|
+
.describe('New preview / social image URL for the document.'),
|
|
111
|
+
hidden: z
|
|
112
|
+
.boolean()
|
|
113
|
+
.optional()
|
|
114
|
+
.describe('When true, the document is hidden from navigation.'),
|
|
115
|
+
...iconArg,
|
|
116
|
+
...docSpaceIdArg,
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export const deleteDocSchema = {
|
|
120
|
+
docId: z.string().describe('ID of the document to delete.'),
|
|
121
|
+
recursive: z
|
|
122
|
+
.boolean()
|
|
123
|
+
.optional()
|
|
124
|
+
.describe(
|
|
125
|
+
'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.'
|
|
126
|
+
),
|
|
127
|
+
...docSpaceIdArg,
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export const createDocSpaceSchema = {
|
|
131
|
+
name: z.string().describe('Name of the new doc space.'),
|
|
132
|
+
isReviewSystemEnabled: z
|
|
133
|
+
.boolean()
|
|
134
|
+
.optional()
|
|
135
|
+
.describe('Enable the review/approval workflow for the space.'),
|
|
136
|
+
isBranchingSystemEnabled: z
|
|
137
|
+
.boolean()
|
|
138
|
+
.optional()
|
|
139
|
+
.describe('Enable the branching (git-style) workflow for the space.'),
|
|
140
|
+
docSpaceGroupId: z
|
|
141
|
+
.string()
|
|
142
|
+
.optional()
|
|
143
|
+
.describe('ID of the collection/group to place the new space in.'),
|
|
144
|
+
...iconArg,
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Mirrors PublicAPIUpdateDocSpaceRequestSchema in @archbee/data-access, which
|
|
148
|
+
// this standalone package cannot import. The API re-validates with the real
|
|
149
|
+
// schema, so this only has to describe the shape well enough for the model;
|
|
150
|
+
// publicAccessControlPart passes unknown keys through so newer access-control
|
|
151
|
+
// fields keep working without a release here.
|
|
152
|
+
const emailListSchema = z.array(z.object({ email: z.string() }))
|
|
153
|
+
|
|
154
|
+
const publicAccessControlPartSchema = z
|
|
155
|
+
.object({
|
|
156
|
+
publicProtectionTypes: z
|
|
157
|
+
.array(
|
|
158
|
+
z.enum([
|
|
159
|
+
'None',
|
|
160
|
+
'Password',
|
|
161
|
+
'Guest accounts',
|
|
162
|
+
'Private Accounts',
|
|
163
|
+
'Private Link',
|
|
164
|
+
'Magic Link',
|
|
165
|
+
'JWT',
|
|
166
|
+
'SAML',
|
|
167
|
+
'OIDC',
|
|
168
|
+
])
|
|
169
|
+
)
|
|
170
|
+
.optional(),
|
|
171
|
+
publicPassword: z.string().optional(),
|
|
172
|
+
publicGuestAccounts: z
|
|
173
|
+
.array(z.object({ email: z.string(), password: z.string() }))
|
|
174
|
+
.optional(),
|
|
175
|
+
publicMagicLinkAccounts: emailListSchema.optional(),
|
|
176
|
+
publicPrivateAccounts: emailListSchema.optional(),
|
|
177
|
+
jwtValidationType: z.string().optional(),
|
|
178
|
+
jwtKeyUrl: z.string().optional(),
|
|
179
|
+
jwtSecret: z.string().optional(),
|
|
180
|
+
jwtRedirectURL: z.string().optional(),
|
|
181
|
+
samlMetadata: z.string().optional(),
|
|
182
|
+
samlEntityId: z.string().optional(),
|
|
183
|
+
conditionalRuleId: z.string().optional(),
|
|
184
|
+
})
|
|
185
|
+
.passthrough()
|
|
186
|
+
|
|
187
|
+
export const updateDocSpaceSchema = {
|
|
188
|
+
name: z
|
|
189
|
+
.string()
|
|
190
|
+
.optional()
|
|
191
|
+
.describe('New display name for the space (renames it).'),
|
|
192
|
+
hostnamePart: z
|
|
193
|
+
.object({ hostname: z.string(), hostnamePath: z.string() })
|
|
194
|
+
.optional()
|
|
195
|
+
.describe('Custom hostname configuration for the space.'),
|
|
196
|
+
spaceLinks: z
|
|
197
|
+
.array(z.object({ label: z.string(), docSpaceId: z.string() }))
|
|
198
|
+
.optional()
|
|
199
|
+
.describe(
|
|
200
|
+
'Links to other spaces. The list should start with the current space.'
|
|
201
|
+
),
|
|
202
|
+
publicAccessControlPart: publicAccessControlPartSchema
|
|
203
|
+
.optional()
|
|
204
|
+
.describe('Public access control and authentication configuration.'),
|
|
205
|
+
...iconArg,
|
|
206
|
+
...docSpaceIdArg,
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export const deleteDocSpaceSchema = { ...docSpaceIdArg }
|
|
210
|
+
|
|
211
|
+
export const createSpaceGroupSchema = {
|
|
212
|
+
name: z.string().describe('Name of the new space group.'),
|
|
213
|
+
isAiEnabled: z
|
|
214
|
+
.boolean()
|
|
215
|
+
.optional()
|
|
216
|
+
.describe('Enable AI features for the space group.'),
|
|
217
|
+
isReviewSystemEnabled: z
|
|
218
|
+
.boolean()
|
|
219
|
+
.optional()
|
|
220
|
+
.describe('Enable the review/approval workflow for the space group.'),
|
|
221
|
+
isBranchingSystemEnabled: z
|
|
222
|
+
.boolean()
|
|
223
|
+
.optional()
|
|
224
|
+
.describe('Enable the branching (git-style) workflow for the space group.'),
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export const deleteSpaceGroupSchema = {
|
|
228
|
+
docSpaceGroupId: z.string().describe('ID of the space group to delete.'),
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export const createCategorySchema = {
|
|
232
|
+
categoryName: z.string().describe('Name of the category to create.'),
|
|
233
|
+
parentDocId: z
|
|
234
|
+
.string()
|
|
235
|
+
.optional()
|
|
236
|
+
.describe(
|
|
237
|
+
'ID of the document or category to nest this category under. Omit to create it at the top level of the space.'
|
|
238
|
+
),
|
|
239
|
+
...docSpaceIdArg,
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export const deleteCategorySchema = {
|
|
243
|
+
categoryId: z.string().describe('ID of the category to delete.'),
|
|
244
|
+
...docSpaceIdArg,
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// Reusable resources belong to the organization, so none of these take a
|
|
248
|
+
// docSpaceId — except apply_template, which writes its document into one.
|
|
249
|
+
|
|
250
|
+
export const listTemplatesSchema = {}
|
|
251
|
+
|
|
252
|
+
export const createTemplateSchema = {
|
|
253
|
+
name: z.string().describe('Name of the template.'),
|
|
254
|
+
content: z
|
|
255
|
+
.string()
|
|
256
|
+
.optional()
|
|
257
|
+
.describe(
|
|
258
|
+
'Body of the template, as Markdown or MDX text. Omit for an empty template.'
|
|
259
|
+
),
|
|
260
|
+
...formatArg,
|
|
261
|
+
...iconArg,
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export const applyTemplateSchema = {
|
|
265
|
+
templateId: z
|
|
266
|
+
.string()
|
|
267
|
+
.describe('ID of the template to apply, as returned by list_templates.'),
|
|
268
|
+
title: z
|
|
269
|
+
.string()
|
|
270
|
+
.optional()
|
|
271
|
+
.describe(
|
|
272
|
+
'Title of the new document. Defaults to the name of the template.'
|
|
273
|
+
),
|
|
274
|
+
parentDocId: z
|
|
275
|
+
.string()
|
|
276
|
+
.optional()
|
|
277
|
+
.describe('ID of the document or category to nest the new document under.'),
|
|
278
|
+
slug: z.string().optional().describe('URL slug for the new document.'),
|
|
279
|
+
...iconArg,
|
|
280
|
+
...docSpaceIdArg,
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export const listContentSnippetsSchema = {}
|
|
284
|
+
|
|
285
|
+
export const createContentSnippetSchema = {
|
|
286
|
+
name: z.string().describe('Name of the content snippet.'),
|
|
287
|
+
content: z
|
|
288
|
+
.string()
|
|
289
|
+
.optional()
|
|
290
|
+
.describe(
|
|
291
|
+
'Body of the snippet, as Markdown or MDX text. Omit for an empty snippet.'
|
|
292
|
+
),
|
|
293
|
+
...formatArg,
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export const updateContentSnippetSchema = {
|
|
297
|
+
snippetId: z
|
|
298
|
+
.string()
|
|
299
|
+
.describe(
|
|
300
|
+
'ID of the snippet to update, as returned by list_content_snippets.'
|
|
301
|
+
),
|
|
302
|
+
name: z.string().optional().describe('New name for the snippet.'),
|
|
303
|
+
content: z
|
|
304
|
+
.string()
|
|
305
|
+
.optional()
|
|
306
|
+
.describe('New body for the snippet, as Markdown or MDX text.'),
|
|
307
|
+
...formatArg,
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export const deleteContentSnippetSchema = {
|
|
311
|
+
snippetId: z
|
|
312
|
+
.string()
|
|
313
|
+
.describe(
|
|
314
|
+
'ID of the snippet to delete, as returned by list_content_snippets.'
|
|
315
|
+
),
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export const listVariablesSchema = {
|
|
319
|
+
variableType: variableTypeSchema
|
|
320
|
+
.optional()
|
|
321
|
+
.describe('Return only variables, or only glossary terms. Omit for both.'),
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export const createVariableSchema = {
|
|
325
|
+
name: z
|
|
326
|
+
.string()
|
|
327
|
+
.describe(
|
|
328
|
+
'Name of the variable, which is how documents reference it. Must be unique within its type.'
|
|
329
|
+
),
|
|
330
|
+
variableContent: z.string().describe('Value the variable resolves to.'),
|
|
331
|
+
description: z
|
|
332
|
+
.string()
|
|
333
|
+
.optional()
|
|
334
|
+
.describe('Short description shown next to the variable in the app.'),
|
|
335
|
+
variableType: variableTypeSchema
|
|
336
|
+
.optional()
|
|
337
|
+
.describe('Defaults to variable. Use glossary for a glossary term.'),
|
|
338
|
+
spaceTargetMap: spaceTargetMapSchema
|
|
339
|
+
.optional()
|
|
340
|
+
.describe(
|
|
341
|
+
'Overrides of the value, keyed by space id (per-space value) or by language code (translated value).'
|
|
342
|
+
),
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
export const updateVariableSchema = {
|
|
346
|
+
variableId: z
|
|
347
|
+
.string()
|
|
348
|
+
.describe('ID of the variable to update, as returned by list_variables.'),
|
|
349
|
+
name: z.string().optional().describe('New name for the variable.'),
|
|
350
|
+
variableContent: z
|
|
351
|
+
.string()
|
|
352
|
+
.optional()
|
|
353
|
+
.describe('New value the variable resolves to.'),
|
|
354
|
+
description: z
|
|
355
|
+
.string()
|
|
356
|
+
.optional()
|
|
357
|
+
.describe('New description for the variable.'),
|
|
358
|
+
variableType: variableTypeSchema
|
|
359
|
+
.optional()
|
|
360
|
+
.describe('Change whether this is a variable or a glossary term.'),
|
|
361
|
+
spaceTargetMap: spaceTargetMapSchema
|
|
362
|
+
.optional()
|
|
363
|
+
.describe(
|
|
364
|
+
'Replaces the per-space / per-language overrides with this map in full.'
|
|
365
|
+
),
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
export const deleteVariableSchema = {
|
|
369
|
+
variableId: z
|
|
370
|
+
.string()
|
|
371
|
+
.describe('ID of the variable to delete, as returned by list_variables.'),
|
|
372
|
+
}
|