@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,207 @@
1
+ /**
2
+ * Enrichment Tools - MCP tools for triggering and checking enrichment
3
+ */
4
+ import { formatAsText, formatSuccess } from "../utils/formatting.js";
5
+ import { withCreditGate } from "../utils/credit-gate.js";
6
+ export class EnrichmentTools {
7
+ pica;
8
+ constructor(pica) {
9
+ this.pica = pica;
10
+ }
11
+ getTools() {
12
+ return [
13
+ {
14
+ definition: {
15
+ name: "pica_enrich_work",
16
+ description: "Trigger enrichment for a work (fetches data from MLC, MusicBrainz, etc.). " +
17
+ "→ then: pica_enrichment_status (check results), pica_work_completeness (verify improvement) Costs 1 pica credit (MLC lookup).",
18
+ inputSchema: {
19
+ type: "object",
20
+ properties: {
21
+ work_id: {
22
+ type: "string",
23
+ description: "The work ID to enrich",
24
+ },
25
+ },
26
+ required: ["work_id"],
27
+ },
28
+ },
29
+ executor: withCreditGate(this.pica, "external_mlc_lookup", "work enrichment (MLC)", this.enrichWork.bind(this)),
30
+ },
31
+ {
32
+ definition: {
33
+ name: "pica_enrich_person",
34
+ description: "Trigger enrichment for a person (fetches data from ISNI, MusicBrainz, etc.). " +
35
+ "→ then: pica_people_get_full (verify results) Costs 1 pica credit (MLC lookup). ISNI and MusicBrainz are free.",
36
+ inputSchema: {
37
+ type: "object",
38
+ properties: {
39
+ person_id: {
40
+ type: "string",
41
+ description: "The person ID to enrich",
42
+ },
43
+ },
44
+ required: ["person_id"],
45
+ },
46
+ },
47
+ executor: withCreditGate(this.pica, "external_mlc_lookup", "person enrichment", this.enrichPerson.bind(this)),
48
+ },
49
+ {
50
+ definition: {
51
+ name: "pica_enrichment_status",
52
+ description: "Check the enrichment status for a specific work (what sources have been checked, what data was found)",
53
+ inputSchema: {
54
+ type: "object",
55
+ properties: {
56
+ work_id: {
57
+ type: "string",
58
+ description: "The work ID to check",
59
+ },
60
+ },
61
+ required: ["work_id"],
62
+ },
63
+ },
64
+ executor: this.enrichmentStatus.bind(this),
65
+ },
66
+ {
67
+ definition: {
68
+ name: "pica_enrichment_candidates",
69
+ description: "Find works and people that are candidates for enrichment (missing external identifiers or metadata). " +
70
+ "→ then: pica_enrich_work (enrich a work), pica_enrich_person (enrich a person)",
71
+ inputSchema: {
72
+ type: "object",
73
+ properties: {},
74
+ },
75
+ },
76
+ executor: this.enrichmentCandidates.bind(this),
77
+ },
78
+ {
79
+ definition: {
80
+ name: "pica_enrich_work_mlc",
81
+ description: "Check MLC (Mechanical Licensing Collective) for publishing details on a work — writers, publishers, and splits. " +
82
+ "Use this when you want to find out if a work has publishing registrations. Costs 1 pica credit.",
83
+ inputSchema: {
84
+ type: "object",
85
+ properties: {
86
+ work_id: {
87
+ type: "string",
88
+ description: "The work ID to check MLC for",
89
+ },
90
+ },
91
+ required: ["work_id"],
92
+ },
93
+ },
94
+ executor: withCreditGate(this.pica, "external_mlc_lookup", "MLC lookup", this.enrichWorkMlc.bind(this)),
95
+ },
96
+ {
97
+ definition: {
98
+ name: "pica_enrich_work_musicbrainz",
99
+ description: "Look up MusicBrainz for release data, artist info, and cross-references for a work. " +
100
+ "Returns a preview of what MusicBrainz knows — use pica_enrich_work to apply changes.",
101
+ inputSchema: {
102
+ type: "object",
103
+ properties: {
104
+ work_id: {
105
+ type: "string",
106
+ description: "The work ID to look up on MusicBrainz",
107
+ },
108
+ },
109
+ required: ["work_id"],
110
+ },
111
+ },
112
+ executor: this.enrichWorkMusicBrainz.bind(this),
113
+ },
114
+ {
115
+ definition: {
116
+ name: "pica_enrich_work_discogs",
117
+ description: "Search Discogs for release data, label, format, and catalogue numbers for a work. " +
118
+ "Returns a preview of matches — use pica_enrich_work to apply changes.",
119
+ inputSchema: {
120
+ type: "object",
121
+ properties: {
122
+ work_id: {
123
+ type: "string",
124
+ description: "The work ID to search Discogs for",
125
+ },
126
+ },
127
+ required: ["work_id"],
128
+ },
129
+ },
130
+ executor: this.enrichWorkDiscogs.bind(this),
131
+ },
132
+ {
133
+ definition: {
134
+ name: "pica_enrich_work_spotify",
135
+ description: "Enrich a work from Spotify — pulls artwork, preview URLs, popularity, ISRC, label, and release date. " +
136
+ "The work must already have a spotify_track_uri linked.",
137
+ inputSchema: {
138
+ type: "object",
139
+ properties: {
140
+ work_id: {
141
+ type: "string",
142
+ description: "The work ID to enrich from Spotify",
143
+ },
144
+ },
145
+ required: ["work_id"],
146
+ },
147
+ },
148
+ executor: this.enrichWorkSpotify.bind(this),
149
+ },
150
+ {
151
+ definition: {
152
+ name: "pica_enrich_work_youtube",
153
+ description: "Enrich a work from YouTube — pulls view count, like count, channel info, and video duration. " +
154
+ "The work must already have a youtube_video_id linked.",
155
+ inputSchema: {
156
+ type: "object",
157
+ properties: {
158
+ work_id: {
159
+ type: "string",
160
+ description: "The work ID to enrich from YouTube",
161
+ },
162
+ },
163
+ required: ["work_id"],
164
+ },
165
+ },
166
+ executor: this.enrichWorkYouTube.bind(this),
167
+ },
168
+ ];
169
+ }
170
+ async enrichWork(args) {
171
+ const result = await this.pica.enrichment.enrichWork(args.work_id);
172
+ return formatSuccess(`Enrichment triggered for work ${args.work_id}`, result);
173
+ }
174
+ async enrichPerson(args) {
175
+ const result = await this.pica.enrichment.enrichPerson(args.person_id);
176
+ return formatSuccess(`Enrichment triggered for person ${args.person_id}`, result);
177
+ }
178
+ async enrichmentStatus(args) {
179
+ const result = await this.pica.enrichment.getWorkEnrichmentStatus(args.work_id);
180
+ return formatAsText(result);
181
+ }
182
+ async enrichmentCandidates(_args) {
183
+ const result = await this.pica.enrichment.getCandidates();
184
+ return formatAsText(result);
185
+ }
186
+ async enrichWorkMlc(args) {
187
+ const result = await this.pica.enrichment.enrichWorkMlc(args.work_id);
188
+ return formatSuccess(`MLC lookup complete for work ${args.work_id}`, result);
189
+ }
190
+ async enrichWorkMusicBrainz(args) {
191
+ const result = await this.pica.enrichment.enrichWorkMusicBrainz(args.work_id);
192
+ return formatAsText(result);
193
+ }
194
+ async enrichWorkDiscogs(args) {
195
+ const result = await this.pica.enrichment.enrichWorkDiscogs(args.work_id);
196
+ return formatAsText(result);
197
+ }
198
+ async enrichWorkSpotify(args) {
199
+ const result = await this.pica.enrichment.enrichWorkSpotify(args.work_id);
200
+ return formatSuccess(`Spotify enrichment complete for work ${args.work_id}`, result);
201
+ }
202
+ async enrichWorkYouTube(args) {
203
+ const result = await this.pica.enrichment.enrichWorkYouTube(args.work_id);
204
+ return formatSuccess(`YouTube enrichment complete for work ${args.work_id}`, result);
205
+ }
206
+ }
207
+ //# sourceMappingURL=enrichment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enrichment.js","sourceRoot":"","sources":["../../src/tools/enrichment.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,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,kBAAkB;oBACxB,WAAW,EACT,4EAA4E;wBAC5E,+HAA+H;oBACjI,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBAC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ClB,wCAAwC,IAAI,CAAC,OAAO,EAAE,EACtD,MAAM,CACP,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,iBAAiB,CAC7B,IAAyB;QAEzB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1E,OAAO,aAAa,CAClB,wCAAwC,IAAI,CAAC,OAAO,EAAE,EACtD,MAAM,CACP,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Export Tools - MCP tools for exporting catalog data
3
+ */
4
+ import { PicaClient } from "../pica-sdk.js";
5
+ import { ToolDefinition, ToolExecutor } from "./index.js";
6
+ export declare class ExportTools {
7
+ private pica;
8
+ constructor(pica: PicaClient);
9
+ getTools(): Array<{
10
+ definition: ToolDefinition;
11
+ executor: ToolExecutor;
12
+ }>;
13
+ private exportCatalogCsv;
14
+ private exportSongRegistration;
15
+ private exportIndustryReady;
16
+ private exportCatalogAssetReport;
17
+ private exportAiConsent;
18
+ }
19
+ //# sourceMappingURL=exports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../src/tools/exports.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAItE,qBAAa,WAAW;IACtB,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;YAuH3D,gBAAgB;YAShB,sBAAsB;YAOtB,mBAAmB;YAOnB,wBAAwB;YAqCxB,eAAe;CAS9B"}
@@ -0,0 +1,155 @@
1
+ /**
2
+ * Export Tools - MCP tools for exporting catalog data
3
+ */
4
+ import { formatAsText, formatSuccess } from "../utils/formatting.js";
5
+ import { withCreditGate } from "../utils/credit-gate.js";
6
+ export class ExportTools {
7
+ pica;
8
+ constructor(pica) {
9
+ this.pica = pica;
10
+ }
11
+ getTools() {
12
+ return [
13
+ {
14
+ definition: {
15
+ name: "pica_export_catalog_csv",
16
+ description: "Export the full works catalog as CSV data",
17
+ inputSchema: {
18
+ type: "object",
19
+ properties: {
20
+ format: {
21
+ type: "string",
22
+ enum: ["csv", "json"],
23
+ description: "Export format (default: csv)",
24
+ },
25
+ },
26
+ },
27
+ },
28
+ executor: this.exportCatalogCsv.bind(this),
29
+ },
30
+ {
31
+ definition: {
32
+ name: "pica_export_song_registration",
33
+ description: "Export catalog in song registration format (CWR-compatible) for PRO/CMO registration. Costs 1 pica credit.",
34
+ inputSchema: {
35
+ type: "object",
36
+ properties: {},
37
+ },
38
+ },
39
+ executor: withCreditGate(this.pica, "export_song_registration", "song registration export", this.exportSongRegistration.bind(this)),
40
+ },
41
+ {
42
+ definition: {
43
+ name: "pica_export_industry_ready",
44
+ description: "Export industry-ready metadata package — formatted for distribution to publishers, labels, and sync agents. Costs 1 pica credit.",
45
+ inputSchema: {
46
+ type: "object",
47
+ properties: {},
48
+ },
49
+ },
50
+ executor: withCreditGate(this.pica, "export_industry_csv", "industry-ready export", this.exportIndustryReady.bind(this)),
51
+ },
52
+ {
53
+ definition: {
54
+ name: "pica_export_catalog_asset_report",
55
+ description: "Generate a Catalog Asset Report (CAR) — a unified ZIP bundle with cover PDF, evidence folders, and integrity manifest. Maps creative portfolio data to property-lending equivalents for financial institutions, insurers, PROs, and distributors. Sections include: ownership (title deed equivalent), valuation (surveyor's report), physical assets (contents schedule), agreements (mortgage deed), catalog intelligence (condition report), and summary with equivalence map. Costs 5 pica credits. Check pica_credits_balance first.",
56
+ inputSchema: {
57
+ type: "object",
58
+ properties: {
59
+ sections: {
60
+ type: "object",
61
+ description: "Which sections to include in the export. Ownership is always included.",
62
+ properties: {
63
+ valuation: {
64
+ type: "boolean",
65
+ description: "Include earnings, audio intelligence, DSP presence, completeness scores",
66
+ },
67
+ assets: {
68
+ type: "boolean",
69
+ description: "Include physical asset register with insurance and valuations",
70
+ },
71
+ agreements: {
72
+ type: "boolean",
73
+ description: "Include agreements structure and AI consent status",
74
+ },
75
+ intelligence: {
76
+ type: "boolean",
77
+ description: "Include gap analysis, carbon footprint, diligence readiness",
78
+ },
79
+ audio: {
80
+ type: "boolean",
81
+ description: "Include audio master files (large, opt-in)",
82
+ },
83
+ },
84
+ },
85
+ },
86
+ },
87
+ },
88
+ executor: withCreditGate(this.pica, "export_catalog_asset_report", "catalog asset report", this.exportCatalogAssetReport.bind(this)),
89
+ },
90
+ {
91
+ definition: {
92
+ name: "pica_export_ai_consent",
93
+ description: "Export AI usage consent declarations for all works — " +
94
+ "shows which works are human-made, AI-assisted, or AI-generated, " +
95
+ "with contributor-level consent tracking for AI model training and licensing.",
96
+ inputSchema: {
97
+ type: "object",
98
+ properties: {},
99
+ },
100
+ },
101
+ executor: this.exportAiConsent.bind(this),
102
+ },
103
+ ];
104
+ }
105
+ async exportCatalogCsv(args) {
106
+ const result = await this.pica.exports.catalogCsv({
107
+ format: args.format,
108
+ });
109
+ return formatAsText(result);
110
+ }
111
+ async exportSongRegistration(_args) {
112
+ const result = await this.pica.exports.songRegistration();
113
+ return formatSuccess("Song registration export generated", result);
114
+ }
115
+ async exportIndustryReady(_args) {
116
+ const result = await this.pica.exports.industryReady();
117
+ return formatSuccess("Industry-ready export generated", result);
118
+ }
119
+ async exportCatalogAssetReport(args) {
120
+ const sections = {
121
+ ownership: true,
122
+ valuation: args.sections?.valuation ?? true,
123
+ assets: args.sections?.assets ?? true,
124
+ agreements: args.sections?.agreements ?? true,
125
+ intelligence: args.sections?.intelligence ?? true,
126
+ audio: args.sections?.audio ?? false,
127
+ };
128
+ const result = await this.pica.exports.catalogAssetReport({
129
+ sections,
130
+ attestation: {
131
+ signer_name: "MCP Agent",
132
+ declaration_accepted: true,
133
+ },
134
+ });
135
+ const data = result?.data ?? result;
136
+ const summary = [
137
+ `Catalog Asset Report generated`,
138
+ `Stage: ${data.stage ?? "unknown"}`,
139
+ `PICA Score: ${data.pica_score ?? "N/A"}${data.pica_grade ? ` (${data.pica_grade})` : ""}`,
140
+ `Sections: ownership${sections.valuation ? ", valuation" : ""}${sections.assets ? ", assets" : ""}${sections.agreements ? ", agreements" : ""}${sections.intelligence ? ", intelligence" : ""}${sections.audio ? ", audio" : ""}`,
141
+ data.file_size_bytes
142
+ ? `Size: ${(data.file_size_bytes / 1024).toFixed(1)} KB`
143
+ : null,
144
+ data.download_url ? `Download: ${data.download_url}` : null,
145
+ ]
146
+ .filter(Boolean)
147
+ .join("\n");
148
+ return formatSuccess(summary, data);
149
+ }
150
+ async exportAiConsent(_args) {
151
+ const result = await this.pica.exports.aiConsent();
152
+ return formatSuccess("AI consent declarations exported — shows disclosure level and training rights per work", result);
153
+ }
154
+ }
155
+ //# sourceMappingURL=exports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exports.js","sourceRoot":"","sources":["../../src/tools/exports.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,MAAM,OAAO,WAAW;IACd,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,EAAE,2CAA2C;oBACxD,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,MAAM,EAAE;gCACN,IAAI,EAAE,QAAQ;gCACd,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;gCACrB,WAAW,EAA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,CAAC,eAAe;gBAClB,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK;gBACxD,CAAC,CAAC,IAAI;YACR,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,IAAI;SAC5D;aACE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,IAAI,CAAC,CAAC;QAEd,OAAO,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC;IAEO,KAAK,CAAC,eAAe,CAC3B,KAA0B;QAE1B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;QACnD,OAAO,aAAa,CAClB,wFAAwF,EACxF,MAAM,CACP,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Health Tools - MCP tools for work health and completeness scoring
3
+ */
4
+ import { PicaClient } from "../pica-sdk.js";
5
+ import { ToolDefinition, ToolExecutor } from "./index.js";
6
+ export declare class HealthTools {
7
+ private pica;
8
+ constructor(pica: PicaClient);
9
+ getTools(): Array<{
10
+ definition: ToolDefinition;
11
+ executor: ToolExecutor;
12
+ }>;
13
+ private worksHealth;
14
+ private completenessLow;
15
+ private workCompleteness;
16
+ }
17
+ //# sourceMappingURL=health.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../src/tools/health.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAGtE,qBAAa,WAAW;IACtB,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;YAkD3D,WAAW;YAKX,eAAe;YAOf,gBAAgB;CAM/B"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Health Tools - MCP tools for work health and completeness scoring
3
+ */
4
+ import { formatAsText } from "../utils/formatting.js";
5
+ export class HealthTools {
6
+ pica;
7
+ constructor(pica) {
8
+ this.pica = pica;
9
+ }
10
+ getTools() {
11
+ return [
12
+ {
13
+ definition: {
14
+ name: "pica_works_health",
15
+ description: "Get works that need attention — missing credits, no ISWC, incomplete metadata, etc. " +
16
+ "→ then: pica_works_get_full (inspect a work), pica_work_completeness (detailed gap check)",
17
+ inputSchema: {
18
+ type: "object",
19
+ properties: {},
20
+ },
21
+ },
22
+ executor: this.worksHealth.bind(this),
23
+ },
24
+ {
25
+ definition: {
26
+ name: "pica_completeness_low",
27
+ description: "Get works with low completeness scores — works that need the most improvement. " +
28
+ "→ then: pica_work_completeness (detailed gaps), pica_works_get_full (inspect a work)",
29
+ inputSchema: {
30
+ type: "object",
31
+ properties: {},
32
+ },
33
+ },
34
+ executor: this.completenessLow.bind(this),
35
+ },
36
+ {
37
+ definition: {
38
+ name: "pica_work_completeness",
39
+ description: "Get the detailed completeness score for a specific work — shows what's missing and what's complete. " +
40
+ "→ then: pica_credits_update (fix credits), pica_enrich_work (fill identifiers), pica_audio_presigned_upload (add audio)",
41
+ inputSchema: {
42
+ type: "object",
43
+ properties: {
44
+ work_id: {
45
+ type: "string",
46
+ description: "The work ID to get completeness for",
47
+ },
48
+ },
49
+ required: ["work_id"],
50
+ },
51
+ },
52
+ executor: this.workCompleteness.bind(this),
53
+ },
54
+ ];
55
+ }
56
+ async worksHealth(_args) {
57
+ const result = await this.pica.health.getWorksHealth();
58
+ return formatAsText(result);
59
+ }
60
+ async completenessLow(_args) {
61
+ const result = await this.pica.health.getLowScoreWorks();
62
+ return formatAsText(result);
63
+ }
64
+ async workCompleteness(args) {
65
+ const result = await this.pica.health.getWorkCompleteness(args.work_id);
66
+ return formatAsText(result);
67
+ }
68
+ }
69
+ //# sourceMappingURL=health.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"health.js","sourceRoot":"","sources":["../../src/tools/health.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,MAAM,OAAO,WAAW;IACd,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,mBAAmB;oBACzB,WAAW,EACT,sFAAsF;wBACtF,2FAA2F;oBAC7F,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE,EAAE;qBACf;iBACF;gBACD,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;aACtC;YACD;gBACE,UAAU,EAAE;oBACV,IAAI,EAAE,uBAAuB;oBAC7B,WAAW,EACT,iFAAiF;wBACjF,sFAAsF;oBACxF,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE,EAAE;qBACf;iBACF;gBACD,QAAQ,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC;aAC1C;YACD;gBACE,UAAU,EAAE;oBACV,IAAI,EAAE,wBAAwB;oBAC9B,WAAW,EACT,sGAAsG;wBACtG,yHAAyH;oBAC3H,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,OAAO,EAAE;gCACP,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,qCAAqC;6BACnD;yBACF;wBACD,QAAQ,EAAE,CAAC,SAAS,CAAC;qBACtB;iBACF;gBACD,QAAQ,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC;aAC3C;SACF,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,WAAW,CAAC,KAA0B;QAClD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;QACvD,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;IAEO,KAAK,CAAC,eAAe,CAC3B,KAA0B;QAE1B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC;QACzD,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;IAEO,KAAK,CAAC,gBAAgB,CAC5B,IAAyB;QAEzB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxE,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;CACF"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Import Documents Tools - MCP tools for canonical ingestion documents
3
+ */
4
+ import { PicaClient } from "../pica-sdk.js";
5
+ import { ToolDefinition, ToolExecutor } from "./index.js";
6
+ export declare class ImportDocumentTools {
7
+ private pica;
8
+ constructor(pica: PicaClient);
9
+ /**
10
+ * Get all import document tools
11
+ */
12
+ getTools(): Array<{
13
+ definition: ToolDefinition;
14
+ executor: ToolExecutor;
15
+ }>;
16
+ private listImportDocuments;
17
+ private getImportDocument;
18
+ private ingestStatement;
19
+ private diffImportDocuments;
20
+ }
21
+ //# sourceMappingURL=import-documents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import-documents.d.ts","sourceRoot":"","sources":["../../src/tools/import-documents.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAGtE,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,IAAI,CAAa;gBAEb,IAAI,EAAE,UAAU;IAI5B;;OAEG;IACH,QAAQ,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;YAgG3D,mBAAmB;YAOnB,iBAAiB;YAkBjB,eAAe;YAgBf,mBAAmB;CA0ElC"}