@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,293 @@
1
+ /**
2
+ * Multimedia Tools - MCP tools for managing multimedia assets
3
+ */
4
+ import { formatList, formatSuccess } from "../utils/formatting.js";
5
+ export class MultimediaTools {
6
+ pica;
7
+ constructor(pica) {
8
+ this.pica = pica;
9
+ }
10
+ getTools() {
11
+ return [
12
+ {
13
+ definition: {
14
+ name: "pica_multimedia_search",
15
+ description: "Search and list multimedia assets — photos, videos, audio, YouTube, Spotify, SoundCloud. Supports filtering by type, classification, published status, and linked work or person.",
16
+ inputSchema: {
17
+ type: "object",
18
+ properties: {
19
+ query: {
20
+ type: "string",
21
+ description: "Full-text search across title, caption, and description",
22
+ },
23
+ content_type: {
24
+ type: "string",
25
+ description: "Filter by content type",
26
+ enum: [
27
+ "uploaded_photo",
28
+ "uploaded_video",
29
+ "uploaded_audio",
30
+ "youtube_video",
31
+ "spotify_track",
32
+ "soundcloud_track",
33
+ "live_performance",
34
+ ],
35
+ },
36
+ classification: {
37
+ type: "string",
38
+ description: "Filter by classification",
39
+ enum: [
40
+ "sync_placement",
41
+ "music_video",
42
+ "behind_the_scenes",
43
+ "live_performance",
44
+ "promo_material",
45
+ "album_artwork",
46
+ "studio_session",
47
+ "artist_showcase",
48
+ "general",
49
+ ],
50
+ },
51
+ is_published: {
52
+ type: "boolean",
53
+ description: "Filter by published status",
54
+ },
55
+ work_id: {
56
+ type: "string",
57
+ description: "Filter by linked work ID",
58
+ },
59
+ person_id: {
60
+ type: "string",
61
+ description: "Filter by linked person ID",
62
+ },
63
+ limit: {
64
+ type: "number",
65
+ description: "Maximum results (default: 50, max: 200)",
66
+ },
67
+ offset: {
68
+ type: "number",
69
+ description: "Pagination offset (default: 0)",
70
+ },
71
+ },
72
+ },
73
+ },
74
+ executor: this.searchMultimedia.bind(this),
75
+ },
76
+ {
77
+ definition: {
78
+ name: "pica_multimedia_create",
79
+ description: "Create a multimedia item. Use for linking external content (YouTube, Spotify, SoundCloud URLs) or registering uploaded media.",
80
+ inputSchema: {
81
+ type: "object",
82
+ properties: {
83
+ title: {
84
+ type: "string",
85
+ description: "Title of the multimedia item",
86
+ },
87
+ content_type: {
88
+ type: "string",
89
+ description: "Type of content",
90
+ enum: [
91
+ "uploaded_photo",
92
+ "uploaded_video",
93
+ "uploaded_audio",
94
+ "youtube_video",
95
+ "spotify_track",
96
+ "soundcloud_track",
97
+ "live_performance",
98
+ ],
99
+ },
100
+ url: {
101
+ type: "string",
102
+ description: "URL of the media (YouTube URL, Spotify URI, SoundCloud URL, etc.)",
103
+ },
104
+ classification: {
105
+ type: "string",
106
+ description: "Classification of the content",
107
+ enum: [
108
+ "sync_placement",
109
+ "music_video",
110
+ "behind_the_scenes",
111
+ "live_performance",
112
+ "promo_material",
113
+ "album_artwork",
114
+ "studio_session",
115
+ "artist_showcase",
116
+ "general",
117
+ ],
118
+ },
119
+ caption: {
120
+ type: "string",
121
+ description: "Caption or subtitle",
122
+ },
123
+ description: {
124
+ type: "string",
125
+ description: "Detailed description",
126
+ },
127
+ tags: {
128
+ type: "array",
129
+ description: "Tags for categorization",
130
+ items: { type: "string" },
131
+ },
132
+ },
133
+ required: ["title", "content_type"],
134
+ },
135
+ },
136
+ executor: this.createMultimedia.bind(this),
137
+ },
138
+ {
139
+ definition: {
140
+ name: "pica_multimedia_import_url",
141
+ description: "Import multimedia from an external URL — downloads the image/video and stores it in PICA. " +
142
+ "Works with any public http/https image or video URL (e.g. Spotify artwork, web images). " +
143
+ "For YouTube videos, use pica_multimedia_link_youtube instead.",
144
+ inputSchema: {
145
+ type: "object",
146
+ properties: {
147
+ url: {
148
+ type: "string",
149
+ description: "Public URL of the image or video to import",
150
+ },
151
+ title: {
152
+ type: "string",
153
+ description: "Title for the multimedia item",
154
+ },
155
+ source: {
156
+ type: "string",
157
+ description: "Source label (e.g. 'spotify', 'web', 'press_kit')",
158
+ },
159
+ work_id: {
160
+ type: "string",
161
+ description: "Optional work ID to link the imported media to",
162
+ },
163
+ },
164
+ required: ["url"],
165
+ },
166
+ },
167
+ executor: this.importFromUrl.bind(this),
168
+ },
169
+ {
170
+ definition: {
171
+ name: "pica_multimedia_link_youtube",
172
+ description: "Link a YouTube video to PICA. Creates a multimedia item with YouTube metadata " +
173
+ "(thumbnail, title, view count). Can optionally link to a work.",
174
+ inputSchema: {
175
+ type: "object",
176
+ properties: {
177
+ youtube_video_id: {
178
+ type: "string",
179
+ description: "YouTube video ID (e.g. 'dQw4w9WgXcQ' from youtube.com/watch?v=dQw4w9WgXcQ)",
180
+ },
181
+ title: {
182
+ type: "string",
183
+ description: "Title for the multimedia item",
184
+ },
185
+ classification: {
186
+ type: "string",
187
+ description: "Classification type",
188
+ enum: [
189
+ "sync_placement",
190
+ "music_video",
191
+ "behind_the_scenes",
192
+ "live_performance",
193
+ "promo_material",
194
+ "general",
195
+ ],
196
+ },
197
+ work_id: {
198
+ type: "string",
199
+ description: "Optional work ID to link the video to",
200
+ },
201
+ work_relationship_type: {
202
+ type: "string",
203
+ description: "Relationship type when linking to a work (e.g. 'music_video_for', 'sync_placement')",
204
+ },
205
+ },
206
+ required: ["youtube_video_id", "title"],
207
+ },
208
+ },
209
+ executor: this.linkYoutube.bind(this),
210
+ },
211
+ {
212
+ definition: {
213
+ name: "pica_multimedia_link_work",
214
+ description: "Link an existing multimedia item to a work. Creates a relationship between " +
215
+ "the multimedia (photo, video, audio) and a musical work.",
216
+ inputSchema: {
217
+ type: "object",
218
+ properties: {
219
+ multimedia_id: {
220
+ type: "string",
221
+ description: "The multimedia item ID",
222
+ },
223
+ work_id: {
224
+ type: "string",
225
+ description: "The work ID to link to",
226
+ },
227
+ relationship_type: {
228
+ type: "string",
229
+ description: "Type of relationship",
230
+ enum: [
231
+ "featured_in",
232
+ "music_video_for",
233
+ "cover_performance",
234
+ "album_artwork",
235
+ "behind_the_scenes",
236
+ "sync_placement",
237
+ "general",
238
+ ],
239
+ },
240
+ notes: {
241
+ type: "string",
242
+ description: "Optional notes about the relationship",
243
+ },
244
+ },
245
+ required: ["multimedia_id", "work_id", "relationship_type"],
246
+ },
247
+ },
248
+ executor: this.linkWork.bind(this),
249
+ },
250
+ ];
251
+ }
252
+ async searchMultimedia(args) {
253
+ const result = await this.pica.multimedia.search({
254
+ query: args.query,
255
+ content_type: args.content_type,
256
+ classification: args.classification,
257
+ is_published: args.is_published,
258
+ work_id: args.work_id,
259
+ person_id: args.person_id,
260
+ limit: args.limit,
261
+ offset: args.offset,
262
+ });
263
+ return formatList(result.data || [], { total: result.count || 0 });
264
+ }
265
+ async createMultimedia(args) {
266
+ const item = await this.pica.multimedia.create(args);
267
+ return formatSuccess("Multimedia item created", item);
268
+ }
269
+ async importFromUrl(args) {
270
+ const item = await this.pica.multimedia.importFromUrl({
271
+ url: args.url,
272
+ title: args.title,
273
+ source: args.source,
274
+ work_id: args.work_id,
275
+ });
276
+ return formatSuccess(`Imported from URL: "${item.title || args.url}". Multimedia ID: ${item.id}`, item);
277
+ }
278
+ async linkYoutube(args) {
279
+ const item = await this.pica.multimedia.linkYoutube({
280
+ youtube_video_id: args.youtube_video_id,
281
+ title: args.title,
282
+ classification: args.classification,
283
+ work_id: args.work_id,
284
+ work_relationship_type: args.work_relationship_type,
285
+ });
286
+ return formatSuccess(`YouTube video linked: "${item.title || args.youtube_video_id}". Multimedia ID: ${item.id}`, item);
287
+ }
288
+ async linkWork(args) {
289
+ const result = await this.pica.multimedia.linkWork(args.multimedia_id, args.work_id, args.relationship_type, args.notes);
290
+ return formatSuccess(`Multimedia ${args.multimedia_id} linked to work ${args.work_id} as "${args.relationship_type}".`, result);
291
+ }
292
+ }
293
+ //# sourceMappingURL=multimedia.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multimedia.js","sourceRoot":"","sources":["../../src/tools/multimedia.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEnE,MAAM,OAAO,eAAe;IAClB,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,wBAAwB;oBAC9B,WAAW,EACT,mLAAmL;oBACrL,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,KAAK,EAAE;gCACL,IAAI,EAAE,QAAQ;gCACd,WAAW,EACT,yDAAyD;6BAC5D;4BACD,YAAY,EAAE;gCACZ,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,wBAAwB;gCACrC,IAAI,EAAE;oCACJ,gBAAgB;oCAChB,gBAAgB;oCAChB,gBAAgB;oCAChB,eAAe;oCACf,eAAe;oCACf,kBAAkB;oCAClB,kBAAkB;iCACnB;6BACF;4BACD,cAAc,EAAE;gCACd,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,0BAA0B;gCACvC,IAAI,EAAE;oCACJ,gBAAgB;oCAChB,aAAa;oCACb,mBAAmB;oCACnB,kBAAkB;oCAClB,gBAAgB;oCAChB,eAAe;oCACf,gBAAgB;oCAChB,iBAAiB;oCACjB,SAAS;iCACV;6BACF;4BACD,YAAY,EAAE;gCACZ,IAAI,EAAE,SAAS;gCACf,WAAW,EAA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AAE,EAC3E,IAAI,CACL,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,WAAW,CAAC,IAAyB;QACjD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;YAClD,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;YACvC,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,sBAAsB,EAAE,IAAI,CAAC,sBAAsB;SACpD,CAAC,CAAC;QACH,OAAO,aAAa,CAClB,0BAA0B,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,gBAAgB,qBAAqB,IAAI,CAAC,EAAE,EAAE,EAC3F,IAAI,CACL,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,QAAQ,CAAC,IAAyB;QAC9C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAChD,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,iBAAiB,EACtB,IAAI,CAAC,KAAK,CACX,CAAC;QACF,OAAO,aAAa,CAClB,cAAc,IAAI,CAAC,aAAa,mBAAmB,IAAI,CAAC,OAAO,QAAQ,IAAI,CAAC,iBAAiB,IAAI,EACjG,MAAM,CACP,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Notes Tools — add and manage notes on works, people, and general catalog observations
3
+ *
4
+ * Backed by the assistant_memory system (type: "note") via REST routes (/api/admin/notes/*).
5
+ * Notes support auto-linking to works and people mentioned in the text via Tier 1 extraction.
6
+ */
7
+ import { PicaClient } from "../pica-sdk.js";
8
+ import { ToolDefinition, ToolExecutor } from "./index.js";
9
+ export declare class NotesTools {
10
+ private pica;
11
+ constructor(pica: PicaClient);
12
+ getTools(): Array<{
13
+ definition: ToolDefinition;
14
+ executor: ToolExecutor;
15
+ }>;
16
+ private listNotes;
17
+ private getNote;
18
+ private createNote;
19
+ private deleteNote;
20
+ }
21
+ //# sourceMappingURL=notes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notes.d.ts","sourceRoot":"","sources":["../../src/tools/notes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAGtE,qBAAa,UAAU;IACrB,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;YA2F3D,SAAS;YAWT,OAAO;YAKP,UAAU;YAQV,UAAU;CAIzB"}
@@ -0,0 +1,126 @@
1
+ /**
2
+ * Notes Tools — add and manage notes on works, people, and general catalog observations
3
+ *
4
+ * Backed by the assistant_memory system (type: "note") via REST routes (/api/admin/notes/*).
5
+ * Notes support auto-linking to works and people mentioned in the text via Tier 1 extraction.
6
+ */
7
+ import { formatSuccess, formatStructuredList } from "../utils/formatting.js";
8
+ export class NotesTools {
9
+ pica;
10
+ constructor(pica) {
11
+ this.pica = pica;
12
+ }
13
+ getTools() {
14
+ return [
15
+ {
16
+ definition: {
17
+ name: "pica_notes_list",
18
+ description: "List notes — filter by search query, linked work, or linked person. Notes can be attached to works, people, or stand alone.",
19
+ inputSchema: {
20
+ type: "object",
21
+ properties: {
22
+ q: {
23
+ type: "string",
24
+ description: "Search notes by content or title",
25
+ },
26
+ work_id: {
27
+ type: "string",
28
+ description: "Filter notes linked to a specific work",
29
+ },
30
+ person_id: {
31
+ type: "string",
32
+ description: "Filter notes linked to a specific person",
33
+ },
34
+ limit: {
35
+ type: "number",
36
+ description: "Max results (default 20)",
37
+ },
38
+ },
39
+ },
40
+ },
41
+ executor: this.listNotes.bind(this),
42
+ },
43
+ {
44
+ definition: {
45
+ name: "pica_notes_get",
46
+ description: "Get a specific note by ID.",
47
+ inputSchema: {
48
+ type: "object",
49
+ properties: {
50
+ id: { type: "string", description: "Note ID" },
51
+ },
52
+ required: ["id"],
53
+ },
54
+ },
55
+ executor: this.getNote.bind(this),
56
+ },
57
+ {
58
+ definition: {
59
+ name: "pica_notes_create",
60
+ description: "Add a note to the catalog. Notes can be linked to specific works or people, or stand alone as general observations. PICA auto-detects mentions of works and people in the note text.",
61
+ inputSchema: {
62
+ type: "object",
63
+ properties: {
64
+ content: {
65
+ type: "string",
66
+ description: "The note text. Can mention work titles or people names — PICA will auto-link them.",
67
+ },
68
+ work_ids: {
69
+ type: "array",
70
+ items: { type: "string" },
71
+ description: "Optional: explicitly link to these work IDs",
72
+ },
73
+ people_ids: {
74
+ type: "array",
75
+ items: { type: "string" },
76
+ description: "Optional: explicitly link to these person IDs",
77
+ },
78
+ },
79
+ required: ["content"],
80
+ },
81
+ },
82
+ executor: this.createNote.bind(this),
83
+ },
84
+ {
85
+ definition: {
86
+ name: "pica_notes_delete",
87
+ description: "Delete a note.",
88
+ inputSchema: {
89
+ type: "object",
90
+ properties: {
91
+ id: { type: "string", description: "Note ID to delete" },
92
+ },
93
+ required: ["id"],
94
+ },
95
+ },
96
+ executor: this.deleteNote.bind(this),
97
+ },
98
+ ];
99
+ }
100
+ async listNotes(args) {
101
+ const result = await this.pica.notes.list({
102
+ q: args.q,
103
+ work: args.work_id,
104
+ person: args.person_id,
105
+ limit: args.limit,
106
+ });
107
+ const notes = Array.isArray(result) ? result : [];
108
+ return formatStructuredList(notes, "note");
109
+ }
110
+ async getNote(args) {
111
+ const note = await this.pica.notes.get(args.id);
112
+ return formatSuccess("Note retrieved", note);
113
+ }
114
+ async createNote(args) {
115
+ const note = await this.pica.notes.create(args.content, {
116
+ work_ids: args.work_ids,
117
+ people_ids: args.people_ids,
118
+ });
119
+ return formatSuccess("Note added", note);
120
+ }
121
+ async deleteNote(args) {
122
+ await this.pica.notes.delete(args.id);
123
+ return formatSuccess(`Note ${args.id} deleted`);
124
+ }
125
+ }
126
+ //# sourceMappingURL=notes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notes.js","sourceRoot":"","sources":["../../src/tools/notes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE7E,MAAM,OAAO,UAAU;IACb,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,iBAAiB;oBACvB,WAAW,EACT,6HAA6H;oBAC/H,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,CAAC,EAAE;gCACD,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,kCAAkC;6BAChD;4BACD,OAAO,EAAE;gCACP,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,wCAAwC;6BACtD;4BACD,SAAS,EAAE;gCACT,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,0CAA0C;6BACxD;4BACD,KAAK,EAAE;gCACL,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,0BAA0B;6BACxC;yBACF;qBACF;iBACF;gBACD,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;aACpC;YACD;gBACE,UAAU,EAAE;oBACV,IAAI,EAAE,gBAAgB;oBACtB,WAAW,EAAE,4BAA4B;oBACzC,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE;yBAC/C;wBACD,QAAQ,EAAE,CAAC,IAAI,CAAC;qBACjB;iBACF;gBACD,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MAAM,EAAE,IAAI,CAAC,SAAS;YACtB,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC,CAAC;QACH,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;QAClD,OAAO,oBAAoB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC7C,CAAC;IAEO,KAAK,CAAC,OAAO,CAAC,IAAyB;QAC7C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAChD,OAAO,aAAa,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;IAC/C,CAAC;IAEO,KAAK,CAAC,UAAU,CAAC,IAAyB;QAChD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE;YACtD,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC,CAAC;QACH,OAAO,aAAa,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAC3C,CAAC;IAEO,KAAK,CAAC,UAAU,CAAC,IAAyB;QAChD,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACtC,OAAO,aAAa,CAAC,QAAQ,IAAI,CAAC,EAAE,UAAU,CAAC,CAAC;IAClD,CAAC;CACF"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Notifications Tools — check and manage PICA notifications via MCP
3
+ */
4
+ import { PicaClient } from "../pica-sdk.js";
5
+ import { ToolDefinition, ToolExecutor } from "./index.js";
6
+ export declare class NotificationsTools {
7
+ private pica;
8
+ constructor(pica: PicaClient);
9
+ getTools(): Array<{
10
+ definition: ToolDefinition;
11
+ executor: ToolExecutor;
12
+ }>;
13
+ private listNotifications;
14
+ private notifyPerson;
15
+ private markRead;
16
+ }
17
+ //# sourceMappingURL=notifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../src/tools/notifications.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAQtE,qBAAa,kBAAkB;IAC7B,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;YAoE3D,iBAAiB;YAcjB,YAAY;YAmCZ,QAAQ;CAOvB"}
@@ -0,0 +1,117 @@
1
+ /**
2
+ * Notifications Tools — check and manage PICA notifications via MCP
3
+ */
4
+ import { formatAsText, formatSuccess, formatStructuredList, formatValidationError, } from "../utils/formatting.js";
5
+ export class NotificationsTools {
6
+ pica;
7
+ constructor(pica) {
8
+ this.pica = pica;
9
+ }
10
+ getTools() {
11
+ return [
12
+ {
13
+ definition: {
14
+ name: "pica_notifications_list",
15
+ description: "Check for notifications from PICA — new collaborator invites, " +
16
+ "enrichment results, verification requests, credit disputes, " +
17
+ "and other flagged items that need attention.",
18
+ inputSchema: {
19
+ type: "object",
20
+ properties: {},
21
+ },
22
+ },
23
+ executor: this.listNotifications.bind(this),
24
+ },
25
+ {
26
+ definition: {
27
+ name: "pica_notify_person",
28
+ description: "Send a notification to a person in the catalog. If the person has a PICA account, " +
29
+ "they get an in-app notification + Telegram message (if connected). " +
30
+ "If they're not a PICA user yet, returns a hint to use pica_collaborators_invite instead. " +
31
+ "Use for credit verification requests, song updates, or any message to a collaborator.",
32
+ inputSchema: {
33
+ type: "object",
34
+ properties: {
35
+ person_id: {
36
+ type: "string",
37
+ description: "The person's ID in your catalog",
38
+ },
39
+ message: {
40
+ type: "string",
41
+ description: "What to tell them (e.g. 'please verify your writing credit on Midnight Run')",
42
+ },
43
+ work_id: {
44
+ type: "string",
45
+ description: "Optional work ID for context — links the notification to a specific work",
46
+ },
47
+ },
48
+ required: ["person_id", "message"],
49
+ },
50
+ },
51
+ executor: this.notifyPerson.bind(this),
52
+ },
53
+ {
54
+ definition: {
55
+ name: "pica_notifications_mark_read",
56
+ description: "Mark one or more notifications as read.",
57
+ inputSchema: {
58
+ type: "object",
59
+ properties: {
60
+ notification_ids: {
61
+ type: "array",
62
+ items: { type: "string" },
63
+ description: "IDs of notifications to mark as read",
64
+ },
65
+ },
66
+ required: ["notification_ids"],
67
+ },
68
+ },
69
+ executor: this.markRead.bind(this),
70
+ },
71
+ ];
72
+ }
73
+ async listNotifications(_args) {
74
+ const result = await this.pica.notifications.list();
75
+ const notifications = result?.notifications || result || [];
76
+ const items = Array.isArray(notifications) ? notifications : [];
77
+ const unread = items.filter((n) => !n.read_at);
78
+ return formatStructuredList(items, "notification", {
79
+ total: items.length,
80
+ unread: unread.length,
81
+ });
82
+ }
83
+ async notifyPerson(args) {
84
+ if (!args.person_id?.trim()) {
85
+ return formatValidationError({ person_id: "person_id is required" });
86
+ }
87
+ if (!args.message?.trim()) {
88
+ return formatValidationError({ message: "message is required" });
89
+ }
90
+ const result = await this.pica.notifications.sendToPerson({
91
+ person_id: args.person_id,
92
+ message: args.message,
93
+ work_id: args.work_id,
94
+ });
95
+ const data = result.data || result;
96
+ if (!data.delivered) {
97
+ return formatAsText({
98
+ delivered: false,
99
+ person_name: data.person_name,
100
+ reason: data.reason,
101
+ hint: data.hint,
102
+ });
103
+ }
104
+ const channels = [];
105
+ if (data.channels?.in_app)
106
+ channels.push("in-app");
107
+ if (data.channels?.telegram)
108
+ channels.push("Telegram");
109
+ return formatSuccess(`Notified ${data.person_name} via ${channels.join(" + ")}`, data);
110
+ }
111
+ async markRead(args) {
112
+ const ids = args.notification_ids;
113
+ await this.pica.notifications.markRead(ids);
114
+ return formatSuccess(`Marked ${ids.length} notification${ids.length !== 1 ? "s" : ""} as read`);
115
+ }
116
+ }
117
+ //# sourceMappingURL=notifications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notifications.js","sourceRoot":"","sources":["../../src/tools/notifications.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EACL,YAAY,EACZ,aAAa,EACb,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,OAAO,kBAAkB;IACrB,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,yBAAyB;oBAC/B,WAAW,EACT,gEAAgE;wBAChE,8DAA8D;wBAC9D,8CAA8C;oBAChD,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE,EAAE;qBACf;iBACF;gBACD,QAAQ,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC;aAC5C;YACD;gBACE,UAAU,EAAE;oBACV,IAAI,EAAE,oBAAoB;oBAC1B,WAAW,EACT,oFAAoF;wBACpF,qEAAqE;wBACrE,2FAA2F;wBAC3F,uFAAuF;oBACzF,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,SAAS,EAAE;gCACT,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,iCAAiC;6BAC/C;4BACD,OAAO,EAAE;gCACP,IAAI,EAAE,QAAQ;gCACd,WAAW,EACT,8EAA8E;6BACjF;4BACD,OAAO,EAAE;gCACP,IAAI,EAAE,QAAQ;gCACd,WAAW,EACT,0EAA0E;6BAC7E;yBACF;wBACD,QAAQ,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC;qBACnC;iBACF;g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,aAAa,CAClB,UAAU,GAAG,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,UAAU,CAC1E,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * People Tools - MCP tools for managing people (artists, composers, etc.)
3
+ */
4
+ import { PicaClient } from "../pica-sdk.js";
5
+ import { ToolDefinition, ToolExecutor } from "./index.js";
6
+ export declare class PeopleTools {
7
+ private pica;
8
+ constructor(pica: PicaClient);
9
+ /**
10
+ * Get all people tools
11
+ */
12
+ getTools(): Array<{
13
+ definition: ToolDefinition;
14
+ executor: ToolExecutor;
15
+ }>;
16
+ /**
17
+ * List people
18
+ */
19
+ private listPeople;
20
+ /**
21
+ * Get person by ID
22
+ */
23
+ private getPerson;
24
+ /**
25
+ * Create person
26
+ */
27
+ private createPerson;
28
+ /**
29
+ * Update person
30
+ */
31
+ private updatePerson;
32
+ /**
33
+ * Delete person
34
+ */
35
+ private deletePerson;
36
+ /**
37
+ * Search people
38
+ */
39
+ private searchPeople;
40
+ /**
41
+ * Enrich from ISNI
42
+ */
43
+ private enrichFromISNI;
44
+ /**
45
+ * Enrich from MusicBrainz
46
+ */
47
+ private enrichFromMusicBrainz;
48
+ /**
49
+ * Get full person context bundle
50
+ */
51
+ private getPersonFull;
52
+ }
53
+ //# sourceMappingURL=people.d.ts.map