@pitcher/cli-scripts 2.7.1 → 2.9.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 +59 -0
- package/dist/index.js +4 -0
- package/dist/src/commands/dsr.d.ts +36 -0
- package/dist/src/commands/dsr.js +229 -0
- package/dist/src/commands/mcp.d.ts +2 -0
- package/dist/src/commands/mcp.js +18 -0
- package/dist/src/commands/scaffolds.d.ts +1 -0
- package/dist/src/commands/scaffolds.js +24 -0
- package/dist/src/mcp/env.d.ts +7 -0
- package/dist/src/mcp/env.js +13 -0
- package/dist/src/mcp/registry.d.ts +2 -0
- package/dist/src/mcp/registry.js +46 -0
- package/dist/src/mcp/result.d.ts +13 -0
- package/dist/src/mcp/result.js +20 -0
- package/dist/src/mcp/serve.d.ts +1 -0
- package/dist/src/mcp/serve.js +13 -0
- package/dist/src/mcp/server.d.ts +3 -0
- package/dist/src/mcp/server.js +41 -0
- package/dist/src/mcp/tools/analytics.d.ts +2 -0
- package/dist/src/mcp/tools/analytics.js +20 -0
- package/dist/src/mcp/tools/announcements.d.ts +2 -0
- package/dist/src/mcp/tools/announcements.js +32 -0
- package/dist/src/mcp/tools/canvases.d.ts +2 -0
- package/dist/src/mcp/tools/canvases.js +30 -0
- package/dist/src/mcp/tools/devSync.d.ts +2 -0
- package/dist/src/mcp/tools/devSync.js +53 -0
- package/dist/src/mcp/tools/dsr.d.ts +2 -0
- package/dist/src/mcp/tools/dsr.js +47 -0
- package/dist/src/mcp/tools/dsrLanding.d.ts +2 -0
- package/dist/src/mcp/tools/dsrLanding.js +45 -0
- package/dist/src/mcp/tools/emailTemplate.d.ts +2 -0
- package/dist/src/mcp/tools/emailTemplate.js +47 -0
- package/dist/src/mcp/tools/files.d.ts +2 -0
- package/dist/src/mcp/tools/files.js +65 -0
- package/dist/src/mcp/tools/folders.d.ts +2 -0
- package/dist/src/mcp/tools/folders.js +56 -0
- package/dist/src/mcp/tools/groups.d.ts +2 -0
- package/dist/src/mcp/tools/groups.js +60 -0
- package/dist/src/mcp/tools/instances.d.ts +2 -0
- package/dist/src/mcp/tools/instances.js +28 -0
- package/dist/src/mcp/tools/invitations.d.ts +2 -0
- package/dist/src/mcp/tools/invitations.js +23 -0
- package/dist/src/mcp/tools/memberships.d.ts +2 -0
- package/dist/src/mcp/tools/memberships.js +47 -0
- package/dist/src/mcp/tools/metadataTemplate.d.ts +2 -0
- package/dist/src/mcp/tools/metadataTemplate.js +42 -0
- package/dist/src/mcp/tools/org.d.ts +2 -0
- package/dist/src/mcp/tools/org.js +12 -0
- package/dist/src/mcp/tools/publishApp.d.ts +2 -0
- package/dist/src/mcp/tools/publishApp.js +39 -0
- package/dist/src/mcp/tools/roles.d.ts +2 -0
- package/dist/src/mcp/tools/roles.js +15 -0
- package/dist/src/mcp/tools/search.d.ts +2 -0
- package/dist/src/mcp/tools/search.js +16 -0
- package/dist/src/mcp/tools/sharedLinks.d.ts +2 -0
- package/dist/src/mcp/tools/sharedLinks.js +27 -0
- package/dist/src/mcp/tools/tags.d.ts +2 -0
- package/dist/src/mcp/tools/tags.js +20 -0
- package/dist/src/mcp/tools/themes.d.ts +2 -0
- package/dist/src/mcp/tools/themes.js +28 -0
- package/dist/src/mcp/tools/types.d.ts +15 -0
- package/dist/src/mcp/tools/types.js +1 -0
- package/dist/src/mcp/tools/users.d.ts +2 -0
- package/dist/src/mcp/tools/users.js +31 -0
- package/package.json +4 -2
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runAnnouncementsCreate, runAnnouncementsList } from '../../commands/announcements.js';
|
|
3
|
+
export const announcementsTools = [
|
|
4
|
+
{
|
|
5
|
+
name: 'pitcher_announcements_create',
|
|
6
|
+
title: 'Create an announcement',
|
|
7
|
+
description: 'Create a wa-announcements appsDB record (title/body, optional media, CTA link, scheduling, group targeting). ' +
|
|
8
|
+
'Requires either fromFile (a JSON object with the announcement data) or both title and body. Additive.',
|
|
9
|
+
inputShape: {
|
|
10
|
+
instanceId: z.string().describe('Instance ID (required)'),
|
|
11
|
+
fromFile: z.string().optional().describe('Path to a JSON file with the announcement data object'),
|
|
12
|
+
title: z.string().optional().describe('Announcement title (overrides a matching fromFile key)'),
|
|
13
|
+
body: z.string().optional().describe('Announcement body HTML (overrides a matching fromFile key)'),
|
|
14
|
+
priority: z.string().optional().describe("Priority, e.g. 'normal' or 'important' (overrides a matching fromFile key)"),
|
|
15
|
+
},
|
|
16
|
+
run: runAnnouncementsCreate,
|
|
17
|
+
readOnly: false,
|
|
18
|
+
write: true,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'pitcher_announcements_list',
|
|
22
|
+
title: 'List announcements',
|
|
23
|
+
description: 'List wa-announcements appsDB records for an instance.',
|
|
24
|
+
inputShape: {
|
|
25
|
+
instanceId: z.string().describe('Instance ID (required)'),
|
|
26
|
+
limit: z.number().int().optional(),
|
|
27
|
+
offset: z.number().int().optional(),
|
|
28
|
+
},
|
|
29
|
+
run: runAnnouncementsList,
|
|
30
|
+
readOnly: true,
|
|
31
|
+
},
|
|
32
|
+
];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runCanvasesList, runCanvasesGet } from '../../commands/canvases.js';
|
|
3
|
+
export const canvasesTools = [
|
|
4
|
+
{
|
|
5
|
+
name: 'pitcher_canvases_list',
|
|
6
|
+
title: 'List canvases',
|
|
7
|
+
description: 'List canvases (presentations, sections, blocks) in an instance. Use to discover canvas IDs before sharing or reading. Blocks are hidden unless isBlock is true.',
|
|
8
|
+
inputShape: {
|
|
9
|
+
instanceId: z.string().describe('Instance ID (required)'),
|
|
10
|
+
isTemplate: z.boolean().optional().describe('Only templates'),
|
|
11
|
+
isSection: z.boolean().optional().describe('Only sections'),
|
|
12
|
+
isBlock: z.boolean().optional().describe('Only blocks (hidden unless set)'),
|
|
13
|
+
tags: z.string().optional().describe('Comma-separated tags'),
|
|
14
|
+
idIn: z.string().optional().describe('Comma-separated canvas IDs'),
|
|
15
|
+
accessType: z.enum(['public', 'restricted', 'personal']).optional(),
|
|
16
|
+
page: z.number().int().optional(),
|
|
17
|
+
pageSize: z.number().int().optional().describe('Page size (max 500)'),
|
|
18
|
+
},
|
|
19
|
+
run: runCanvasesList,
|
|
20
|
+
readOnly: true,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'pitcher_canvases_get',
|
|
24
|
+
title: 'Get a canvas',
|
|
25
|
+
description: 'Retrieve a single canvas by its ID.',
|
|
26
|
+
inputShape: { id: z.string().describe('Canvas ID') },
|
|
27
|
+
run: runCanvasesGet,
|
|
28
|
+
readOnly: true,
|
|
29
|
+
},
|
|
30
|
+
];
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runDevSync, runRevert } from '../../commands/devSync.js';
|
|
3
|
+
import { fail } from '../../core/envelope.js';
|
|
4
|
+
import { createCliError } from '../../core/errors.js';
|
|
5
|
+
// devSync.ts is legacy-shaped: `DevSyncOptions.fileId` is a required (non-optional)
|
|
6
|
+
// string, unlike every other command's `CommonOpts & { field?: ... }` + in-run
|
|
7
|
+
// VALIDATION-throw pattern. That mismatch means `runDevSync`/`runRevert` cannot be
|
|
8
|
+
// assigned directly to `ToolDescriptor.run` (typed `Record<string, unknown> &
|
|
9
|
+
// InjectedAuth`) — TS reports `fileId` as missing. These thin wrappers narrow the
|
|
10
|
+
// runtime value (the MCP zod schema already guarantees it's a string) and forward
|
|
11
|
+
// a properly-typed object literal, instead of casting the whole `opts` blob.
|
|
12
|
+
function requireFileId(opts) {
|
|
13
|
+
return typeof opts.fileId === 'string' ? opts.fileId : undefined;
|
|
14
|
+
}
|
|
15
|
+
export const devSyncTools = [
|
|
16
|
+
{
|
|
17
|
+
name: 'pitcher_dev_sync',
|
|
18
|
+
title: 'Dev-sync an app (one-shot)',
|
|
19
|
+
description: 'One-time sync of a local app build (a folder with app.json, on the MCP server host — cwd or ./dist) ' +
|
|
20
|
+
'to S3 as a live dev override for an installed app file, for testing without publishing. ' +
|
|
21
|
+
'This is a single sync, not the continuous watcher — call again to re-sync after further changes. ' +
|
|
22
|
+
'Reversible with pitcher_dev_sync_revert.',
|
|
23
|
+
inputShape: {
|
|
24
|
+
fileId: z.string().describe('File ID of the installed app (pitcher_file.id) to override'),
|
|
25
|
+
},
|
|
26
|
+
run: (opts, deps) => {
|
|
27
|
+
const fileId = requireFileId(opts);
|
|
28
|
+
if (!fileId)
|
|
29
|
+
return Promise.resolve(fail(createCliError('VALIDATION', 'fileId is required')));
|
|
30
|
+
return runDevSync({ fileId, apiKey: opts.apiKey, org: opts.org }, deps);
|
|
31
|
+
},
|
|
32
|
+
wraps: runDevSync,
|
|
33
|
+
readOnly: false,
|
|
34
|
+
write: true,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'pitcher_dev_sync_revert',
|
|
38
|
+
title: 'Revert a dev-sync override',
|
|
39
|
+
description: 'Revert a dev-sync override on an installed app file, restoring its original published version.',
|
|
40
|
+
inputShape: {
|
|
41
|
+
fileId: z.string().describe('File ID of the installed app (pitcher_file.id) to revert'),
|
|
42
|
+
},
|
|
43
|
+
run: (opts, deps) => {
|
|
44
|
+
const fileId = requireFileId(opts);
|
|
45
|
+
if (!fileId)
|
|
46
|
+
return Promise.resolve(fail(createCliError('VALIDATION', 'fileId is required')));
|
|
47
|
+
return runRevert({ fileId, apiKey: opts.apiKey, org: opts.org }, deps);
|
|
48
|
+
},
|
|
49
|
+
wraps: runRevert,
|
|
50
|
+
readOnly: false,
|
|
51
|
+
write: true,
|
|
52
|
+
},
|
|
53
|
+
];
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runDsrCreate, runDsrBindLanding } from '../../commands/dsr.js';
|
|
3
|
+
const AUTH_STRATEGIES = [
|
|
4
|
+
'none', 'any_email', 'specified_emails', 'specified_domains', 'verified_emails', 'verified_domains',
|
|
5
|
+
];
|
|
6
|
+
export const dsrTools = [
|
|
7
|
+
{
|
|
8
|
+
name: 'pitcher_dsr_create',
|
|
9
|
+
title: 'Create and share a DSR',
|
|
10
|
+
description: 'Create a Digital Sales Room (a canvas share link) and get a clickable link back. Source is a canvas (canvasId) OR files (shareboxFileIds) - exactly one. Optional email/domain gating and a bound landing-page template. Never hard-fails once a link exists: a failed landing bind returns the link with a warning. Additive.',
|
|
11
|
+
inputShape: {
|
|
12
|
+
instanceId: z.string().optional().describe('Instance ID (required for the shareboxFileIds source)'),
|
|
13
|
+
canvasId: z.string().optional().describe('Canvas to share (exactly one of canvasId / shareboxFileIds)'),
|
|
14
|
+
shareboxFileIds: z.array(z.string()).optional().describe('File IDs to build a share from (exactly one of canvasId / shareboxFileIds)'),
|
|
15
|
+
canvasName: z.string().optional().describe('Name for the ShareBox-built canvas'),
|
|
16
|
+
accountId: z.string().optional(),
|
|
17
|
+
templateId: z.string().optional(),
|
|
18
|
+
authStrategy: z.enum(AUTH_STRATEGIES).optional().describe('Access gating (server default any_email)'),
|
|
19
|
+
allowedEmails: z.array(z.string()).optional().describe('Required for specified_emails / verified_emails'),
|
|
20
|
+
allowedDomains: z.array(z.string()).optional().describe('Required for specified_domains / verified_domains'),
|
|
21
|
+
validUntil: z.string().optional().describe('Expiry, ISO datetime'),
|
|
22
|
+
allowForward: z.boolean().optional(),
|
|
23
|
+
allowDownload: z.boolean().optional(),
|
|
24
|
+
tags: z.array(z.string()).optional(),
|
|
25
|
+
landingTemplateId: z.string().optional().describe('Bind a landing-page template (discover via pitcher_dsr_landing_list)'),
|
|
26
|
+
landingContext: z.string().optional().describe('Landing-page merge fields, a JSON object as a string'),
|
|
27
|
+
configFile: z.string().optional().describe('Path on the MCP server host to a full {source,security,landing} spec JSON; mutually exclusive with the individual flags'),
|
|
28
|
+
},
|
|
29
|
+
run: runDsrCreate,
|
|
30
|
+
readOnly: false,
|
|
31
|
+
write: true,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'pitcher_dsr_bind_landing',
|
|
35
|
+
title: 'Bind a DSR landing page',
|
|
36
|
+
description: 'Attach, re-brand, or unbind a landing-page template on an existing DSR share. Use landingTemplateId "none" to unbind. Requires an editor-level key (hard-fails AUTH otherwise).',
|
|
37
|
+
inputShape: {
|
|
38
|
+
id: z.string().describe('Shared-link ID'),
|
|
39
|
+
landingTemplateId: z.string().describe('Landing template ID, or "none" to unbind'),
|
|
40
|
+
landingContext: z.string().optional().describe('Landing-page merge fields, a JSON object as a string'),
|
|
41
|
+
instanceId: z.string().optional(),
|
|
42
|
+
},
|
|
43
|
+
run: runDsrBindLanding,
|
|
44
|
+
readOnly: false,
|
|
45
|
+
write: true,
|
|
46
|
+
},
|
|
47
|
+
];
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runDsrLandingCreate, runDsrLandingSetDefault, runDsrLandingList } from '../../commands/dsrLanding.js';
|
|
3
|
+
export const dsrLandingTools = [
|
|
4
|
+
{
|
|
5
|
+
name: 'pitcher_dsr_landing_create',
|
|
6
|
+
title: 'Create a DSR landing template',
|
|
7
|
+
description: 'Create a DSR (Digital Sales Room) landing-page template from HTML (must contain the data-pitcher-email-gate ' +
|
|
8
|
+
'marker) and optional CSS/merge-schema/thumbnail. Optionally set it as the instance default in the same call. Additive.',
|
|
9
|
+
inputShape: {
|
|
10
|
+
instanceId: z.string().describe('Instance ID (required)'),
|
|
11
|
+
name: z.string().describe('Template name (required)'),
|
|
12
|
+
htmlFile: z.string().describe('Path to the landing HTML (required; must contain data-pitcher-email-gate)'),
|
|
13
|
+
cssFile: z.string().optional().describe('Path to a CSS file for the template'),
|
|
14
|
+
mergeSchema: z.string().optional().describe('Merge schema JSON array as a string'),
|
|
15
|
+
thumbnailUrl: z.string().optional().describe('Thumbnail image URL'),
|
|
16
|
+
language: z.string().optional().describe('Language code (max 10 chars)'),
|
|
17
|
+
default: z.boolean().optional().describe('Also set this template as the instance-scope default after creating it'),
|
|
18
|
+
},
|
|
19
|
+
run: runDsrLandingCreate,
|
|
20
|
+
readOnly: false,
|
|
21
|
+
write: true,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'pitcher_dsr_landing_set_default',
|
|
25
|
+
title: 'Set default DSR landing template',
|
|
26
|
+
description: 'Set an existing DSR landing-page template as the instance-scope default.',
|
|
27
|
+
inputShape: {
|
|
28
|
+
instanceId: z.string().describe('Instance ID (required)'),
|
|
29
|
+
id: z.string().describe('Template ID (required)'),
|
|
30
|
+
},
|
|
31
|
+
run: runDsrLandingSetDefault,
|
|
32
|
+
readOnly: false,
|
|
33
|
+
write: true,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'pitcher_dsr_landing_list',
|
|
37
|
+
title: 'List DSR landing templates',
|
|
38
|
+
description: 'List DSR (Digital Sales Room) landing-page templates in an instance.',
|
|
39
|
+
inputShape: {
|
|
40
|
+
instanceId: z.string().describe('Instance ID (required)'),
|
|
41
|
+
},
|
|
42
|
+
run: runDsrLandingList,
|
|
43
|
+
readOnly: true,
|
|
44
|
+
},
|
|
45
|
+
];
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runEmailTemplateCreate, runEmailTemplateList, runEmailTemplateGet } from '../../commands/emailTemplate.js';
|
|
3
|
+
export const emailTemplateTools = [
|
|
4
|
+
{
|
|
5
|
+
name: 'pitcher_email_template_create',
|
|
6
|
+
title: 'Create an email template',
|
|
7
|
+
description: 'Create an HTML email template for the emails app (Rep Triggered Emails). Additive.',
|
|
8
|
+
inputShape: {
|
|
9
|
+
instanceId: z.string().describe('Instance ID (required)'),
|
|
10
|
+
name: z.string().describe('Template name (required)'),
|
|
11
|
+
bodyFile: z.string().optional().describe('Path to an HTML file (inline CSS) used as the template body'),
|
|
12
|
+
subject: z.string().optional().describe('Email subject (supports {{tokens}})'),
|
|
13
|
+
tags: z.string().optional().describe('Tags JSON object as a string'),
|
|
14
|
+
metadata: z.string().optional().describe('Metadata JSON object as a string'),
|
|
15
|
+
},
|
|
16
|
+
run: runEmailTemplateCreate,
|
|
17
|
+
readOnly: false,
|
|
18
|
+
write: true,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'pitcher_email_template_list',
|
|
22
|
+
title: 'List email templates',
|
|
23
|
+
description: 'List HTML email templates for the emails app in an instance. Filter by name, status, category, or target.',
|
|
24
|
+
inputShape: {
|
|
25
|
+
instanceId: z.string().describe('Instance ID (required)'),
|
|
26
|
+
name: z.string().optional().describe('Case-insensitive substring filter, matched against name OR subject'),
|
|
27
|
+
status: z.string().optional().describe('Status filter'),
|
|
28
|
+
category: z.string().optional().describe('Category filter'),
|
|
29
|
+
target: z.string().optional().describe('Target filter'),
|
|
30
|
+
limit: z.number().int().optional(),
|
|
31
|
+
offset: z.number().int().optional(),
|
|
32
|
+
},
|
|
33
|
+
run: runEmailTemplateList,
|
|
34
|
+
readOnly: true,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'pitcher_email_template_get',
|
|
38
|
+
title: 'Get an email template',
|
|
39
|
+
description: 'Retrieve a single HTML email template by its ID.',
|
|
40
|
+
inputShape: {
|
|
41
|
+
instanceId: z.string().describe('Instance ID (required)'),
|
|
42
|
+
id: z.string().describe('Template ID (required)'),
|
|
43
|
+
},
|
|
44
|
+
run: runEmailTemplateGet,
|
|
45
|
+
readOnly: true,
|
|
46
|
+
},
|
|
47
|
+
];
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runFilesList, runFilesGet, runFilesCreate, runFilesUpdate } from '../../commands/files.js';
|
|
3
|
+
export const filesTools = [
|
|
4
|
+
{
|
|
5
|
+
name: 'pitcher_files_list',
|
|
6
|
+
title: 'List files',
|
|
7
|
+
description: 'List content files in an instance. Filter by tags or specific IDs.',
|
|
8
|
+
inputShape: {
|
|
9
|
+
instanceId: z.string().describe('Instance ID (required)'),
|
|
10
|
+
idIn: z.string().optional().describe('Comma-separated file IDs'),
|
|
11
|
+
tags: z.string().optional().describe('Comma-separated tags'),
|
|
12
|
+
page: z.number().int().optional(),
|
|
13
|
+
pageSize: z.number().int().optional(),
|
|
14
|
+
},
|
|
15
|
+
run: runFilesList,
|
|
16
|
+
readOnly: true,
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: 'pitcher_files_get',
|
|
20
|
+
title: 'Get a file',
|
|
21
|
+
description: 'Retrieve a single file by its ID.',
|
|
22
|
+
inputShape: { id: z.string().describe('File ID') },
|
|
23
|
+
run: runFilesGet,
|
|
24
|
+
readOnly: true,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'pitcher_files_create',
|
|
28
|
+
title: 'Create a file',
|
|
29
|
+
description: 'Create a content file in an instance, from a local file path (on the server host) or a source URL. Additive.',
|
|
30
|
+
inputShape: {
|
|
31
|
+
instanceId: z.string().describe('Instance ID (required)'),
|
|
32
|
+
name: z.string().optional().describe('File name'),
|
|
33
|
+
folderId: z.string().optional().describe('Destination folder'),
|
|
34
|
+
filePath: z.string().optional().describe('Local file path to upload (on the MCP server host)'),
|
|
35
|
+
sourceUrl: z.string().optional().describe('Link/WEB file source URL'),
|
|
36
|
+
accessType: z.enum(['public', 'restricted', 'personal']).optional(),
|
|
37
|
+
tags: z.string().optional().describe('Comma-separated tags'),
|
|
38
|
+
metadata: z.string().optional().describe('metadata JSON object as a string'),
|
|
39
|
+
appMetadata: z.string().optional().describe('app_metadata JSON object as a string'),
|
|
40
|
+
},
|
|
41
|
+
run: runFilesCreate,
|
|
42
|
+
readOnly: false,
|
|
43
|
+
write: true,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'pitcher_files_update',
|
|
47
|
+
title: 'Update a file',
|
|
48
|
+
description: 'Update a file by ID (name, folder, access, tags, metadata). filePath or sourceUrl replaces/overwrites the file binary; metadata is deep-merged.',
|
|
49
|
+
inputShape: {
|
|
50
|
+
id: z.string().describe('File ID'),
|
|
51
|
+
instanceId: z.string().optional().describe('Instance ID (required only with filePath)'),
|
|
52
|
+
name: z.string().optional(),
|
|
53
|
+
folderId: z.string().optional(),
|
|
54
|
+
filePath: z.string().optional().describe('Local file path to replace the binary (on the MCP server host)'),
|
|
55
|
+
sourceUrl: z.string().optional(),
|
|
56
|
+
accessType: z.enum(['public', 'restricted', 'personal']).optional(),
|
|
57
|
+
tags: z.string().optional().describe('Comma-separated tags'),
|
|
58
|
+
metadata: z.string().optional().describe('metadata JSON object as a string (deep-merged)'),
|
|
59
|
+
appMetadata: z.string().optional().describe('app_metadata JSON object as a string (deep-merged)'),
|
|
60
|
+
},
|
|
61
|
+
run: runFilesUpdate,
|
|
62
|
+
readOnly: false,
|
|
63
|
+
write: true,
|
|
64
|
+
},
|
|
65
|
+
];
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runFoldersList, runFoldersGet, runFoldersCreate, runFoldersUpdate } from '../../commands/folders.js';
|
|
3
|
+
export const foldersTools = [
|
|
4
|
+
{
|
|
5
|
+
name: 'pitcher_folders_list',
|
|
6
|
+
title: 'List folders',
|
|
7
|
+
description: 'List folders in an instance. Use to discover folder IDs before creating content or browsing structure.',
|
|
8
|
+
inputShape: {
|
|
9
|
+
instanceId: z.string().describe('Instance ID (required)'),
|
|
10
|
+
page: z.number().int().optional(),
|
|
11
|
+
pageSize: z.number().int().optional().describe('Page size (max 500)'),
|
|
12
|
+
},
|
|
13
|
+
run: runFoldersList,
|
|
14
|
+
readOnly: true,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'pitcher_folders_get',
|
|
18
|
+
title: 'Get a folder',
|
|
19
|
+
description: 'Retrieve a single folder by its ID, or the instance root folder via root + instanceId.',
|
|
20
|
+
inputShape: {
|
|
21
|
+
id: z.string().optional().describe('Folder ID (omit and set root=true for the instance root)'),
|
|
22
|
+
root: z.boolean().optional().describe('Fetch the instance root folder'),
|
|
23
|
+
instanceId: z.string().optional().describe('Instance ID (required with root)'),
|
|
24
|
+
},
|
|
25
|
+
run: runFoldersGet,
|
|
26
|
+
readOnly: true,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'pitcher_folders_create',
|
|
30
|
+
title: 'Create a folder',
|
|
31
|
+
description: 'Create a folder under a parent folder in an instance. Additive.',
|
|
32
|
+
inputShape: {
|
|
33
|
+
name: z.string().describe('Folder name (required)'),
|
|
34
|
+
parentFolderId: z.string().describe('Parent folder ID (required)'),
|
|
35
|
+
accessType: z.enum(['public', 'restricted', 'personal']).optional(),
|
|
36
|
+
rules: z.string().optional().describe('Smart-folder rules JSON array as a string'),
|
|
37
|
+
},
|
|
38
|
+
run: runFoldersCreate,
|
|
39
|
+
readOnly: false,
|
|
40
|
+
write: true,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'pitcher_folders_update',
|
|
44
|
+
title: 'Update a folder',
|
|
45
|
+
description: 'Update an existing folder by ID (name, access type, or smart-folder rules; rules replace existing).',
|
|
46
|
+
inputShape: {
|
|
47
|
+
id: z.string().describe('Folder ID'),
|
|
48
|
+
name: z.string().optional().describe('Folder name'),
|
|
49
|
+
accessType: z.enum(['public', 'restricted', 'personal']).optional(),
|
|
50
|
+
rules: z.string().optional().describe('Smart-folder rules JSON array as a string (replaces existing)'),
|
|
51
|
+
},
|
|
52
|
+
run: runFoldersUpdate,
|
|
53
|
+
readOnly: false,
|
|
54
|
+
write: true,
|
|
55
|
+
},
|
|
56
|
+
];
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runGroupsList, runGroupsGet, runGroupsCreate, runGroupsAddUser, runGroupsListUsers, } from '../../commands/groups.js';
|
|
3
|
+
export const groupsTools = [
|
|
4
|
+
{
|
|
5
|
+
name: 'pitcher_groups_list',
|
|
6
|
+
title: 'List content-distribution groups',
|
|
7
|
+
description: 'List content-distribution groups. Filter by instance.',
|
|
8
|
+
inputShape: {
|
|
9
|
+
instanceId: z.string().optional().describe('Filter by instance'),
|
|
10
|
+
page: z.number().int().optional().describe('Page number'),
|
|
11
|
+
pageSize: z.number().int().optional().describe('Page size (max 500)'),
|
|
12
|
+
},
|
|
13
|
+
run: runGroupsList,
|
|
14
|
+
readOnly: true,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'pitcher_groups_get',
|
|
18
|
+
title: 'Get a group',
|
|
19
|
+
description: 'Retrieve a single content-distribution group by its ID.',
|
|
20
|
+
inputShape: { id: z.string().describe('Group ID') },
|
|
21
|
+
run: runGroupsGet,
|
|
22
|
+
readOnly: true,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'pitcher_groups_create',
|
|
26
|
+
title: 'Create a group',
|
|
27
|
+
description: 'Create a content-distribution group in an instance. Additive.',
|
|
28
|
+
inputShape: {
|
|
29
|
+
instanceId: z.string().describe('Instance ID (required)'),
|
|
30
|
+
name: z.string().describe('Group name (required)'),
|
|
31
|
+
},
|
|
32
|
+
run: runGroupsCreate,
|
|
33
|
+
readOnly: false,
|
|
34
|
+
write: true,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'pitcher_groups_add_user',
|
|
38
|
+
title: 'Add a user to a group',
|
|
39
|
+
description: 'Add a user to a content-distribution group. Rejected on auto-login-managed groups.',
|
|
40
|
+
inputShape: {
|
|
41
|
+
groupId: z.string().describe('Group ID (required)'),
|
|
42
|
+
userId: z.string().describe('User ID (integer, required)'),
|
|
43
|
+
},
|
|
44
|
+
run: runGroupsAddUser,
|
|
45
|
+
readOnly: false,
|
|
46
|
+
write: true,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'pitcher_groups_list_users',
|
|
50
|
+
title: "List a group's members",
|
|
51
|
+
description: "List a content-distribution group's members.",
|
|
52
|
+
inputShape: {
|
|
53
|
+
groupId: z.string().describe('Group whose members to list (required)'),
|
|
54
|
+
page: z.number().int().optional().describe('Page number'),
|
|
55
|
+
pageSize: z.number().int().optional().describe('Page size (max 500)'),
|
|
56
|
+
},
|
|
57
|
+
run: runGroupsListUsers,
|
|
58
|
+
readOnly: true,
|
|
59
|
+
},
|
|
60
|
+
];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runInstancesList, runInstancesInfo } from '../../commands/instances.js';
|
|
3
|
+
export const instancesTools = [
|
|
4
|
+
{
|
|
5
|
+
name: 'pitcher_instances_list',
|
|
6
|
+
title: 'List instances',
|
|
7
|
+
description: 'Discover Pitcher instances in the org. Use to resolve instance names to instance IDs.' +
|
|
8
|
+
' Output may include raw instance settings/metadata (potentially integration credentials) - treat as sensitive.',
|
|
9
|
+
inputShape: {
|
|
10
|
+
region: z.string().optional().describe('Filter by region'),
|
|
11
|
+
storageRegion: z.string().optional().describe('Filter by storage region'),
|
|
12
|
+
environment: z.string().optional().describe('Filter by environment'),
|
|
13
|
+
page: z.number().int().optional(),
|
|
14
|
+
pageSize: z.number().int().optional().describe('Page size (max 500)'),
|
|
15
|
+
},
|
|
16
|
+
run: runInstancesList,
|
|
17
|
+
readOnly: true,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: 'pitcher_instances_info',
|
|
21
|
+
title: 'Get an instance',
|
|
22
|
+
description: 'Retrieve details for a single instance by its ID.' +
|
|
23
|
+
' Output may include raw instance settings/metadata (potentially integration credentials) - treat as sensitive.',
|
|
24
|
+
inputShape: { id: z.string().describe('Instance ID') },
|
|
25
|
+
run: runInstancesInfo,
|
|
26
|
+
readOnly: true,
|
|
27
|
+
},
|
|
28
|
+
];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runInvitationsList, runInvitationsGet } from '../../commands/invitations.js';
|
|
3
|
+
export const invitationsTools = [
|
|
4
|
+
{
|
|
5
|
+
name: 'pitcher_invitations_list',
|
|
6
|
+
title: 'List invitations',
|
|
7
|
+
description: 'List pending user invitations in the org.',
|
|
8
|
+
inputShape: {
|
|
9
|
+
page: z.number().int().optional().describe('Page number'),
|
|
10
|
+
pageSize: z.number().int().optional().describe('Page size (max 500)'),
|
|
11
|
+
},
|
|
12
|
+
run: runInvitationsList,
|
|
13
|
+
readOnly: true,
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: 'pitcher_invitations_get',
|
|
17
|
+
title: 'Get an invitation',
|
|
18
|
+
description: 'Retrieve a single pending invitation by ID.',
|
|
19
|
+
inputShape: { id: z.string().describe('Invitation ID') },
|
|
20
|
+
run: runInvitationsGet,
|
|
21
|
+
readOnly: true,
|
|
22
|
+
},
|
|
23
|
+
];
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runMembershipsList, runMembershipsAdd, runMembershipsSetRole } from '../../commands/memberships.js';
|
|
3
|
+
export const membershipsTools = [
|
|
4
|
+
{
|
|
5
|
+
name: 'pitcher_memberships_list',
|
|
6
|
+
title: 'List instance memberships',
|
|
7
|
+
description: 'List instance memberships. Filter by instance or user to discover membership IDs before set-role.',
|
|
8
|
+
inputShape: {
|
|
9
|
+
instanceId: z.string().optional().describe('Filter by instance'),
|
|
10
|
+
userId: z.string().optional().describe('Filter by user (integer id)'),
|
|
11
|
+
page: z.number().int().optional().describe('Page number'),
|
|
12
|
+
pageSize: z.number().int().optional().describe('Page size (max 500)'),
|
|
13
|
+
},
|
|
14
|
+
run: runMembershipsList,
|
|
15
|
+
readOnly: true,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'pitcher_memberships_add',
|
|
19
|
+
title: 'Add a member',
|
|
20
|
+
description: "Add a user to an instance as 'member' (role is always 'member' — this endpoint never accepts a " +
|
|
21
|
+
"caller-supplied role). Use pitcher_memberships_set_role to change the role afterward.",
|
|
22
|
+
inputShape: {
|
|
23
|
+
instanceId: z.string().describe('Instance ID (required)'),
|
|
24
|
+
userId: z.string().describe('User ID (integer, required)'),
|
|
25
|
+
},
|
|
26
|
+
run: runMembershipsAdd,
|
|
27
|
+
readOnly: false,
|
|
28
|
+
write: true,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'pitcher_memberships_set_role',
|
|
32
|
+
title: 'Set a membership role',
|
|
33
|
+
description: "Change a membership's role via the validating next-core endpoint. Requires an org-admin key. " +
|
|
34
|
+
"--role is the SHORT role name (e.g. 'editor') from pitcher_roles_list, not a prefixed key.",
|
|
35
|
+
inputShape: {
|
|
36
|
+
membershipId: z.string().describe('Membership row ID (integer, required)'),
|
|
37
|
+
role: z.string().describe('Short role name, e.g. editor (required)'),
|
|
38
|
+
scope: z
|
|
39
|
+
.enum(['instance', 'organization'])
|
|
40
|
+
.optional()
|
|
41
|
+
.describe('Scope of the role assignment (default instance)'),
|
|
42
|
+
},
|
|
43
|
+
run: runMembershipsSetRole,
|
|
44
|
+
readOnly: false,
|
|
45
|
+
write: true,
|
|
46
|
+
},
|
|
47
|
+
];
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runMetadataTemplateList, runMetadataTemplateGet, runMetadataTemplateUpsert, } from '../../commands/metadataTemplate.js';
|
|
3
|
+
export const metadataTemplateTools = [
|
|
4
|
+
{
|
|
5
|
+
name: 'pitcher_metadata_template_list',
|
|
6
|
+
title: 'List metadata templates',
|
|
7
|
+
description: "List an instance's metadata-field schema(s) (metadata templates).",
|
|
8
|
+
inputShape: {
|
|
9
|
+
instanceId: z.string().describe('Instance ID (required)'),
|
|
10
|
+
page: z.number().int().optional().describe('Page number'),
|
|
11
|
+
pageSize: z.number().int().optional().describe('Page size (max 500)'),
|
|
12
|
+
},
|
|
13
|
+
run: runMetadataTemplateList,
|
|
14
|
+
readOnly: true,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'pitcher_metadata_template_get',
|
|
18
|
+
title: 'Get a metadata template',
|
|
19
|
+
description: 'Retrieve a single metadata template by its ID (ULID).',
|
|
20
|
+
inputShape: { id: z.string().describe('Metadata template ID (ULID)') },
|
|
21
|
+
run: runMetadataTemplateGet,
|
|
22
|
+
readOnly: true,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'pitcher_metadata_template_upsert',
|
|
26
|
+
title: 'Upsert a metadata template',
|
|
27
|
+
description: "Upsert an instance's metadata-field schema. Merges the incoming sections by section 'label' — a " +
|
|
28
|
+
'section whose label matches an existing one is replaced, other sections are preserved. Cannot remove ' +
|
|
29
|
+
'a section or field. Pass exactly one of sections or sectionsFile. Requires an instance- or org-admin key.',
|
|
30
|
+
inputShape: {
|
|
31
|
+
instanceId: z.string().describe('Instance ID (required)'),
|
|
32
|
+
sections: z.string().optional().describe('Sections JSON array (inline)'),
|
|
33
|
+
sectionsFile: z
|
|
34
|
+
.string()
|
|
35
|
+
.optional()
|
|
36
|
+
.describe('Path to a JSON file (on the MCP server host) with the sections array'),
|
|
37
|
+
},
|
|
38
|
+
run: runMetadataTemplateUpsert,
|
|
39
|
+
readOnly: false,
|
|
40
|
+
write: true,
|
|
41
|
+
},
|
|
42
|
+
];
|