@withpica/mcp-server 2.1.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.
Files changed (226) hide show
  1. package/README.md +305 -0
  2. package/dist/config.d.ts +34 -0
  3. package/dist/config.d.ts.map +1 -0
  4. package/dist/config.js +33 -0
  5. package/dist/config.js.map +1 -0
  6. package/dist/index.d.ts +7 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +34 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/pica-sdk.d.ts +1162 -0
  11. package/dist/pica-sdk.d.ts.map +1 -0
  12. package/dist/pica-sdk.js +1371 -0
  13. package/dist/pica-sdk.js.map +1 -0
  14. package/dist/prompts/index.d.ts +78 -0
  15. package/dist/prompts/index.d.ts.map +1 -0
  16. package/dist/prompts/index.js +513 -0
  17. package/dist/prompts/index.js.map +1 -0
  18. package/dist/resources/index.d.ts +64 -0
  19. package/dist/resources/index.d.ts.map +1 -0
  20. package/dist/resources/index.js +310 -0
  21. package/dist/resources/index.js.map +1 -0
  22. package/dist/resources/llms-primer.d.ts +2 -0
  23. package/dist/resources/llms-primer.d.ts.map +1 -0
  24. package/dist/resources/llms-primer.js +67 -0
  25. package/dist/resources/llms-primer.js.map +1 -0
  26. package/dist/server.d.ts +27 -0
  27. package/dist/server.d.ts.map +1 -0
  28. package/dist/server.js +140 -0
  29. package/dist/server.js.map +1 -0
  30. package/dist/tools/agreement-types.d.ts +37 -0
  31. package/dist/tools/agreement-types.d.ts.map +1 -0
  32. package/dist/tools/agreement-types.js +579 -0
  33. package/dist/tools/agreement-types.js.map +1 -0
  34. package/dist/tools/agreements.d.ts +21 -0
  35. package/dist/tools/agreements.d.ts.map +1 -0
  36. package/dist/tools/agreements.js +328 -0
  37. package/dist/tools/agreements.js.map +1 -0
  38. package/dist/tools/analytics.d.ts +20 -0
  39. package/dist/tools/analytics.d.ts.map +1 -0
  40. package/dist/tools/analytics.js +126 -0
  41. package/dist/tools/analytics.js.map +1 -0
  42. package/dist/tools/assets.d.ts +23 -0
  43. package/dist/tools/assets.d.ts.map +1 -0
  44. package/dist/tools/assets.js +220 -0
  45. package/dist/tools/assets.js.map +1 -0
  46. package/dist/tools/audio-files.d.ts +21 -0
  47. package/dist/tools/audio-files.d.ts.map +1 -0
  48. package/dist/tools/audio-files.js +358 -0
  49. package/dist/tools/audio-files.js.map +1 -0
  50. package/dist/tools/bulk.d.ts +16 -0
  51. package/dist/tools/bulk.d.ts.map +1 -0
  52. package/dist/tools/bulk.js +82 -0
  53. package/dist/tools/bulk.js.map +1 -0
  54. package/dist/tools/calendar.d.ts +15 -0
  55. package/dist/tools/calendar.d.ts.map +1 -0
  56. package/dist/tools/calendar.js +69 -0
  57. package/dist/tools/calendar.js.map +1 -0
  58. package/dist/tools/collaborators.d.ts +17 -0
  59. package/dist/tools/collaborators.d.ts.map +1 -0
  60. package/dist/tools/collaborators.js +133 -0
  61. package/dist/tools/collaborators.js.map +1 -0
  62. package/dist/tools/comparisons.d.ts +22 -0
  63. package/dist/tools/comparisons.d.ts.map +1 -0
  64. package/dist/tools/comparisons.js +86 -0
  65. package/dist/tools/comparisons.js.map +1 -0
  66. package/dist/tools/credits.d.ts +17 -0
  67. package/dist/tools/credits.d.ts.map +1 -0
  68. package/dist/tools/credits.js +136 -0
  69. package/dist/tools/credits.js.map +1 -0
  70. package/dist/tools/dashboard.d.ts +20 -0
  71. package/dist/tools/dashboard.d.ts.map +1 -0
  72. package/dist/tools/dashboard.js +156 -0
  73. package/dist/tools/dashboard.js.map +1 -0
  74. package/dist/tools/directory.d.ts +15 -0
  75. package/dist/tools/directory.d.ts.map +1 -0
  76. package/dist/tools/directory.js +108 -0
  77. package/dist/tools/directory.js.map +1 -0
  78. package/dist/tools/disputes.d.ts +18 -0
  79. package/dist/tools/disputes.d.ts.map +1 -0
  80. package/dist/tools/disputes.js +66 -0
  81. package/dist/tools/disputes.js.map +1 -0
  82. package/dist/tools/documents.d.ts +15 -0
  83. package/dist/tools/documents.d.ts.map +1 -0
  84. package/dist/tools/documents.js +38 -0
  85. package/dist/tools/documents.js.map +1 -0
  86. package/dist/tools/duplicates.d.ts +16 -0
  87. package/dist/tools/duplicates.d.ts.map +1 -0
  88. package/dist/tools/duplicates.js +72 -0
  89. package/dist/tools/duplicates.js.map +1 -0
  90. package/dist/tools/enrichment.d.ts +23 -0
  91. package/dist/tools/enrichment.d.ts.map +1 -0
  92. package/dist/tools/enrichment.js +207 -0
  93. package/dist/tools/enrichment.js.map +1 -0
  94. package/dist/tools/exports.d.ts +19 -0
  95. package/dist/tools/exports.d.ts.map +1 -0
  96. package/dist/tools/exports.js +155 -0
  97. package/dist/tools/exports.js.map +1 -0
  98. package/dist/tools/health.d.ts +17 -0
  99. package/dist/tools/health.d.ts.map +1 -0
  100. package/dist/tools/health.js +69 -0
  101. package/dist/tools/health.js.map +1 -0
  102. package/dist/tools/import-documents.d.ts +21 -0
  103. package/dist/tools/import-documents.d.ts.map +1 -0
  104. package/dist/tools/import-documents.js +191 -0
  105. package/dist/tools/import-documents.js.map +1 -0
  106. package/dist/tools/import.d.ts +29 -0
  107. package/dist/tools/import.d.ts.map +1 -0
  108. package/dist/tools/import.js +404 -0
  109. package/dist/tools/import.js.map +1 -0
  110. package/dist/tools/index.d.ts +48 -0
  111. package/dist/tools/index.d.ts.map +1 -0
  112. package/dist/tools/index.js +394 -0
  113. package/dist/tools/index.js.map +1 -0
  114. package/dist/tools/integrations.d.ts +15 -0
  115. package/dist/tools/integrations.d.ts.map +1 -0
  116. package/dist/tools/integrations.js +102 -0
  117. package/dist/tools/integrations.js.map +1 -0
  118. package/dist/tools/licensing.d.ts +40 -0
  119. package/dist/tools/licensing.d.ts.map +1 -0
  120. package/dist/tools/licensing.js +436 -0
  121. package/dist/tools/licensing.js.map +1 -0
  122. package/dist/tools/memory.d.ts +21 -0
  123. package/dist/tools/memory.d.ts.map +1 -0
  124. package/dist/tools/memory.js +121 -0
  125. package/dist/tools/memory.js.map +1 -0
  126. package/dist/tools/multimedia.d.ts +19 -0
  127. package/dist/tools/multimedia.d.ts.map +1 -0
  128. package/dist/tools/multimedia.js +293 -0
  129. package/dist/tools/multimedia.js.map +1 -0
  130. package/dist/tools/notes.d.ts +21 -0
  131. package/dist/tools/notes.d.ts.map +1 -0
  132. package/dist/tools/notes.js +126 -0
  133. package/dist/tools/notes.js.map +1 -0
  134. package/dist/tools/notifications.d.ts +17 -0
  135. package/dist/tools/notifications.d.ts.map +1 -0
  136. package/dist/tools/notifications.js +117 -0
  137. package/dist/tools/notifications.js.map +1 -0
  138. package/dist/tools/people.d.ts +53 -0
  139. package/dist/tools/people.d.ts.map +1 -0
  140. package/dist/tools/people.js +534 -0
  141. package/dist/tools/people.js.map +1 -0
  142. package/dist/tools/pica-score.d.ts +15 -0
  143. package/dist/tools/pica-score.d.ts.map +1 -0
  144. package/dist/tools/pica-score.js +30 -0
  145. package/dist/tools/pica-score.js.map +1 -0
  146. package/dist/tools/projects.d.ts +19 -0
  147. package/dist/tools/projects.d.ts.map +1 -0
  148. package/dist/tools/projects.js +142 -0
  149. package/dist/tools/projects.js.map +1 -0
  150. package/dist/tools/purchases.d.ts +15 -0
  151. package/dist/tools/purchases.d.ts.map +1 -0
  152. package/dist/tools/purchases.js +65 -0
  153. package/dist/tools/purchases.js.map +1 -0
  154. package/dist/tools/recordings.d.ts +41 -0
  155. package/dist/tools/recordings.d.ts.map +1 -0
  156. package/dist/tools/recordings.js +293 -0
  157. package/dist/tools/recordings.js.map +1 -0
  158. package/dist/tools/registration.d.ts +16 -0
  159. package/dist/tools/registration.d.ts.map +1 -0
  160. package/dist/tools/registration.js +52 -0
  161. package/dist/tools/registration.js.map +1 -0
  162. package/dist/tools/releases.d.ts +18 -0
  163. package/dist/tools/releases.d.ts.map +1 -0
  164. package/dist/tools/releases.js +138 -0
  165. package/dist/tools/releases.js.map +1 -0
  166. package/dist/tools/royalties.d.ts +23 -0
  167. package/dist/tools/royalties.d.ts.map +1 -0
  168. package/dist/tools/royalties.js +263 -0
  169. package/dist/tools/royalties.js.map +1 -0
  170. package/dist/tools/search.d.ts +30 -0
  171. package/dist/tools/search.d.ts.map +1 -0
  172. package/dist/tools/search.js +117 -0
  173. package/dist/tools/search.js.map +1 -0
  174. package/dist/tools/send.d.ts +18 -0
  175. package/dist/tools/send.d.ts.map +1 -0
  176. package/dist/tools/send.js +189 -0
  177. package/dist/tools/send.js.map +1 -0
  178. package/dist/tools/sessions.d.ts +18 -0
  179. package/dist/tools/sessions.d.ts.map +1 -0
  180. package/dist/tools/sessions.js +107 -0
  181. package/dist/tools/sessions.js.map +1 -0
  182. package/dist/tools/settings.d.ts +18 -0
  183. package/dist/tools/settings.d.ts.map +1 -0
  184. package/dist/tools/settings.js +98 -0
  185. package/dist/tools/settings.js.map +1 -0
  186. package/dist/tools/share-links.d.ts +19 -0
  187. package/dist/tools/share-links.d.ts.map +1 -0
  188. package/dist/tools/share-links.js +126 -0
  189. package/dist/tools/share-links.js.map +1 -0
  190. package/dist/tools/split-sheets.d.ts +24 -0
  191. package/dist/tools/split-sheets.d.ts.map +1 -0
  192. package/dist/tools/split-sheets.js +189 -0
  193. package/dist/tools/split-sheets.js.map +1 -0
  194. package/dist/tools/team.d.ts +22 -0
  195. package/dist/tools/team.d.ts.map +1 -0
  196. package/dist/tools/team.js +139 -0
  197. package/dist/tools/team.js.map +1 -0
  198. package/dist/tools/telegram.d.ts +20 -0
  199. package/dist/tools/telegram.d.ts.map +1 -0
  200. package/dist/tools/telegram.js +94 -0
  201. package/dist/tools/telegram.js.map +1 -0
  202. package/dist/tools/uploads.d.ts +17 -0
  203. package/dist/tools/uploads.d.ts.map +1 -0
  204. package/dist/tools/uploads.js +159 -0
  205. package/dist/tools/uploads.js.map +1 -0
  206. package/dist/tools/works.d.ts +53 -0
  207. package/dist/tools/works.d.ts.map +1 -0
  208. package/dist/tools/works.js +517 -0
  209. package/dist/tools/works.js.map +1 -0
  210. package/dist/utils/credit-gate.d.ts +17 -0
  211. package/dist/utils/credit-gate.d.ts.map +1 -0
  212. package/dist/utils/credit-gate.js +111 -0
  213. package/dist/utils/credit-gate.js.map +1 -0
  214. package/dist/utils/errors.d.ts +29 -0
  215. package/dist/utils/errors.d.ts.map +1 -0
  216. package/dist/utils/errors.js +114 -0
  217. package/dist/utils/errors.js.map +1 -0
  218. package/dist/utils/formatting.d.ts +63 -0
  219. package/dist/utils/formatting.d.ts.map +1 -0
  220. package/dist/utils/formatting.js +130 -0
  221. package/dist/utils/formatting.js.map +1 -0
  222. package/dist/utils/mpp.d.ts +78 -0
  223. package/dist/utils/mpp.d.ts.map +1 -0
  224. package/dist/utils/mpp.js +136 -0
  225. package/dist/utils/mpp.js.map +1 -0
  226. package/package.json +44 -0
