@withpica/mcp-server 1.3.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/.claude/settings.local.json +5 -0
- package/CHANGELOG.md +1850 -0
- package/README.md +304 -0
- package/assets/fonts/GeistSans-Light.woff2 +0 -0
- package/assets/fonts/InstrumentSerif-Italic.woff2 +0 -0
- package/assets/fonts/InstrumentSerif-Regular.woff2 +0 -0
- package/dist/apps/download.d.ts +2 -0
- package/dist/apps/download.d.ts.map +1 -0
- package/dist/apps/download.js +125 -0
- package/dist/apps/download.js.map +1 -0
- package/dist/apps/generated/shared-bundle.d.ts +5 -0
- package/dist/apps/generated/shared-bundle.d.ts.map +1 -0
- package/dist/apps/generated/shared-bundle.js +7 -0
- package/dist/apps/generated/shared-bundle.js.map +1 -0
- package/dist/apps/release.d.ts +2 -0
- package/dist/apps/release.d.ts.map +1 -0
- package/dist/apps/release.js +69 -0
- package/dist/apps/release.js.map +1 -0
- package/dist/apps/shared.d.ts +15 -0
- package/dist/apps/shared.d.ts.map +1 -0
- package/dist/apps/shared.js +480 -0
- package/dist/apps/shared.js.map +1 -0
- package/dist/apps/upload.d.ts +2 -0
- package/dist/apps/upload.d.ts.map +1 -0
- package/dist/apps/upload.js +280 -0
- package/dist/apps/upload.js.map +1 -0
- package/dist/config.d.ts +14 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +73 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/index.d.ts +86 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +645 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/resources/agent-guide.d.ts +15 -0
- package/dist/resources/agent-guide.d.ts.map +1 -0
- package/dist/resources/agent-guide.js +284 -0
- package/dist/resources/agent-guide.js.map +1 -0
- package/dist/resources/index.d.ts +66 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +510 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/llms-primer.d.ts +2 -0
- package/dist/resources/llms-primer.d.ts.map +1 -0
- package/dist/resources/llms-primer.js +68 -0
- package/dist/resources/llms-primer.js.map +1 -0
- package/dist/resources/required-schemas.generated.d.ts +455 -0
- package/dist/resources/required-schemas.generated.d.ts.map +1 -0
- package/dist/resources/required-schemas.generated.js +1041 -0
- package/dist/resources/required-schemas.generated.js.map +1 -0
- package/dist/resources/required-schemas.source.d.ts +53 -0
- package/dist/resources/required-schemas.source.d.ts.map +1 -0
- package/dist/resources/required-schemas.source.js +493 -0
- package/dist/resources/required-schemas.source.js.map +1 -0
- package/dist/resources/welcome.d.ts +14 -0
- package/dist/resources/welcome.d.ts.map +1 -0
- package/dist/resources/welcome.js +26 -0
- package/dist/resources/welcome.js.map +1 -0
- package/dist/server-instructions.d.ts +60 -0
- package/dist/server-instructions.d.ts.map +1 -0
- package/dist/server-instructions.js +93 -0
- package/dist/server-instructions.js.map +1 -0
- package/dist/server.d.ts +52 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +334 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/access-simulate.d.ts +23 -0
- package/dist/tools/access-simulate.d.ts.map +1 -0
- package/dist/tools/access-simulate.js +162 -0
- package/dist/tools/access-simulate.js.map +1 -0
- package/dist/tools/agent-identity.d.ts +36 -0
- package/dist/tools/agent-identity.d.ts.map +1 -0
- package/dist/tools/agent-identity.js +274 -0
- package/dist/tools/agent-identity.js.map +1 -0
- package/dist/tools/agreement-types.d.ts +27 -0
- package/dist/tools/agreement-types.d.ts.map +1 -0
- package/dist/tools/agreement-types.js +281 -0
- package/dist/tools/agreement-types.js.map +1 -0
- package/dist/tools/agreements.d.ts +20 -0
- package/dist/tools/agreements.d.ts.map +1 -0
- package/dist/tools/agreements.js +282 -0
- package/dist/tools/agreements.js.map +1 -0
- package/dist/tools/analytics.d.ts +20 -0
- package/dist/tools/analytics.d.ts.map +1 -0
- package/dist/tools/analytics.js +130 -0
- package/dist/tools/analytics.js.map +1 -0
- package/dist/tools/app-tools.d.ts +15 -0
- package/dist/tools/app-tools.d.ts.map +1 -0
- package/dist/tools/app-tools.js +388 -0
- package/dist/tools/app-tools.js.map +1 -0
- package/dist/tools/assets.d.ts +25 -0
- package/dist/tools/assets.d.ts.map +1 -0
- package/dist/tools/assets.js +454 -0
- package/dist/tools/assets.js.map +1 -0
- package/dist/tools/audio-files.d.ts +20 -0
- package/dist/tools/audio-files.d.ts.map +1 -0
- package/dist/tools/audio-files.js +409 -0
- package/dist/tools/audio-files.js.map +1 -0
- package/dist/tools/audit.d.ts +19 -0
- package/dist/tools/audit.d.ts.map +1 -0
- package/dist/tools/audit.js +58 -0
- package/dist/tools/audit.js.map +1 -0
- package/dist/tools/auth.d.ts +22 -0
- package/dist/tools/auth.d.ts.map +1 -0
- package/dist/tools/auth.js +212 -0
- package/dist/tools/auth.js.map +1 -0
- package/dist/tools/bulk.d.ts +22 -0
- package/dist/tools/bulk.d.ts.map +1 -0
- package/dist/tools/bulk.js +164 -0
- package/dist/tools/bulk.js.map +1 -0
- package/dist/tools/calendar.d.ts +15 -0
- package/dist/tools/calendar.d.ts.map +1 -0
- package/dist/tools/calendar.js +68 -0
- package/dist/tools/calendar.js.map +1 -0
- package/dist/tools/collaborators.d.ts +21 -0
- package/dist/tools/collaborators.d.ts.map +1 -0
- package/dist/tools/collaborators.js +381 -0
- package/dist/tools/collaborators.js.map +1 -0
- package/dist/tools/comparisons.d.ts +22 -0
- package/dist/tools/comparisons.d.ts.map +1 -0
- package/dist/tools/comparisons.js +80 -0
- package/dist/tools/comparisons.js.map +1 -0
- package/dist/tools/credits.d.ts +39 -0
- package/dist/tools/credits.d.ts.map +1 -0
- package/dist/tools/credits.js +541 -0
- package/dist/tools/credits.js.map +1 -0
- package/dist/tools/custody-hints.d.ts +16 -0
- package/dist/tools/custody-hints.d.ts.map +1 -0
- package/dist/tools/custody-hints.js +27 -0
- package/dist/tools/custody-hints.js.map +1 -0
- package/dist/tools/custody.d.ts +38 -0
- package/dist/tools/custody.d.ts.map +1 -0
- package/dist/tools/custody.js +281 -0
- package/dist/tools/custody.js.map +1 -0
- package/dist/tools/dashboard.d.ts +22 -0
- package/dist/tools/dashboard.d.ts.map +1 -0
- package/dist/tools/dashboard.js +258 -0
- package/dist/tools/dashboard.js.map +1 -0
- package/dist/tools/directory.d.ts +15 -0
- package/dist/tools/directory.d.ts.map +1 -0
- package/dist/tools/directory.js +107 -0
- package/dist/tools/directory.js.map +1 -0
- package/dist/tools/discovery.d.ts +49 -0
- package/dist/tools/discovery.d.ts.map +1 -0
- package/dist/tools/discovery.js +851 -0
- package/dist/tools/discovery.js.map +1 -0
- package/dist/tools/disputes.d.ts +18 -0
- package/dist/tools/disputes.d.ts.map +1 -0
- package/dist/tools/disputes.js +62 -0
- package/dist/tools/disputes.js.map +1 -0
- package/dist/tools/documents.d.ts +15 -0
- package/dist/tools/documents.d.ts.map +1 -0
- package/dist/tools/documents.js +37 -0
- package/dist/tools/documents.js.map +1 -0
- package/dist/tools/duplicates.d.ts +25 -0
- package/dist/tools/duplicates.d.ts.map +1 -0
- package/dist/tools/duplicates.js +108 -0
- package/dist/tools/duplicates.js.map +1 -0
- package/dist/tools/enrichment.d.ts +56 -0
- package/dist/tools/enrichment.d.ts.map +1 -0
- package/dist/tools/enrichment.js +616 -0
- package/dist/tools/enrichment.js.map +1 -0
- package/dist/tools/exports.d.ts +19 -0
- package/dist/tools/exports.d.ts.map +1 -0
- package/dist/tools/exports.js +184 -0
- package/dist/tools/exports.js.map +1 -0
- package/dist/tools/feedback.d.ts +22 -0
- package/dist/tools/feedback.d.ts.map +1 -0
- package/dist/tools/feedback.js +100 -0
- package/dist/tools/feedback.js.map +1 -0
- package/dist/tools/forbidden-keywords.d.ts +62 -0
- package/dist/tools/forbidden-keywords.d.ts.map +1 -0
- package/dist/tools/forbidden-keywords.js +99 -0
- package/dist/tools/forbidden-keywords.js.map +1 -0
- package/dist/tools/gap-hints.d.ts +53 -0
- package/dist/tools/gap-hints.d.ts.map +1 -0
- package/dist/tools/gap-hints.js +245 -0
- package/dist/tools/gap-hints.js.map +1 -0
- package/dist/tools/groups.d.ts +29 -0
- package/dist/tools/groups.d.ts.map +1 -0
- package/dist/tools/groups.js +186 -0
- package/dist/tools/groups.js.map +1 -0
- package/dist/tools/import-documents.d.ts +21 -0
- package/dist/tools/import-documents.d.ts.map +1 -0
- package/dist/tools/import-documents.js +206 -0
- package/dist/tools/import-documents.js.map +1 -0
- package/dist/tools/import.d.ts +31 -0
- package/dist/tools/import.d.ts.map +1 -0
- package/dist/tools/import.js +610 -0
- package/dist/tools/import.js.map +1 -0
- package/dist/tools/index.d.ts +293 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +1182 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/integrations.d.ts +19 -0
- package/dist/tools/integrations.d.ts.map +1 -0
- package/dist/tools/integrations.js +120 -0
- package/dist/tools/integrations.js.map +1 -0
- package/dist/tools/labels.d.ts +20 -0
- package/dist/tools/labels.d.ts.map +1 -0
- package/dist/tools/labels.js +48 -0
- package/dist/tools/labels.js.map +1 -0
- package/dist/tools/licensing.d.ts +40 -0
- package/dist/tools/licensing.d.ts.map +1 -0
- package/dist/tools/licensing.js +436 -0
- package/dist/tools/licensing.js.map +1 -0
- package/dist/tools/memory.d.ts +21 -0
- package/dist/tools/memory.d.ts.map +1 -0
- package/dist/tools/memory.js +120 -0
- package/dist/tools/memory.js.map +1 -0
- package/dist/tools/metadata.d.ts +15 -0
- package/dist/tools/metadata.d.ts.map +1 -0
- package/dist/tools/metadata.js +1532 -0
- package/dist/tools/metadata.js.map +1 -0
- package/dist/tools/multimedia.d.ts +19 -0
- package/dist/tools/multimedia.d.ts.map +1 -0
- package/dist/tools/multimedia.js +371 -0
- package/dist/tools/multimedia.js.map +1 -0
- package/dist/tools/my-reported-issues.d.ts +32 -0
- package/dist/tools/my-reported-issues.d.ts.map +1 -0
- package/dist/tools/my-reported-issues.js +123 -0
- package/dist/tools/my-reported-issues.js.map +1 -0
- package/dist/tools/notes.d.ts +21 -0
- package/dist/tools/notes.d.ts.map +1 -0
- package/dist/tools/notes.js +115 -0
- package/dist/tools/notes.js.map +1 -0
- package/dist/tools/notifications.d.ts +28 -0
- package/dist/tools/notifications.d.ts.map +1 -0
- package/dist/tools/notifications.js +417 -0
- package/dist/tools/notifications.js.map +1 -0
- package/dist/tools/onboarding.d.ts +24 -0
- package/dist/tools/onboarding.d.ts.map +1 -0
- package/dist/tools/onboarding.js +81 -0
- package/dist/tools/onboarding.js.map +1 -0
- package/dist/tools/people.d.ts +254 -0
- package/dist/tools/people.d.ts.map +1 -0
- package/dist/tools/people.js +481 -0
- package/dist/tools/people.js.map +1 -0
- package/dist/tools/projects.d.ts +20 -0
- package/dist/tools/projects.d.ts.map +1 -0
- package/dist/tools/projects.js +316 -0
- package/dist/tools/projects.js.map +1 -0
- package/dist/tools/public-filter.d.ts +43 -0
- package/dist/tools/public-filter.d.ts.map +1 -0
- package/dist/tools/public-filter.js +356 -0
- package/dist/tools/public-filter.js.map +1 -0
- package/dist/tools/publishers.d.ts +30 -0
- package/dist/tools/publishers.d.ts.map +1 -0
- package/dist/tools/publishers.js +105 -0
- package/dist/tools/publishers.js.map +1 -0
- package/dist/tools/purchases.d.ts +27 -0
- package/dist/tools/purchases.d.ts.map +1 -0
- package/dist/tools/purchases.js +9 -0
- package/dist/tools/purchases.js.map +1 -0
- package/dist/tools/recording-attribution-hints.d.ts +24 -0
- package/dist/tools/recording-attribution-hints.d.ts.map +1 -0
- package/dist/tools/recording-attribution-hints.js +27 -0
- package/dist/tools/recording-attribution-hints.js.map +1 -0
- package/dist/tools/recordings.d.ts +96 -0
- package/dist/tools/recordings.d.ts.map +1 -0
- package/dist/tools/recordings.js +564 -0
- package/dist/tools/recordings.js.map +1 -0
- package/dist/tools/recovery-hints.d.ts +40 -0
- package/dist/tools/recovery-hints.d.ts.map +1 -0
- package/dist/tools/recovery-hints.js +827 -0
- package/dist/tools/recovery-hints.js.map +1 -0
- package/dist/tools/release-rich.d.ts +31 -0
- package/dist/tools/release-rich.d.ts.map +1 -0
- package/dist/tools/release-rich.js +245 -0
- package/dist/tools/release-rich.js.map +1 -0
- package/dist/tools/releases.d.ts +36 -0
- package/dist/tools/releases.d.ts.map +1 -0
- package/dist/tools/releases.js +649 -0
- package/dist/tools/releases.js.map +1 -0
- package/dist/tools/report-issue.d.ts +21 -0
- package/dist/tools/report-issue.d.ts.map +1 -0
- package/dist/tools/report-issue.js +101 -0
- package/dist/tools/report-issue.js.map +1 -0
- package/dist/tools/royalties.d.ts +23 -0
- package/dist/tools/royalties.d.ts.map +1 -0
- package/dist/tools/royalties.js +262 -0
- package/dist/tools/royalties.js.map +1 -0
- package/dist/tools/search.d.ts +30 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +115 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/send.d.ts +17 -0
- package/dist/tools/send.d.ts.map +1 -0
- package/dist/tools/send.js +188 -0
- package/dist/tools/send.js.map +1 -0
- package/dist/tools/sessions.d.ts +18 -0
- package/dist/tools/sessions.d.ts.map +1 -0
- package/dist/tools/sessions.js +153 -0
- package/dist/tools/sessions.js.map +1 -0
- package/dist/tools/settings.d.ts +23 -0
- package/dist/tools/settings.d.ts.map +1 -0
- package/dist/tools/settings.js +365 -0
- package/dist/tools/settings.js.map +1 -0
- package/dist/tools/share-links.d.ts +22 -0
- package/dist/tools/share-links.d.ts.map +1 -0
- package/dist/tools/share-links.js +188 -0
- package/dist/tools/share-links.js.map +1 -0
- package/dist/tools/signup.d.ts +26 -0
- package/dist/tools/signup.d.ts.map +1 -0
- package/dist/tools/signup.js +266 -0
- package/dist/tools/signup.js.map +1 -0
- package/dist/tools/split-sheets.d.ts +25 -0
- package/dist/tools/split-sheets.d.ts.map +1 -0
- package/dist/tools/split-sheets.js +309 -0
- package/dist/tools/split-sheets.js.map +1 -0
- package/dist/tools/storage-config.d.ts +13 -0
- package/dist/tools/storage-config.d.ts.map +1 -0
- package/dist/tools/storage-config.js +245 -0
- package/dist/tools/storage-config.js.map +1 -0
- package/dist/tools/subscription.d.ts +60 -0
- package/dist/tools/subscription.d.ts.map +1 -0
- package/dist/tools/subscription.js +440 -0
- package/dist/tools/subscription.js.map +1 -0
- package/dist/tools/sync-placements.d.ts +31 -0
- package/dist/tools/sync-placements.d.ts.map +1 -0
- package/dist/tools/sync-placements.js +431 -0
- package/dist/tools/sync-placements.js.map +1 -0
- package/dist/tools/team.d.ts +22 -0
- package/dist/tools/team.d.ts.map +1 -0
- package/dist/tools/team.js +144 -0
- package/dist/tools/team.js.map +1 -0
- package/dist/tools/telegram.d.ts +21 -0
- package/dist/tools/telegram.d.ts.map +1 -0
- package/dist/tools/telegram.js +144 -0
- package/dist/tools/telegram.js.map +1 -0
- package/dist/tools/uploads.d.ts +17 -0
- package/dist/tools/uploads.d.ts.map +1 -0
- package/dist/tools/uploads.js +165 -0
- package/dist/tools/uploads.js.map +1 -0
- package/dist/tools/works.d.ts +71 -0
- package/dist/tools/works.d.ts.map +1 -0
- package/dist/tools/works.js +694 -0
- package/dist/tools/works.js.map +1 -0
- package/package.json +54 -0
- package/scripts/build-required-schemas.ts +233 -0
- package/scripts/bundle-apps.ts +61 -0
- package/scripts/refresh-schema-mirror.ts +182 -0
- package/server.json +20 -0
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
// Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
|
|
2
|
+
import { formatAsText, formatList, formatSuccess } from "@withpica/mcp-utils";
|
|
3
|
+
import { withBillingGate } from "@withpica/mcp-utils";
|
|
4
|
+
export class SyncPlacementsTools {
|
|
5
|
+
pica;
|
|
6
|
+
constructor(pica) {
|
|
7
|
+
this.pica = pica;
|
|
8
|
+
}
|
|
9
|
+
getTools() {
|
|
10
|
+
return [
|
|
11
|
+
{
|
|
12
|
+
definition: {
|
|
13
|
+
name: "pica_sync_placements_query",
|
|
14
|
+
description: "List sync placements for the org. Filters: work_id, status, verification_status, brand, production_company, person_id, recording_id, source_license_enquiry_id, min_fee, currency. Returns up to `limit` (default 50) with cursor support via `offset`.",
|
|
15
|
+
workflows: ["sync-placement-required"],
|
|
16
|
+
inputSchema: {
|
|
17
|
+
type: "object",
|
|
18
|
+
properties: {
|
|
19
|
+
work_id: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "Filter by work id",
|
|
22
|
+
},
|
|
23
|
+
status: {
|
|
24
|
+
type: "string",
|
|
25
|
+
enum: ["licensed", "aired", "expired", "renewed", "terminated"],
|
|
26
|
+
description: "Filter by placement lifecycle status",
|
|
27
|
+
},
|
|
28
|
+
verification_status: {
|
|
29
|
+
type: "string",
|
|
30
|
+
enum: [
|
|
31
|
+
"unverified",
|
|
32
|
+
"self_attested",
|
|
33
|
+
"evidence_attached",
|
|
34
|
+
"operator_verified",
|
|
35
|
+
"disputed",
|
|
36
|
+
],
|
|
37
|
+
description: "Filter by evidence verification state",
|
|
38
|
+
},
|
|
39
|
+
brand: {
|
|
40
|
+
type: "string",
|
|
41
|
+
description: "Filter by advertiser/brand name",
|
|
42
|
+
},
|
|
43
|
+
production_company: {
|
|
44
|
+
type: "string",
|
|
45
|
+
description: "Filter by production company name",
|
|
46
|
+
},
|
|
47
|
+
person_id: {
|
|
48
|
+
type: "string",
|
|
49
|
+
description: "Filter to placements where this person is a contact (music supervisor, etc.)",
|
|
50
|
+
},
|
|
51
|
+
recording_id: {
|
|
52
|
+
type: "string",
|
|
53
|
+
description: "Filter to placements that licensed this recording",
|
|
54
|
+
},
|
|
55
|
+
source_license_enquiry_id: {
|
|
56
|
+
type: "string",
|
|
57
|
+
description: "Filter to placements that originated from this license enquiry",
|
|
58
|
+
},
|
|
59
|
+
min_fee: {
|
|
60
|
+
type: "number",
|
|
61
|
+
description: "Minimum fee_amount (pre-pagination SQL filter)",
|
|
62
|
+
},
|
|
63
|
+
currency: {
|
|
64
|
+
type: "string",
|
|
65
|
+
description: "ISO-4217 currency code (e.g. USD, GBP)",
|
|
66
|
+
},
|
|
67
|
+
limit: {
|
|
68
|
+
type: "number",
|
|
69
|
+
description: "Max results (default 50)",
|
|
70
|
+
},
|
|
71
|
+
offset: {
|
|
72
|
+
type: "number",
|
|
73
|
+
description: "Cursor offset",
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
executor: this.query.bind(this),
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
definition: {
|
|
82
|
+
name: "pica_sync_placements_inspect",
|
|
83
|
+
description: "Get one sync placement by id, including all linked recordings, evidence sources, the underlying agreement, and party rows.",
|
|
84
|
+
workflows: ["sync-placement-required"],
|
|
85
|
+
inputSchema: {
|
|
86
|
+
type: "object",
|
|
87
|
+
properties: {
|
|
88
|
+
id: {
|
|
89
|
+
type: "string",
|
|
90
|
+
description: "Sync placement id",
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
required: ["id"],
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
executor: this.inspect.bind(this),
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
definition: {
|
|
100
|
+
name: "pica_sync_placements_create",
|
|
101
|
+
description: "Create a sync placement (atomic — placement + draft sync_license agreement + at least one agreement_party + recordings + evidence sources, all in one Postgres transaction). Requires at least one entry in `contacts[]`. Empty contacts rejects with structured MISSING_CONTACT (next_tool: pica_people_query). New people can be auto-created inline by passing `person_name` instead of `person_id`.",
|
|
102
|
+
workflows: ["sync-placement-required"],
|
|
103
|
+
inputSchema: {
|
|
104
|
+
type: "object",
|
|
105
|
+
properties: {
|
|
106
|
+
work_id: {
|
|
107
|
+
type: "string",
|
|
108
|
+
description: "Work being licensed for the placement",
|
|
109
|
+
},
|
|
110
|
+
production_title: {
|
|
111
|
+
type: "string",
|
|
112
|
+
description: "The film/series/ad/game name the work is licensed into",
|
|
113
|
+
},
|
|
114
|
+
production_type: {
|
|
115
|
+
type: "string",
|
|
116
|
+
description: "Film, TV, advertising, trailer, video game, etc.",
|
|
117
|
+
},
|
|
118
|
+
brand: {
|
|
119
|
+
type: "string",
|
|
120
|
+
description: "Advertiser brand (for ad placements)",
|
|
121
|
+
},
|
|
122
|
+
production_company: {
|
|
123
|
+
type: "string",
|
|
124
|
+
description: "Production company name",
|
|
125
|
+
},
|
|
126
|
+
status: {
|
|
127
|
+
type: "string",
|
|
128
|
+
enum: ["licensed", "aired", "expired", "renewed", "terminated"],
|
|
129
|
+
description: "Initial status (default 'licensed')",
|
|
130
|
+
},
|
|
131
|
+
fee_amount: {
|
|
132
|
+
type: "number",
|
|
133
|
+
description: "Total fee in minor units of fee_currency",
|
|
134
|
+
},
|
|
135
|
+
fee_currency: {
|
|
136
|
+
type: "string",
|
|
137
|
+
description: "ISO-4217 currency code",
|
|
138
|
+
},
|
|
139
|
+
use_start_date: {
|
|
140
|
+
type: "string",
|
|
141
|
+
description: "ISO-8601 date — first day of licensed use",
|
|
142
|
+
},
|
|
143
|
+
use_end_date: {
|
|
144
|
+
type: "string",
|
|
145
|
+
description: "ISO-8601 date — last day of licensed use",
|
|
146
|
+
},
|
|
147
|
+
territory: {
|
|
148
|
+
type: "array",
|
|
149
|
+
items: { type: "string" },
|
|
150
|
+
description: "ISO-3166 country codes; ['WW'] = worldwide",
|
|
151
|
+
},
|
|
152
|
+
media_channels: {
|
|
153
|
+
type: "array",
|
|
154
|
+
items: { type: "string" },
|
|
155
|
+
description: "tv, online, theatrical, social, in-game, in-store, etc.",
|
|
156
|
+
},
|
|
157
|
+
notes: {
|
|
158
|
+
type: "string",
|
|
159
|
+
description: "Free-text notes",
|
|
160
|
+
},
|
|
161
|
+
confidentiality_level: {
|
|
162
|
+
type: "string",
|
|
163
|
+
enum: ["public", "redacted_in_public_car", "private"],
|
|
164
|
+
description: "Public-CAR redaction policy (default 'redacted_in_public_car')",
|
|
165
|
+
},
|
|
166
|
+
contacts: {
|
|
167
|
+
type: "array",
|
|
168
|
+
description: "At least one contact required. Pass `person_id` for an existing person OR `person_name` (+ optional email/company/position) to auto-create.",
|
|
169
|
+
items: {
|
|
170
|
+
type: "object",
|
|
171
|
+
properties: {
|
|
172
|
+
person_id: { type: "string" },
|
|
173
|
+
person_name: { type: "string" },
|
|
174
|
+
role: {
|
|
175
|
+
type: "string",
|
|
176
|
+
description: "music_supervisor | brand_marketing_lead | sync_agent | clearance_attorney | film_producer | director | …",
|
|
177
|
+
},
|
|
178
|
+
email: { type: "string" },
|
|
179
|
+
company: { type: "string" },
|
|
180
|
+
position: { type: "string" },
|
|
181
|
+
split_percentage: {
|
|
182
|
+
type: "number",
|
|
183
|
+
description: "Optional commission split (0–100)",
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
required: ["role"],
|
|
187
|
+
},
|
|
188
|
+
minItems: 1,
|
|
189
|
+
},
|
|
190
|
+
recordings: {
|
|
191
|
+
type: "array",
|
|
192
|
+
description: "Specific recordings being licensed under the placement (optional but typical for sync — one master per recording).",
|
|
193
|
+
items: {
|
|
194
|
+
type: "object",
|
|
195
|
+
properties: {
|
|
196
|
+
recording_id: { type: "string" },
|
|
197
|
+
role: {
|
|
198
|
+
type: "string",
|
|
199
|
+
description: "main_master | re_record | instrumental | edit | trailer_cut | …",
|
|
200
|
+
},
|
|
201
|
+
master_fee: { type: "number" },
|
|
202
|
+
master_share_licensed_pct: { type: "number" },
|
|
203
|
+
notes: { type: "string" },
|
|
204
|
+
},
|
|
205
|
+
required: ["recording_id", "role"],
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
sources: {
|
|
209
|
+
type: "array",
|
|
210
|
+
description: "Evidence sources backing the placement. Auto-advances verification_status: any 'cue_sheet'/'invoice'/'agreement_pdf'/'email'/'screenshot'/'web'/'spreadsheet_import' → evidence_attached; 'user_attestation' only → self_attested; none → unverified.",
|
|
211
|
+
items: {
|
|
212
|
+
type: "object",
|
|
213
|
+
properties: {
|
|
214
|
+
url: { type: "string" },
|
|
215
|
+
kind: {
|
|
216
|
+
type: "string",
|
|
217
|
+
enum: [
|
|
218
|
+
"user_attestation",
|
|
219
|
+
"agreement_pdf",
|
|
220
|
+
"cue_sheet",
|
|
221
|
+
"invoice",
|
|
222
|
+
"email",
|
|
223
|
+
"screenshot",
|
|
224
|
+
"web",
|
|
225
|
+
"spreadsheet_import",
|
|
226
|
+
],
|
|
227
|
+
},
|
|
228
|
+
agent_id: { type: "string" },
|
|
229
|
+
field_coverage: {
|
|
230
|
+
type: "array",
|
|
231
|
+
items: { type: "string" },
|
|
232
|
+
},
|
|
233
|
+
notes: { type: "string" },
|
|
234
|
+
},
|
|
235
|
+
required: ["url", "kind"],
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
required: ["work_id", "production_title", "contacts"],
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
executor: withBillingGate(this.pica, "sync placement creation", this.create.bind(this)),
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
definition: {
|
|
246
|
+
name: "pica_sync_placements_update",
|
|
247
|
+
description: "Patch a sync placement. Most fields are unconditional; `verification_status` (when set to 'operator_verified' or 'disputed') and `confidentiality_level` are operator-gated and will throw OPERATOR_REQUIRED for customer agents — use a soft transition like status:'terminated' for self-service retirement instead. Status transitions follow the placement state machine; illegal transitions throw INVALID_TRANSITION (inspect first to see the current state).",
|
|
248
|
+
workflows: ["sync-placement-required"],
|
|
249
|
+
inputSchema: {
|
|
250
|
+
type: "object",
|
|
251
|
+
properties: {
|
|
252
|
+
id: {
|
|
253
|
+
type: "string",
|
|
254
|
+
description: "Sync placement id",
|
|
255
|
+
},
|
|
256
|
+
status: {
|
|
257
|
+
type: "string",
|
|
258
|
+
enum: ["licensed", "aired", "expired", "renewed", "terminated"],
|
|
259
|
+
description: "Placement lifecycle status — transitions follow the sync_placement_status state machine; setting status:'terminated' is the customer-facing soft-delete path.",
|
|
260
|
+
},
|
|
261
|
+
verification_status: {
|
|
262
|
+
type: "string",
|
|
263
|
+
enum: [
|
|
264
|
+
"unverified",
|
|
265
|
+
"self_attested",
|
|
266
|
+
"evidence_attached",
|
|
267
|
+
"operator_verified",
|
|
268
|
+
"disputed",
|
|
269
|
+
],
|
|
270
|
+
description: "Evidence verification state. Operator-only when set to 'operator_verified' or 'disputed'; other values throw OPERATOR_REQUIRED for customer agents.",
|
|
271
|
+
},
|
|
272
|
+
confidentiality_level: {
|
|
273
|
+
type: "string",
|
|
274
|
+
enum: ["public", "redacted_in_public_car", "private"],
|
|
275
|
+
description: "Public-CAR redaction policy. Operator-only — changing this throws OPERATOR_REQUIRED for customer agents.",
|
|
276
|
+
},
|
|
277
|
+
production_title: {
|
|
278
|
+
type: "string",
|
|
279
|
+
description: "The film/series/ad/game name the work is licensed into",
|
|
280
|
+
},
|
|
281
|
+
production_type: {
|
|
282
|
+
type: "string",
|
|
283
|
+
description: "Film, TV, advertising, trailer, video game, etc.",
|
|
284
|
+
},
|
|
285
|
+
brand: {
|
|
286
|
+
type: "string",
|
|
287
|
+
description: "Advertiser brand (for ad placements)",
|
|
288
|
+
},
|
|
289
|
+
production_company: {
|
|
290
|
+
type: "string",
|
|
291
|
+
description: "Production company name",
|
|
292
|
+
},
|
|
293
|
+
fee_amount: {
|
|
294
|
+
type: "number",
|
|
295
|
+
description: "Total fee in minor units of fee_currency",
|
|
296
|
+
},
|
|
297
|
+
fee_currency: {
|
|
298
|
+
type: "string",
|
|
299
|
+
description: "ISO-4217 currency code",
|
|
300
|
+
},
|
|
301
|
+
use_start_date: {
|
|
302
|
+
type: "string",
|
|
303
|
+
description: "ISO-8601 date — first day of licensed use",
|
|
304
|
+
},
|
|
305
|
+
use_end_date: {
|
|
306
|
+
type: "string",
|
|
307
|
+
description: "ISO-8601 date — last day of licensed use",
|
|
308
|
+
},
|
|
309
|
+
territory: {
|
|
310
|
+
type: "array",
|
|
311
|
+
items: { type: "string" },
|
|
312
|
+
description: "ISO-3166 country codes; ['WW'] = worldwide",
|
|
313
|
+
},
|
|
314
|
+
media_channels: {
|
|
315
|
+
type: "array",
|
|
316
|
+
items: { type: "string" },
|
|
317
|
+
description: "tv, online, theatrical, social, in-game, in-store, etc.",
|
|
318
|
+
},
|
|
319
|
+
notes: {
|
|
320
|
+
type: "string",
|
|
321
|
+
description: "Free-text notes",
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
required: ["id"],
|
|
325
|
+
},
|
|
326
|
+
},
|
|
327
|
+
executor: withBillingGate(this.pica, "sync placement update", this.update.bind(this)),
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
definition: {
|
|
331
|
+
name: "pica_sync_placements_delete",
|
|
332
|
+
description: "Hard-delete a sync placement. Operator-only — customer agents will receive structured OPERATOR_REQUIRED. For self-service retirement, use pica_sync_placements_update with status:'terminated' (soft-delete). Two-step confirmation pattern: first call returns a confirmation_token; second call with the token executes the delete.",
|
|
333
|
+
workflows: ["sync-placement-required"],
|
|
334
|
+
inputSchema: {
|
|
335
|
+
type: "object",
|
|
336
|
+
properties: {
|
|
337
|
+
id: {
|
|
338
|
+
type: "string",
|
|
339
|
+
description: "Sync placement id",
|
|
340
|
+
},
|
|
341
|
+
confirmation_token: {
|
|
342
|
+
type: "string",
|
|
343
|
+
description: "Token from a prior call; required to actually execute the delete",
|
|
344
|
+
},
|
|
345
|
+
},
|
|
346
|
+
required: ["id"],
|
|
347
|
+
},
|
|
348
|
+
},
|
|
349
|
+
executor: withBillingGate(this.pica, "sync placement deletion", this.delete.bind(this)),
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
definition: {
|
|
353
|
+
name: "pica_sync_placements_cite",
|
|
354
|
+
description: "Attach an evidence source to a sync placement. Auto-recomputes verification_status — any non-attestation kind ('cue_sheet'/'invoice'/'agreement_pdf'/'email'/'screenshot'/'web'/'spreadsheet_import') advances unverified/self_attested → evidence_attached. operator_verified is sticky (only an explicit operator action exits it).",
|
|
355
|
+
workflows: ["sync-placement-required"],
|
|
356
|
+
inputSchema: {
|
|
357
|
+
type: "object",
|
|
358
|
+
properties: {
|
|
359
|
+
id: {
|
|
360
|
+
type: "string",
|
|
361
|
+
description: "Sync placement id",
|
|
362
|
+
},
|
|
363
|
+
url: {
|
|
364
|
+
type: "string",
|
|
365
|
+
description: "Evidence URL",
|
|
366
|
+
},
|
|
367
|
+
kind: {
|
|
368
|
+
type: "string",
|
|
369
|
+
enum: [
|
|
370
|
+
"user_attestation",
|
|
371
|
+
"agreement_pdf",
|
|
372
|
+
"cue_sheet",
|
|
373
|
+
"invoice",
|
|
374
|
+
"email",
|
|
375
|
+
"screenshot",
|
|
376
|
+
"web",
|
|
377
|
+
"spreadsheet_import",
|
|
378
|
+
],
|
|
379
|
+
description: "Source kind. Any non-attestation kind advances verification_status to evidence_attached on first attach.",
|
|
380
|
+
},
|
|
381
|
+
agent_id: {
|
|
382
|
+
type: "string",
|
|
383
|
+
description: "Optional agent identity that supplied the source",
|
|
384
|
+
},
|
|
385
|
+
field_coverage: {
|
|
386
|
+
type: "array",
|
|
387
|
+
items: { type: "string" },
|
|
388
|
+
description: "Which placement fields this source attests to (used for evidence attribution in exports)",
|
|
389
|
+
},
|
|
390
|
+
notes: {
|
|
391
|
+
type: "string",
|
|
392
|
+
description: "Free-text notes",
|
|
393
|
+
},
|
|
394
|
+
},
|
|
395
|
+
required: ["id", "url", "kind"],
|
|
396
|
+
},
|
|
397
|
+
},
|
|
398
|
+
executor: withBillingGate(this.pica, "sync placement evidence", this.cite.bind(this)),
|
|
399
|
+
},
|
|
400
|
+
];
|
|
401
|
+
}
|
|
402
|
+
// ── executors ──────────────────────────────────────────────────────────
|
|
403
|
+
async query(args) {
|
|
404
|
+
const result = await this.pica.syncPlacements.list(args);
|
|
405
|
+
return formatList(result.data, { total: result.total });
|
|
406
|
+
}
|
|
407
|
+
async inspect(args) {
|
|
408
|
+
const placement = await this.pica.syncPlacements.get(args.id);
|
|
409
|
+
return formatAsText(placement);
|
|
410
|
+
}
|
|
411
|
+
async create(args) {
|
|
412
|
+
const placement = await this.pica.syncPlacements.create(args);
|
|
413
|
+
return formatSuccess("Sync placement created", placement);
|
|
414
|
+
}
|
|
415
|
+
async update(args) {
|
|
416
|
+
const { id, ...patch } = args;
|
|
417
|
+
const placement = await this.pica.syncPlacements.update(id, patch);
|
|
418
|
+
return formatSuccess("Sync placement updated", placement);
|
|
419
|
+
}
|
|
420
|
+
async delete(args) {
|
|
421
|
+
const { id, confirmation_token } = args;
|
|
422
|
+
await this.pica.syncPlacements.delete(id, { confirmation_token });
|
|
423
|
+
return formatSuccess(`Sync placement ${id} deleted`);
|
|
424
|
+
}
|
|
425
|
+
async cite(args) {
|
|
426
|
+
const { id, ...source } = args;
|
|
427
|
+
const result = await this.pica.syncPlacements.addSource(id, source);
|
|
428
|
+
return formatSuccess("Evidence attached to sync placement", result);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
//# sourceMappingURL=sync-placements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-placements.js","sourceRoot":"","sources":["../../src/tools/sync-placements.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAmB7D,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,OAAO,mBAAmB;IACtB,IAAI,CAAa;IAEzB,YAAY,IAAgB;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,QAAQ;QACN,OAAO;YACL;gBACE,UAAU,EAAE;oBACV,IAAI,EAAE,4BAA4B;oBAClC,WAAW,EACT,yPAAyP;oBAC3P,SAAS,EAAE,CAAC,yBAAyB,CAAC;oBACtC,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,OAAO,EAAE;gCACP,IAAI,EAA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AM,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,EAAE,MAAa,CAAC,CAAC;QAC3E,OAAO,aAAa,CAAC,qCAAqC,EAAE,MAAM,CAAC,CAAC;IACtE,CAAC;CACF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Team Tools — manage team members via MCP
|
|
3
|
+
*
|
|
4
|
+
* Backed by REST routes: /api/admin/team/*
|
|
5
|
+
* Supports listing, viewing, inviting, updating roles, and removing team members.
|
|
6
|
+
*/
|
|
7
|
+
import { PicaClient } from "@withpica/mcp-sdk";
|
|
8
|
+
import { ToolDefinition, ToolExecutor } from "./index.js";
|
|
9
|
+
export declare class TeamTools {
|
|
10
|
+
private pica;
|
|
11
|
+
constructor(pica: PicaClient);
|
|
12
|
+
getTools(): Array<{
|
|
13
|
+
definition: ToolDefinition;
|
|
14
|
+
executor: ToolExecutor;
|
|
15
|
+
}>;
|
|
16
|
+
private listMembers;
|
|
17
|
+
private getMember;
|
|
18
|
+
private inviteMember;
|
|
19
|
+
private updateRole;
|
|
20
|
+
private removeMember;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=team.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team.d.ts","sourceRoot":"","sources":["../../src/tools/team.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAGtE,qBAAa,SAAS;IACpB,OAAO,CAAC,IAAI,CAAa;gBAEb,IAAI,EAAE,UAAU;IAI5B,QAAQ,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;YAkH3D,WAAW;YAQX,SAAS;YAKT,YAAY;YAYZ,UAAU;YAUV,YAAY;CAI3B"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
// Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
|
|
2
|
+
import { formatSuccess, formatStructuredList } from "@withpica/mcp-utils";
|
|
3
|
+
export class TeamTools {
|
|
4
|
+
pica;
|
|
5
|
+
constructor(pica) {
|
|
6
|
+
this.pica = pica;
|
|
7
|
+
}
|
|
8
|
+
getTools() {
|
|
9
|
+
return [
|
|
10
|
+
{
|
|
11
|
+
definition: {
|
|
12
|
+
name: "pica_team_list",
|
|
13
|
+
description: "List all team members with their roles, status (pending/active), and permissions. Use to answer 'who is on my team?'",
|
|
14
|
+
workflows: "infrastructure",
|
|
15
|
+
inputSchema: {
|
|
16
|
+
type: "object",
|
|
17
|
+
properties: {},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
executor: this.listMembers.bind(this),
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
definition: {
|
|
24
|
+
name: "pica_team_get",
|
|
25
|
+
description: "Get details of a specific team member by membership ID, including permissions, status, and activity.",
|
|
26
|
+
workflows: "infrastructure",
|
|
27
|
+
inputSchema: {
|
|
28
|
+
type: "object",
|
|
29
|
+
properties: {
|
|
30
|
+
id: {
|
|
31
|
+
type: "string",
|
|
32
|
+
description: "Team membership ID",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
required: ["id"],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
executor: this.getMember.bind(this),
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
definition: {
|
|
42
|
+
name: "pica_team_invite",
|
|
43
|
+
description: "Invite someone to join the team by email. Sends an invitation email. Optionally set their name and permissions.",
|
|
44
|
+
workflows: "infrastructure",
|
|
45
|
+
inputSchema: {
|
|
46
|
+
type: "object",
|
|
47
|
+
properties: {
|
|
48
|
+
email: {
|
|
49
|
+
type: "string",
|
|
50
|
+
description: "Email address of the person to invite",
|
|
51
|
+
},
|
|
52
|
+
full_name: {
|
|
53
|
+
type: "string",
|
|
54
|
+
description: "Full name of the invitee (optional)",
|
|
55
|
+
},
|
|
56
|
+
permissions: {
|
|
57
|
+
type: "object",
|
|
58
|
+
description: "Permission flags for the team member (e.g. { can_edit_works: true, can_manage_team: false })",
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
required: ["email"],
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
executor: this.inviteMember.bind(this),
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
definition: {
|
|
68
|
+
name: "pica_team_update_role",
|
|
69
|
+
description: "Update a team member's role and/or permissions. Pass the membership ID and at least one of role or permissions.",
|
|
70
|
+
workflows: "infrastructure",
|
|
71
|
+
inputSchema: {
|
|
72
|
+
type: "object",
|
|
73
|
+
properties: {
|
|
74
|
+
id: {
|
|
75
|
+
type: "string",
|
|
76
|
+
description: "Team membership ID (required).",
|
|
77
|
+
},
|
|
78
|
+
role: {
|
|
79
|
+
type: "string",
|
|
80
|
+
description: "Updated role name on team_memberships.role (e.g. 'admin', 'editor', 'viewer'). Optional — omit to leave unchanged.",
|
|
81
|
+
},
|
|
82
|
+
permissions: {
|
|
83
|
+
type: "object",
|
|
84
|
+
additionalProperties: true,
|
|
85
|
+
description: "Updated permission flags (e.g. { can_edit_works: true, can_manage_team: false }). Optional — omit to leave unchanged.",
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
required: ["id"],
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
executor: this.updateRole.bind(this),
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
definition: {
|
|
95
|
+
name: "pica_team_remove",
|
|
96
|
+
description: "Remove a team member by membership ID. This revokes their access.",
|
|
97
|
+
workflows: "infrastructure",
|
|
98
|
+
inputSchema: {
|
|
99
|
+
type: "object",
|
|
100
|
+
properties: {
|
|
101
|
+
id: {
|
|
102
|
+
type: "string",
|
|
103
|
+
description: "Team membership ID to remove",
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
required: ["id"],
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
executor: this.removeMember.bind(this),
|
|
110
|
+
},
|
|
111
|
+
];
|
|
112
|
+
}
|
|
113
|
+
async listMembers(_args) {
|
|
114
|
+
const result = await this.pica.team.list();
|
|
115
|
+
const members = Array.isArray(result)
|
|
116
|
+
? result
|
|
117
|
+
: (result?.data ?? result?.members ?? []);
|
|
118
|
+
return formatStructuredList(members, "team member");
|
|
119
|
+
}
|
|
120
|
+
async getMember(args) {
|
|
121
|
+
const member = await this.pica.team.get(args.id);
|
|
122
|
+
return formatSuccess("Team member retrieved", member?.data ?? member);
|
|
123
|
+
}
|
|
124
|
+
async inviteMember(args) {
|
|
125
|
+
const payload = { email: args.email };
|
|
126
|
+
if (args.full_name)
|
|
127
|
+
payload.full_name = args.full_name;
|
|
128
|
+
if (args.permissions)
|
|
129
|
+
payload.permissions = args.permissions;
|
|
130
|
+
const result = await this.pica.team.invite(payload);
|
|
131
|
+
return formatSuccess(`Invitation sent to ${args.email}`, result?.data ?? result);
|
|
132
|
+
}
|
|
133
|
+
async updateRole(args) {
|
|
134
|
+
const result = await this.pica.team.update(args.id, {
|
|
135
|
+
permissions: args.permissions,
|
|
136
|
+
});
|
|
137
|
+
return formatSuccess(`Permissions updated for membership ${args.id}`, result?.data ?? result);
|
|
138
|
+
}
|
|
139
|
+
async removeMember(args) {
|
|
140
|
+
await this.pica.team.remove(args.id);
|
|
141
|
+
return formatSuccess(`Team member ${args.id} removed`);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=team.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team.js","sourceRoot":"","sources":["../../src/tools/team.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAW7D,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE1E,MAAM,OAAO,SAAS;IACZ,IAAI,CAAa;IAEzB,YAAY,IAAg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M,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACrC,OAAO,aAAa,CAAC,eAAe,IAAI,CAAC,EAAE,UAAU,CAAC,CAAC;IACzD,CAAC;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Telegram Tools — MCP tools for user notification via Telegram
|
|
3
|
+
*
|
|
4
|
+
* Lets AI agents check if the user has Telegram connected and send them
|
|
5
|
+
* notifications for long-running tasks. Agents should check status first,
|
|
6
|
+
* then promise "I'll ping you on Telegram when done" if connected.
|
|
7
|
+
*/
|
|
8
|
+
import { PicaClient } from "@withpica/mcp-sdk";
|
|
9
|
+
import { ToolDefinition, ToolExecutor } from "./index.js";
|
|
10
|
+
export declare class TelegramTools {
|
|
11
|
+
private pica;
|
|
12
|
+
constructor(pica: PicaClient);
|
|
13
|
+
getTools(): Array<{
|
|
14
|
+
definition: ToolDefinition;
|
|
15
|
+
executor: ToolExecutor;
|
|
16
|
+
}>;
|
|
17
|
+
private getStatus;
|
|
18
|
+
private notifyUser;
|
|
19
|
+
private connect;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=telegram.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telegram.d.ts","sourceRoot":"","sources":["../../src/tools/telegram.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAOtE,qBAAa,aAAa;IACxB,OAAO,CAAC,IAAI,CAAa;gBAEb,IAAI,EAAE,UAAU;IAI5B,QAAQ,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;YAiE3D,SAAS;YAwBT,UAAU;YAgCV,OAAO;CAyCtB"}
|