@@ -0,0 +1,513 @@
1
+ /**
2
+ * Prompt Registry for MCP Server
3
+ * Manages pre-configured prompts for common workflows
4
+ */
5
+ export class PromptRegistry {
6
+ /**
7
+ * List all available prompts
8
+ */
9
+ listPrompts() {
10
+ return [
11
+ {
12
+ name: "analyze-catalog",
13
+ description: "Analyze the music catalog and provide insights about completeness, quality, and opportunities",
14
+ arguments: [],
15
+ },
16
+ {
17
+ name: "find-duplicates",
18
+ description: "Find potential duplicate works or people that might need merging",
19
+ arguments: [],
20
+ },
21
+ {
22
+ name: "enrich-metadata",
23
+ description: "Suggest works and people that could be enriched from external sources (ISNI, MusicBrainz)",
24
+ arguments: [],
25
+ },
26
+ {
27
+ name: "verify-works",
28
+ description: "Review unverified works and suggest which ones are ready for verification",
29
+ arguments: [],
30
+ },
31
+ {
32
+ name: "assess-catalog-health",
33
+ description: "Get the PICA Score and provide a detailed assessment of catalog health with prioritized improvement actions",
34
+ arguments: [],
35
+ },
36
+ {
37
+ name: "audit-credits",
38
+ description: "Find works with missing or incomplete credits and flag potential split issues",
39
+ arguments: [],
40
+ },
41
+ {
42
+ name: "new-catalog-setup",
43
+ description: "Get started with PICA — import your music however you like (Spotify link, spreadsheet, screenshot, or just describe your songs)",
44
+ arguments: [],
45
+ },
46
+ {
47
+ name: "close-the-loop",
48
+ description: "Check what's missing on a specific work and offer to fix each gap",
49
+ arguments: [
50
+ {
51
+ name: "work_id",
52
+ description: "The work ID to check completeness for",
53
+ required: true,
54
+ },
55
+ ],
56
+ },
57
+ {
58
+ name: "register-my-works",
59
+ description: "Check registration status across PROs and help prepare works for registration",
60
+ arguments: [],
61
+ },
62
+ {
63
+ name: "prepare-for-sync",
64
+ description: "Get your catalog sync-ready — check audio analysis, mood tags, and completeness",
65
+ arguments: [],
66
+ },
67
+ {
68
+ name: "workspace-autopilot",
69
+ description: "Assess the workspace state and route to the right workflow — use this when you first connect or don't know where to start",
70
+ arguments: [],
71
+ },
72
+ ];
73
+ }
74
+ /**
75
+ * Get a prompt by name
76
+ */
77
+ async getPrompt(name, args) {
78
+ switch (name) {
79
+ case "analyze-catalog":
80
+ return this.getAnalyzeCatalogPrompt();
81
+ case "find-duplicates":
82
+ return this.getFindDuplicatesPrompt();
83
+ case "enrich-metadata":
84
+ return this.getEnrichMetadataPrompt();
85
+ case "verify-works":
86
+ return this.getVerifyWorksPrompt();
87
+ case "assess-catalog-health":
88
+ return this.getAssessCatalogHealthPrompt();
89
+ case "audit-credits":
90
+ return this.getAuditCreditsPrompt();
91
+ case "new-catalog-setup":
92
+ return this.getNewCatalogSetupPrompt();
93
+ case "close-the-loop":
94
+ return this.getCloseTheLoopPrompt(args?.work_id);
95
+ case "register-my-works":
96
+ return this.getRegisterMyWorksPrompt();
97
+ case "prepare-for-sync":
98
+ return this.getPrepareForSyncPrompt();
99
+ case "workspace-autopilot":
100
+ return this.getWorkspaceAutopilotPrompt();
101
+ default:
102
+ throw new Error(`Prompt not found: ${name}`);
103
+ }
104
+ }
105
+ /**
106
+ * Analyze catalog prompt
107
+ */
108
+ getAnalyzeCatalogPrompt() {
109
+ return {
110
+ messages: [
111
+ {
112
+ role: "user",
113
+ content: {
114
+ type: "text",
115
+ text: `Please analyze my music catalog and provide a comprehensive report.
116
+
117
+ Use the following tools to gather data:
118
+ 1. pica_catalog_stats - Get overall statistics
119
+ 2. pica_works_list - Review works data
120
+ 3. pica_people_list - Review people data
121
+ 4. pica_recordings_list - Review recordings data
122
+
123
+ Analyze and report on:
124
+ - Overall catalog size and composition
125
+ - Data quality (missing ISWCs, ISRCs, metadata)
126
+ - Verification status (how many works are verified/unverified)
127
+ - Enrichment opportunities (people missing ISNI or MusicBrainz data)
128
+ - Completeness (works with recordings, people with credits, etc.)
129
+ - Recommendations for improvement
130
+
131
+ Please provide specific, actionable insights.`,
132
+ },
133
+ },
134
+ ],
135
+ };
136
+ }
137
+ /**
138
+ * Find duplicates prompt
139
+ */
140
+ getFindDuplicatesPrompt() {
141
+ return {
142
+ messages: [
143
+ {
144
+ role: "user",
145
+ content: {
146
+ type: "text",
147
+ text: `Please help me find potential duplicate works and people in my catalog.
148
+
149
+ Use these tools:
150
+ 1. pica_works_list - Get all works
151
+ 2. pica_people_list - Get all people
152
+
153
+ Look for:
154
+ - Works with very similar or identical titles
155
+ - People with similar names (accounting for typos, different orderings)
156
+ - Works with the same ISWC (if ISWC exists)
157
+ - People with the same email address
158
+
159
+ For each potential duplicate found:
160
+ - List the IDs and key details
161
+ - Explain why you think they might be duplicates
162
+ - Suggest whether they should be merged or kept separate
163
+
164
+ Be thorough but conservative - only flag items that have a strong likelihood of being duplicates.`,
165
+ },
166
+ },
167
+ ],
168
+ };
169
+ }
170
+ /**
171
+ * Enrich metadata prompt
172
+ */
173
+ getEnrichMetadataPrompt() {
174
+ return {
175
+ messages: [
176
+ {
177
+ role: "user",
178
+ content: {
179
+ type: "text",
180
+ text: `Please identify works and people that could benefit from metadata enrichment.
181
+
182
+ Use these tools:
183
+ 1. pica_works_list - Get all works
184
+ 2. pica_people_list - Get all people
185
+
186
+ Identify:
187
+ - People without ISNI identifiers who might have one
188
+ - People without MusicBrainz IDs who might have one
189
+ - Works missing ISWCs that could potentially be looked up
190
+ - People missing biographical information
191
+
192
+ For each enrichment opportunity:
193
+ - List the person/work details
194
+ - Explain what data is missing
195
+ - Suggest potential sources (ISNI, MusicBrainz, etc.)
196
+ - Prioritize the most impactful enrichment opportunities
197
+
198
+ Focus on people and works where enrichment would add the most value.`,
199
+ },
200
+ },
201
+ ],
202
+ };
203
+ }
204
+ /**
205
+ * Verify works prompt
206
+ */
207
+ getVerifyWorksPrompt() {
208
+ return {
209
+ messages: [
210
+ {
211
+ role: "user",
212
+ content: {
213
+ type: "text",
214
+ text: `Please review unverified works and suggest which ones are ready for verification.
215
+
216
+ Use these tools:
217
+ 1. pica_works_list with verified: false - Get unverified works
218
+ 2. pica_recordings_by_work - Check if works have recordings
219
+ 3. pica_people_list - Check for associated people/credits
220
+
221
+ For each unverified work, assess:
222
+ - Does it have complete metadata (title, type, duration)?
223
+ - Does it have an ISWC?
224
+ - Does it have associated recordings?
225
+ - Does it have proper credits/people assigned?
226
+
227
+ Categorize unverified works into:
228
+ 1. Ready to verify - Has complete information
229
+ 2. Needs minor updates - Missing 1-2 pieces of information
230
+ 3. Needs significant work - Missing multiple key fields
231
+
232
+ Provide specific recommendations for each category, including what's needed to move works forward.`,
233
+ },
234
+ },
235
+ ],
236
+ };
237
+ }
238
+ /**
239
+ * Assess catalog health prompt
240
+ */
241
+ getAssessCatalogHealthPrompt() {
242
+ return {
243
+ messages: [
244
+ {
245
+ role: "user",
246
+ content: {
247
+ type: "text",
248
+ text: `Please assess the health of my music catalog using the PICA Score.
249
+
250
+ Use these tools:
251
+ 1. pica_score_get - Get the PICA Score with pillar breakdown
252
+ 2. pica_catalog_stats - Get raw catalog statistics for additional context
253
+ 3. pica_works_list - Sample works data to understand quality
254
+
255
+ Analyze:
256
+ - The composite score and grade — is this catalog ready for commercial use?
257
+ - Each pillar (income, ownership, asset, verification) — which is weakest?
258
+ - The top actions — prioritize them by effort vs impact
259
+ - Compare pillar scores to identify the biggest gaps
260
+
261
+ Provide:
262
+ - A plain-language summary of catalog health (suitable for a non-technical stakeholder)
263
+ - The top 3 highest-impact improvements with specific steps
264
+ - An estimate of where the score could reach after those improvements
265
+ - Any urgent issues that need immediate attention (e.g., missing ownership data, unverified high-value works)`,
266
+ },
267
+ },
268
+ ],
269
+ };
270
+ }
271
+ /**
272
+ * Audit credits prompt
273
+ */
274
+ getAuditCreditsPrompt() {
275
+ return {
276
+ messages: [
277
+ {
278
+ role: "user",
279
+ content: {
280
+ type: "text",
281
+ text: `Please audit the credits across my music catalog to find gaps and issues.
282
+
283
+ Use these tools:
284
+ 1. pica_works_list - Get all works
285
+ 2. pica_credits_list - Check credits for each work (sample at least 20 works, prioritizing recent ones)
286
+ 3. pica_people_list - Cross-reference credited people
287
+
288
+ Look for:
289
+ - Works with no credits at all (no collaborators assigned)
290
+ - Works where splits don't total 100%
291
+ - Works with only one credited person (potential missing collaborators)
292
+ - People who appear in multiple works — are their roles consistent?
293
+ - Credits with generic roles (just "writer") vs specific roles ("composer", "lyricist")
294
+ - People credited on works but missing key identifiers (IPI, ISNI)
295
+
296
+ Report:
297
+ - Summary statistics (% of works with credits, average collaborators per work)
298
+ - List of works with no credits (highest priority to fix)
299
+ - List of works with potential split issues
300
+ - Recommendations for improving credit completeness
301
+ - People who should be enriched with external identifiers for royalty collection`,
302
+ },
303
+ },
304
+ ],
305
+ };
306
+ }
307
+ /**
308
+ * New catalog setup prompt — first-time onboarding
309
+ */
310
+ getNewCatalogSetupPrompt() {
311
+ return {
312
+ messages: [
313
+ {
314
+ role: "user",
315
+ content: {
316
+ type: "text",
317
+ text: `I just connected to PICA. Help me get started with my music catalog.
318
+
319
+ First, read the workspace://context resource to understand my current catalog state (is it empty or do I already have works?).
320
+
321
+ If the catalog is empty, welcome me and explain that I can get my music into PICA however I like:
322
+ 1. Paste a Spotify or Deezer link — use pica_import_streaming_link to import tracks with ISRCs, credits, and artwork automatically
323
+ 2. Share a spreadsheet or PRO statement — use pica_import_analyze to read columns and import in bulk
324
+ 3. Send a screenshot of a track listing or release — you can read it and create the works from what you see
325
+ 4. Just describe my songs — use pica_works_create to add them as we talk
326
+
327
+ Ask me what I've got and help me get started with whichever method I choose.
328
+
329
+ After importing, guide me through closing the loop on each work:
330
+ - Who wrote these songs? (pica_credits_update — add writers and set splits)
331
+ - Are there publishing details registered? (pica_enrich_work_mlc — check MLC)
332
+ - Do I have audio files to upload? (pica_audio_presigned_upload — for analysis)
333
+ - What identifiers are missing? (pica_enrichment_status — check coverage)
334
+
335
+ Don't push — let me stop whenever I want. But always let me know what the next valuable step would be.
336
+
337
+ Also check pica_integrations_status to see if Google Calendar, Spotify, Gmail, or Telegram are connected. If not, mention that they can connect services at withpica.com/admin/settings to unlock calendar sync, email search, and notifications.
338
+
339
+ If the catalog already has works, summarise what's there and ask what I'd like to do — import more, check health, or work on what's missing.
340
+
341
+ Important: I can always log in at withpica.com to see, verify, and manage everything you create. The dashboard and MCP see the same catalog.`,
342
+ },
343
+ },
344
+ ],
345
+ };
346
+ }
347
+ /**
348
+ * Close the loop — check a specific work's gaps and offer to fix each one
349
+ */
350
+ getCloseTheLoopPrompt(workId) {
351
+ const workInstruction = workId
352
+ ? `Check completeness for work ${workId} using pica_work_completeness.`
353
+ : `Ask me which work I'd like to check, or use pica_completeness_low to find works that need the most attention.`;
354
+ return {
355
+ messages: [
356
+ {
357
+ role: "user",
358
+ content: {
359
+ type: "text",
360
+ text: `Help me close the loop on a work — find what's missing and offer to fix each gap.
361
+
362
+ ${workInstruction}
363
+
364
+ For the work, check every aspect of completeness:
365
+ 1. pica_work_completeness — get the full gap analysis
366
+ 2. pica_credits_list — check if credits and splits are assigned
367
+ 3. pica_enrichment_status — check what enrichment sources have been tried
368
+
369
+ For each gap found, offer a specific action:
370
+ - Missing credits → "Want me to add writers? Who wrote this song?"
371
+ - Splits not set → "What's the split between the writers?"
372
+ - No ISWC → "Want me to check MLC for this work?" (pica_enrich_work_mlc)
373
+ - No ISRC → "Do you have a recording with an ISRC for this?"
374
+ - No audio → "Got a master recording to upload?"
375
+ - Audio not analysed → "Want me to analyse the audio for BPM, key, and mood?"
376
+ - No agreements → "Is there a publishing agreement for this work?"
377
+ - Not registered → "Want me to check registration status?" (pica_registration_coverage)
378
+
379
+ Work through each gap one at a time. Let me skip any I'm not ready for. After each fix, check if the completeness score improved.
380
+
381
+ Keep it conversational — don't list all gaps at once. Start with the most important one and work down.`,
382
+ },
383
+ },
384
+ ],
385
+ };
386
+ }
387
+ /**
388
+ * Register my works — check registration status and prepare for PRO submission
389
+ */
390
+ getRegisterMyWorksPrompt() {
391
+ return {
392
+ messages: [
393
+ {
394
+ role: "user",
395
+ content: {
396
+ type: "text",
397
+ text: `Help me check which of my works are registered and which still need registration.
398
+
399
+ Steps:
400
+ 1. pica_registration_coverage — get an overview of registration status across PROs (PRS, MCPS, PPL, MLC)
401
+ 2. For works that aren't registered, use pica_work_registration_status on a sample to understand what's blocking registration
402
+ 3. Identify common blockers:
403
+ - Missing ISWC (needed for PRS/MCPS) → suggest pica_enrich_work_mlc
404
+ - Missing ISRC (needed for PPL) → check if recordings have ISRCs
405
+ - Missing credits (needed for all) → suggest adding writers
406
+ - Missing identifiers on people (IPI needed for PRO registration) → suggest enrichment
407
+
408
+ Report:
409
+ - How many works are fully registered vs partially vs not at all
410
+ - The most common blocker and how to fix it
411
+ - Which works are closest to being registration-ready (fewest gaps)
412
+
413
+ Then offer:
414
+ - "Want me to try enriching the works missing ISWCs from MLC?"
415
+ - "Want me to export a CWR file for the works that are ready?" (pica_export_song_registration)
416
+ - "Want me to check registration status for a specific work?"
417
+
418
+ Focus on practical next steps, not just reporting.`,
419
+ },
420
+ },
421
+ ],
422
+ };
423
+ }
424
+ /**
425
+ * Workspace autopilot — assess state and route to the right workflow
426
+ */
427
+ getWorkspaceAutopilotPrompt() {
428
+ return {
429
+ messages: [
430
+ {
431
+ role: "user",
432
+ content: {
433
+ type: "text",
434
+ text: `You've just connected to a PICA workspace. Assess its current state and guide me to the most valuable next action.
435
+
436
+ Step 1 — Orient:
437
+ Read the workspace://context resource to get a snapshot of the catalog: org info, catalog size, health score, and top priorities.
438
+
439
+ Step 2 — Route based on what you find:
440
+
441
+ If the catalog is EMPTY (0 works):
442
+ → Use the new-catalog-setup workflow. Welcome me, explain how to import music (Spotify link, spreadsheet, screenshot, or just describe songs), and get started.
443
+
444
+ If the catalog has works but LOW completeness (PICA Score below 50 or many gaps):
445
+ → Use pica_completeness_low to find the works that need the most attention.
446
+ → Pick the top 3 and offer to run close-the-loop on them one at a time.
447
+ → Tell me: "Your catalog has [N] works but many have gaps. Want me to start closing the loop on the ones that need the most attention?"
448
+
449
+ If there are DUPLICATE signals (workspace context mentions duplicates):
450
+ → Use the find-duplicates workflow. Tell me how many potential duplicates exist and offer to review them.
451
+
452
+ If works are UNREGISTERED (registration coverage is low):
453
+ → Use the register-my-works workflow. Tell me how many works aren't registered and what's blocking them.
454
+
455
+ If the catalog is HEALTHY (score above 70, few gaps):
456
+ → Use assess-catalog-health for a maintenance check. Tell me: "Your catalog looks solid. Here's a quick health check and what could still improve."
457
+
458
+ If none of the above clearly applies:
459
+ → Use pica_catalog_stats and pica_score_get to give me a quick summary, then ask what I'd like to focus on.
460
+
461
+ Step 3 — Explain your routing:
462
+ Tell me WHY you chose the workflow you did, in one sentence. Example: "Your catalog has 42 works but 28 are missing credits, so let's close those gaps first."
463
+
464
+ Step 4 — Offer alternatives:
465
+ After explaining, mention 1-2 other things I could do instead. Example: "Or if you'd rather import more music first, I can help with that too."
466
+
467
+ Important: Don't run all workflows at once. Pick the single most valuable action and commit to it. You can always switch later.`,
468
+ },
469
+ },
470
+ ],
471
+ };
472
+ }
473
+ /**
474
+ * Prepare for sync — get catalog sync-ready
475
+ */
476
+ getPrepareForSyncPrompt() {
477
+ return {
478
+ messages: [
479
+ {
480
+ role: "user",
481
+ content: {
482
+ type: "text",
483
+ text: `Help me get my catalog ready for sync licensing — make sure my works are discoverable and attractive to music supervisors.
484
+
485
+ Steps:
486
+ 1. pica_catalog_stats — get an overview of the catalog
487
+ 2. pica_works_list — sample works to check what's missing for sync readiness
488
+ 3. For each work, check:
489
+ - Has audio been uploaded? (supervisors need to hear it)
490
+ - Has audio been analysed? (BPM, key, energy, mood — needed for search)
491
+ - Are mood tags and genre set? (how supervisors search)
492
+ - Is duration recorded? (supervisors filter by length)
493
+ - Are lyrics transcribed? (for lyrical content search)
494
+ - Is there a Spotify/YouTube link? (supervisors check existing presence)
495
+
496
+ Report:
497
+ - How many works have analysed audio vs unanalysed vs no audio at all
498
+ - How many have mood tags and genre vs missing
499
+ - The fastest path to sync-readiness (which works are closest)
500
+
501
+ Then offer:
502
+ - "Want me to trigger audio analysis on the tracks that have uploads but no analysis?"
503
+ - "Want me to search for sync-ready tracks you already have?" (pica_search_for_sync)
504
+ - "Want me to enrich works from Spotify to pull in genre and mood data?"
505
+
506
+ The goal is making works findable by mood, BPM, key, and energy — that's what sync supervisors search by.`,
507
+ },
508
+ },
509
+ ],
510
+ };
511
+ }
512
+ }
513
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAwBH,MAAM,OAAO,cAAc;IACzB;;OAEG;IACH,WAAW;QACT,OAAO;YACL;gBACE,IAAI,EAAE,iBAAiB;gBACvB,WAAW,EACT,+FAA+F;gBACjG,SAAS,EAAE,EAAE;aACd;YACD;gBACE,IAAI,EAAE,iBAAiB;gBACvB,WAAW,EACT,kEAAkE;gBACpE,SAAS,EAAE,EAAE;aACd;YACD;gBACE,IAAI,EAAE,iBAAiB;gBACvB,WAAW,EACT,2FAA2F;gBAC7F,SAAS,EAAE,EAAE;aACd;YACD;gBACE,IAAI,EAAE,cAAc;gBACpB,WAAW,EACT,2EAA2E;gBAC7E,SAAS,EAAE,EAAE;aACd;YACD;gBACE,IAAI,EAAE,uBAAuB;gBAC7B,WAAW,EACT,6GAA6G;gBAC/G,SAAS,EAAE,EAAE;aACd;YACD;gBACE,IAAI,EAAE,eAAe;gBACrB,WAAW,EACT,+EAA+E;gBACjF,SAAS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BACE,IAAI,EAAE,MAAM;oBACZ,OAAO,EAAE;wBACP,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gIAiC8G;qBACrH;iBACF;aACF;SACF,CAAC;IACJ,CAAC;IAED;;OAEG;IACK,uBAAuB;QAC7B,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,MAAM;oBACZ,OAAO,EAAE;wBACP,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;0GAuBwF;qBAC/F;iBACF;aACF;SACF,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Resource Registry for MCP Server
3
+ * Manages read-only data resources that AI assistants can access
4
+ */
5
+ import { PicaClient } from "../pica-sdk.js";
6
+ export interface ResourceDefinition {
7
+ uri: string;
8
+ name: string;
9
+ description: string;
10
+ mimeType: string;
11
+ }
12
+ export interface ResourceContent {
13
+ contents: Array<{
14
+ uri: string;
15
+ mimeType: string;
16
+ text: string;
17
+ }>;
18
+ }
19
+ export type ResourceResult = any;
20
+ export declare class ResourceRegistry {
21
+ private pica;
22
+ constructor(pica: PicaClient);
23
+ /**
24
+ * List all available resources
25
+ */
26
+ listResources(): ResourceDefinition[];
27
+ /**
28
+ * Read a resource by URI
29
+ */
30
+ readResource(uri: string): Promise<any>;
31
+ /**
32
+ * Get OpenAPI specification resource
33
+ */
34
+ private getOpenAPISpec;
35
+ /**
36
+ * Get works list resource
37
+ */
38
+ private getWorksList;
39
+ /**
40
+ * Get people list resource
41
+ */
42
+ private getPeopleList;
43
+ /**
44
+ * Get recordings list resource
45
+ */
46
+ private getRecordingsList;
47
+ /**
48
+ * Get catalog statistics resource
49
+ */
50
+ private getCatalogStats;
51
+ /**
52
+ * Get catalog health (PICA Score) resource
53
+ */
54
+ private getCatalogHealth;
55
+ /**
56
+ * Get workspace context resource — aggregated orientation for agents
57
+ */
58
+ private getWorkspaceContext;
59
+ /**
60
+ * Get recent events resource — webhook deliveries
61
+ */
62
+ private getRecentEvents;
63
+ }
64
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAQ5C,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,KAAK,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;CACJ;AAED,MAAM,MAAM,cAAc,GAAG,GAAG,CAAC;AAEjC,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,IAAI,CAAa;gBAEb,IAAI,EAAE,UAAU;IAI5B;;OAEG;IACH,aAAa,IAAI,kBAAkB,EAAE;IAgErC;;OAEG;IACG,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IA0C7C;;OAEG;IACH,OAAO,CAAC,cAAc;IA6BtB;;OAEG;YACW,YAAY;IA4B1B;;OAEG;YACW,aAAa;IA4B3B;;OAEG;YACW,iBAAiB;IA2B/B;;OAEG;YACW,eAAe;IAoD7B;;OAEG;YACW,gBAAgB;IAc9B;;OAEG;YACW,mBAAmB;IAcjC;;OAEG;YACW,eAAe;CAa9B"}