@withpica/mcp-server 2.7.0 → 2.8.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 (251) hide show
  1. package/dist/__mocks__/mppx-mcp-sdk-server.d.ts +6 -0
  2. package/dist/__mocks__/mppx-mcp-sdk-server.d.ts.map +1 -0
  3. package/dist/__mocks__/mppx-mcp-sdk-server.js +6 -0
  4. package/dist/__mocks__/mppx-mcp-sdk-server.js.map +1 -0
  5. package/dist/__mocks__/mppx-server.d.ts +12 -0
  6. package/dist/__mocks__/mppx-server.d.ts.map +1 -0
  7. package/dist/__mocks__/mppx-server.js +12 -0
  8. package/dist/__mocks__/mppx-server.js.map +1 -0
  9. package/dist/apps/download.d.ts +2 -0
  10. package/dist/apps/download.d.ts.map +1 -0
  11. package/dist/apps/download.js +125 -0
  12. package/dist/apps/download.js.map +1 -0
  13. package/dist/apps/generated/shared-bundle.d.ts +5 -0
  14. package/dist/apps/generated/shared-bundle.d.ts.map +1 -0
  15. package/dist/apps/generated/shared-bundle.js +7 -0
  16. package/dist/apps/generated/shared-bundle.js.map +1 -0
  17. package/dist/apps/shared.d.ts +15 -0
  18. package/dist/apps/shared.d.ts.map +1 -0
  19. package/dist/apps/shared.js +480 -0
  20. package/dist/apps/shared.js.map +1 -0
  21. package/dist/apps/upload.d.ts +2 -0
  22. package/dist/apps/upload.d.ts.map +1 -0
  23. package/dist/apps/upload.js +280 -0
  24. package/dist/apps/upload.js.map +1 -0
  25. package/dist/config.d.ts +4 -25
  26. package/dist/config.d.ts.map +1 -1
  27. package/dist/config.js +36 -12
  28. package/dist/config.js.map +1 -1
  29. package/dist/index.d.ts +1 -1
  30. package/dist/index.js +3 -3
  31. package/dist/index.js.map +1 -1
  32. package/dist/prompts/index.d.ts +64 -64
  33. package/dist/prompts/index.js +24 -24
  34. package/dist/prompts/index.js.map +1 -1
  35. package/dist/resources/index.d.ts +55 -53
  36. package/dist/resources/index.d.ts.map +1 -1
  37. package/dist/resources/index.js +133 -54
  38. package/dist/resources/index.js.map +1 -1
  39. package/dist/resources/llms-primer.d.ts +2 -0
  40. package/dist/resources/llms-primer.d.ts.map +1 -0
  41. package/dist/resources/llms-primer.js +68 -0
  42. package/dist/resources/llms-primer.js.map +1 -0
  43. package/dist/server-instructions.d.ts +9 -0
  44. package/dist/server-instructions.d.ts.map +1 -0
  45. package/dist/server-instructions.js +34 -0
  46. package/dist/server-instructions.js.map +1 -0
  47. package/dist/server.d.ts +49 -32
  48. package/dist/server.d.ts.map +1 -1
  49. package/dist/server.js +103 -14
  50. package/dist/server.js.map +1 -1
  51. package/dist/tools/agreement-types.d.ts +27 -0
  52. package/dist/tools/agreement-types.d.ts.map +1 -0
  53. package/dist/tools/agreement-types.js +387 -0
  54. package/dist/tools/agreement-types.js.map +1 -0
  55. package/dist/tools/agreements.d.ts +20 -0
  56. package/dist/tools/agreements.d.ts.map +1 -0
  57. package/dist/tools/agreements.js +363 -0
  58. package/dist/tools/agreements.js.map +1 -0
  59. package/dist/tools/analytics.d.ts +20 -0
  60. package/dist/tools/analytics.d.ts.map +1 -0
  61. package/dist/tools/analytics.js +124 -0
  62. package/dist/tools/analytics.js.map +1 -0
  63. package/dist/tools/app-tools.d.ts +21 -0
  64. package/dist/tools/app-tools.d.ts.map +1 -0
  65. package/dist/tools/app-tools.js +248 -0
  66. package/dist/tools/app-tools.js.map +1 -0
  67. package/dist/tools/assets.d.ts +25 -0
  68. package/dist/tools/assets.d.ts.map +1 -0
  69. package/dist/tools/assets.js +631 -0
  70. package/dist/tools/assets.js.map +1 -0
  71. package/dist/tools/audio-files.d.ts +20 -0
  72. package/dist/tools/audio-files.d.ts.map +1 -0
  73. package/dist/tools/audio-files.js +384 -0
  74. package/dist/tools/audio-files.js.map +1 -0
  75. package/dist/tools/auth.d.ts +22 -0
  76. package/dist/tools/auth.d.ts.map +1 -0
  77. package/dist/tools/auth.js +210 -0
  78. package/dist/tools/auth.js.map +1 -0
  79. package/dist/tools/bulk.d.ts +16 -0
  80. package/dist/tools/bulk.d.ts.map +1 -0
  81. package/dist/tools/bulk.js +85 -0
  82. package/dist/tools/bulk.js.map +1 -0
  83. package/dist/tools/calendar.d.ts +15 -0
  84. package/dist/tools/calendar.d.ts.map +1 -0
  85. package/dist/tools/calendar.js +67 -0
  86. package/dist/tools/calendar.js.map +1 -0
  87. package/dist/tools/collaborators.d.ts +21 -0
  88. package/dist/tools/collaborators.d.ts.map +1 -0
  89. package/dist/tools/collaborators.js +311 -0
  90. package/dist/tools/collaborators.js.map +1 -0
  91. package/dist/tools/comparisons.d.ts +22 -0
  92. package/dist/tools/comparisons.d.ts.map +1 -0
  93. package/dist/tools/comparisons.js +78 -0
  94. package/dist/tools/comparisons.js.map +1 -0
  95. package/dist/tools/credits.d.ts +17 -0
  96. package/dist/tools/credits.d.ts.map +1 -0
  97. package/dist/tools/credits.js +312 -0
  98. package/dist/tools/credits.js.map +1 -0
  99. package/dist/tools/custody-hints.d.ts +16 -0
  100. package/dist/tools/custody-hints.d.ts.map +1 -0
  101. package/dist/tools/custody-hints.js +27 -0
  102. package/dist/tools/custody-hints.js.map +1 -0
  103. package/dist/tools/custody.d.ts +38 -0
  104. package/dist/tools/custody.d.ts.map +1 -0
  105. package/dist/tools/custody.js +274 -0
  106. package/dist/tools/custody.js.map +1 -0
  107. package/dist/tools/dashboard.d.ts +19 -0
  108. package/dist/tools/dashboard.d.ts.map +1 -0
  109. package/dist/tools/dashboard.js +146 -0
  110. package/dist/tools/dashboard.js.map +1 -0
  111. package/dist/tools/directory.d.ts +15 -0
  112. package/dist/tools/directory.d.ts.map +1 -0
  113. package/dist/tools/directory.js +106 -0
  114. package/dist/tools/directory.js.map +1 -0
  115. package/dist/tools/discovery.d.ts +28 -0
  116. package/dist/tools/discovery.d.ts.map +1 -0
  117. package/dist/tools/discovery.js +560 -0
  118. package/dist/tools/discovery.js.map +1 -0
  119. package/dist/tools/disputes.d.ts +18 -0
  120. package/dist/tools/disputes.d.ts.map +1 -0
  121. package/dist/tools/disputes.js +61 -0
  122. package/dist/tools/disputes.js.map +1 -0
  123. package/dist/tools/documents.d.ts +15 -0
  124. package/dist/tools/documents.d.ts.map +1 -0
  125. package/dist/tools/documents.js +36 -0
  126. package/dist/tools/documents.js.map +1 -0
  127. package/dist/tools/duplicates.d.ts +16 -0
  128. package/dist/tools/duplicates.d.ts.map +1 -0
  129. package/dist/tools/duplicates.js +87 -0
  130. package/dist/tools/duplicates.js.map +1 -0
  131. package/dist/tools/enrichment.d.ts +20 -0
  132. package/dist/tools/enrichment.d.ts.map +1 -0
  133. package/dist/tools/enrichment.js +154 -0
  134. package/dist/tools/enrichment.js.map +1 -0
  135. package/dist/tools/exports.d.ts +19 -0
  136. package/dist/tools/exports.d.ts.map +1 -0
  137. package/dist/tools/exports.js +175 -0
  138. package/dist/tools/exports.js.map +1 -0
  139. package/dist/tools/import-documents.d.ts +21 -0
  140. package/dist/tools/import-documents.d.ts.map +1 -0
  141. package/dist/tools/import-documents.js +203 -0
  142. package/dist/tools/import-documents.js.map +1 -0
  143. package/dist/tools/import.d.ts +30 -0
  144. package/dist/tools/import.d.ts.map +1 -0
  145. package/dist/tools/import.js +455 -0
  146. package/dist/tools/import.js.map +1 -0
  147. package/dist/tools/index.d.ts +83 -37
  148. package/dist/tools/index.d.ts.map +1 -1
  149. package/dist/tools/index.js +448 -84
  150. package/dist/tools/index.js.map +1 -1
  151. package/dist/tools/integrations.d.ts +15 -0
  152. package/dist/tools/integrations.d.ts.map +1 -0
  153. package/dist/tools/integrations.js +100 -0
  154. package/dist/tools/integrations.js.map +1 -0
  155. package/dist/tools/licensing.d.ts +40 -0
  156. package/dist/tools/licensing.d.ts.map +1 -0
  157. package/dist/tools/licensing.js +431 -0
  158. package/dist/tools/licensing.js.map +1 -0
  159. package/dist/tools/memory.d.ts +21 -0
  160. package/dist/tools/memory.d.ts.map +1 -0
  161. package/dist/tools/memory.js +116 -0
  162. package/dist/tools/memory.js.map +1 -0
  163. package/dist/tools/metadata.d.ts +15 -0
  164. package/dist/tools/metadata.d.ts.map +1 -0
  165. package/dist/tools/metadata.js +1106 -0
  166. package/dist/tools/metadata.js.map +1 -0
  167. package/dist/tools/multimedia.d.ts +19 -0
  168. package/dist/tools/multimedia.d.ts.map +1 -0
  169. package/dist/tools/multimedia.js +291 -0
  170. package/dist/tools/multimedia.js.map +1 -0
  171. package/dist/tools/notes.d.ts +21 -0
  172. package/dist/tools/notes.d.ts.map +1 -0
  173. package/dist/tools/notes.js +108 -0
  174. package/dist/tools/notes.js.map +1 -0
  175. package/dist/tools/notifications.d.ts +20 -0
  176. package/dist/tools/notifications.d.ts.map +1 -0
  177. package/dist/tools/notifications.js +266 -0
  178. package/dist/tools/notifications.js.map +1 -0
  179. package/dist/tools/people.d.ts +39 -47
  180. package/dist/tools/people.d.ts.map +1 -1
  181. package/dist/tools/people.js +148 -109
  182. package/dist/tools/people.js.map +1 -1
  183. package/dist/tools/projects.d.ts +19 -0
  184. package/dist/tools/projects.d.ts.map +1 -0
  185. package/dist/tools/projects.js +140 -0
  186. package/dist/tools/projects.js.map +1 -0
  187. package/dist/tools/publishers.d.ts +16 -0
  188. package/dist/tools/publishers.d.ts.map +1 -0
  189. package/dist/tools/publishers.js +69 -0
  190. package/dist/tools/publishers.js.map +1 -0
  191. package/dist/tools/purchases.d.ts +15 -0
  192. package/dist/tools/purchases.d.ts.map +1 -0
  193. package/dist/tools/purchases.js +63 -0
  194. package/dist/tools/purchases.js.map +1 -0
  195. package/dist/tools/recordings.d.ts +9 -9
  196. package/dist/tools/recordings.d.ts.map +1 -1
  197. package/dist/tools/recordings.js +136 -48
  198. package/dist/tools/recordings.js.map +1 -1
  199. package/dist/tools/recovery-hints.d.ts +14 -0
  200. package/dist/tools/recovery-hints.d.ts.map +1 -0
  201. package/dist/tools/recovery-hints.js +277 -0
  202. package/dist/tools/recovery-hints.js.map +1 -0
  203. package/dist/tools/releases.d.ts +18 -0
  204. package/dist/tools/releases.d.ts.map +1 -0
  205. package/dist/tools/releases.js +128 -0
  206. package/dist/tools/releases.js.map +1 -0
  207. package/dist/tools/royalties.d.ts +23 -0
  208. package/dist/tools/royalties.d.ts.map +1 -0
  209. package/dist/tools/royalties.js +257 -0
  210. package/dist/tools/royalties.js.map +1 -0
  211. package/dist/tools/search.d.ts +21 -21
  212. package/dist/tools/search.d.ts.map +1 -1
  213. package/dist/tools/search.js +3 -3
  214. package/dist/tools/search.js.map +1 -1
  215. package/dist/tools/send.d.ts +17 -0
  216. package/dist/tools/send.d.ts.map +1 -0
  217. package/dist/tools/send.js +185 -0
  218. package/dist/tools/send.js.map +1 -0
  219. package/dist/tools/sessions.d.ts +18 -0
  220. package/dist/tools/sessions.d.ts.map +1 -0
  221. package/dist/tools/sessions.js +115 -0
  222. package/dist/tools/sessions.js.map +1 -0
  223. package/dist/tools/settings.d.ts +18 -0
  224. package/dist/tools/settings.d.ts.map +1 -0
  225. package/dist/tools/settings.js +96 -0
  226. package/dist/tools/settings.js.map +1 -0
  227. package/dist/tools/share-links.d.ts +19 -0
  228. package/dist/tools/share-links.d.ts.map +1 -0
  229. package/dist/tools/share-links.js +121 -0
  230. package/dist/tools/share-links.js.map +1 -0
  231. package/dist/tools/split-sheets.d.ts +25 -0
  232. package/dist/tools/split-sheets.d.ts.map +1 -0
  233. package/dist/tools/split-sheets.js +307 -0
  234. package/dist/tools/split-sheets.js.map +1 -0
  235. package/dist/tools/team.d.ts +22 -0
  236. package/dist/tools/team.d.ts.map +1 -0
  237. package/dist/tools/team.js +134 -0
  238. package/dist/tools/team.js.map +1 -0
  239. package/dist/tools/telegram.d.ts +21 -0
  240. package/dist/tools/telegram.d.ts.map +1 -0
  241. package/dist/tools/telegram.js +141 -0
  242. package/dist/tools/telegram.js.map +1 -0
  243. package/dist/tools/uploads.d.ts +17 -0
  244. package/dist/tools/uploads.d.ts.map +1 -0
  245. package/dist/tools/uploads.js +156 -0
  246. package/dist/tools/uploads.js.map +1 -0
  247. package/dist/tools/works.d.ts +39 -47
  248. package/dist/tools/works.d.ts.map +1 -1
  249. package/dist/tools/works.js +216 -116
  250. package/dist/tools/works.js.map +1 -1
  251. package/package.json +1 -1
@@ -0,0 +1,455 @@
1
+ // Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
2
+ import { formatSuccess, formatAsText, mapGapsToHints, } from "@withpica/mcp-utils";
3
+ const VALID_DOMAINS = [
4
+ "works",
5
+ "people",
6
+ "recordings",
7
+ "documents",
8
+ "enquiries",
9
+ "royalties",
10
+ ];
11
+ export class ImportTools {
12
+ pica;
13
+ constructor(pica) {
14
+ this.pica = pica;
15
+ }
16
+ getTools() {
17
+ return [
18
+ {
19
+ definition: {
20
+ name: "pica_import_analyze",
21
+ description: "Analyze a CSV file and get AI-suggested column mappings. Pass the raw CSV content as a string. " +
22
+ "Returns parsed headers, sample rows, and AI-suggested mappings from CSV columns to PICA fields. " +
23
+ "Use this as the first step before validate and execute. " +
24
+ "→ then: pica_import_validate (check for errors), pica_import_execute (run the import)",
25
+ inputSchema: {
26
+ type: "object",
27
+ properties: {
28
+ file_content: {
29
+ type: "string",
30
+ description: "Raw CSV content as a string (read the CSV file and pass its contents here)",
31
+ },
32
+ domain: {
33
+ type: "string",
34
+ description: "Import domain — what type of records to create",
35
+ enum: VALID_DOMAINS,
36
+ },
37
+ },
38
+ required: ["file_content", "domain"],
39
+ },
40
+ },
41
+ executor: this.analyzeImport.bind(this),
42
+ },
43
+ {
44
+ definition: {
45
+ name: "pica_import_validate",
46
+ description: "Validate all CSV rows against a field mapping before executing import. " +
47
+ "Returns per-row validation errors and a summary of valid/invalid rows. " +
48
+ "Run this after pica_import_analyze to check for issues before importing.",
49
+ inputSchema: {
50
+ type: "object",
51
+ properties: {
52
+ file_content: {
53
+ type: "string",
54
+ description: "Raw CSV content (same as passed to pica_import_analyze)",
55
+ },
56
+ domain: {
57
+ type: "string",
58
+ description: "Import domain",
59
+ enum: VALID_DOMAINS,
60
+ },
61
+ mapping: {
62
+ type: "array",
63
+ description: "Column mappings from pica_import_analyze (or manually adjusted). " +
64
+ "Each entry maps a CSV column to a PICA target field.",
65
+ items: {
66
+ type: "object",
67
+ properties: {
68
+ csvColumn: {
69
+ type: "string",
70
+ description: "CSV column header name",
71
+ },
72
+ targetField: {
73
+ type: "string",
74
+ description: "PICA database field name",
75
+ },
76
+ transformType: {
77
+ type: "string",
78
+ description: "Transform to apply (default: 'text'). Options: text, date, number, boolean, enum",
79
+ },
80
+ },
81
+ required: ["csvColumn", "targetField"],
82
+ },
83
+ },
84
+ },
85
+ required: ["file_content", "domain", "mapping"],
86
+ },
87
+ },
88
+ executor: this.validateImport.bind(this),
89
+ },
90
+ {
91
+ definition: {
92
+ name: "pica_import_execute",
93
+ description: "Execute a bulk import from CSV. Creates records in PICA based on the CSV data and field mapping. " +
94
+ "Always run pica_import_validate first to check for errors. " +
95
+ "Use dry_run: true to preview what would be imported without actually creating records. " +
96
+ "Max 10,000 rows per import.",
97
+ inputSchema: {
98
+ type: "object",
99
+ properties: {
100
+ file_content: {
101
+ type: "string",
102
+ description: "Raw CSV content",
103
+ },
104
+ domain: {
105
+ type: "string",
106
+ description: "Import domain",
107
+ enum: VALID_DOMAINS,
108
+ },
109
+ mapping: {
110
+ type: "array",
111
+ description: "Column mappings (same format as pica_import_validate)",
112
+ items: {
113
+ type: "object",
114
+ properties: {
115
+ csvColumn: { type: "string" },
116
+ targetField: { type: "string" },
117
+ transformType: { type: "string" },
118
+ },
119
+ required: ["csvColumn", "targetField"],
120
+ },
121
+ },
122
+ dry_run: {
123
+ type: "boolean",
124
+ description: "If true, simulates the import without creating records. Recommended before first real import.",
125
+ },
126
+ skip_invalid_rows: {
127
+ type: "boolean",
128
+ description: "If true, skips rows with validation errors instead of failing the entire import.",
129
+ },
130
+ batch_size: {
131
+ type: "number",
132
+ description: "Number of rows to process per batch (default: 50, max: 1000)",
133
+ },
134
+ },
135
+ required: ["file_content", "domain", "mapping"],
136
+ },
137
+ },
138
+ executor: this.executeImport.bind(this),
139
+ },
140
+ {
141
+ definition: {
142
+ name: "pica_import_fields",
143
+ description: "Get the available target fields for an import domain. Returns field names, labels, types, " +
144
+ "and whether they are required. Useful for understanding what columns a CSV should have.",
145
+ inputSchema: {
146
+ type: "object",
147
+ properties: {
148
+ domain: {
149
+ type: "string",
150
+ description: "Import domain to get fields for",
151
+ enum: VALID_DOMAINS,
152
+ },
153
+ },
154
+ required: ["domain"],
155
+ },
156
+ },
157
+ executor: this.getImportFields.bind(this),
158
+ },
159
+ {
160
+ definition: {
161
+ name: "pica_import_template",
162
+ description: "Get an example CSV template for an import domain. Returns a CSV string with headers " +
163
+ "and example rows that can be used as a starting point.",
164
+ inputSchema: {
165
+ type: "object",
166
+ properties: {
167
+ domain: {
168
+ type: "string",
169
+ description: "Import domain to get template for",
170
+ enum: VALID_DOMAINS,
171
+ },
172
+ },
173
+ required: ["domain"],
174
+ },
175
+ },
176
+ executor: this.getImportTemplate.bind(this),
177
+ },
178
+ {
179
+ definition: {
180
+ name: "pica_import_from_spotify",
181
+ description: "Import works from a Spotify URL (track, album, or playlist). " +
182
+ "Matches tracks against existing catalog works, enriches matches, creates new works for unmatched. " +
183
+ "Two-step: omit confirm to preview, set confirm: true to execute. " +
184
+ "→ then: pica_works_query (check imported works)",
185
+ inputSchema: {
186
+ type: "object",
187
+ properties: {
188
+ spotify_url: {
189
+ type: "string",
190
+ description: "Any Spotify URL or URI — track, album, or playlist.",
191
+ },
192
+ confirm: {
193
+ type: "boolean",
194
+ description: "Set true to execute import. Omit or false to preview first.",
195
+ },
196
+ },
197
+ required: ["spotify_url"],
198
+ },
199
+ },
200
+ executor: this.importFromSpotify.bind(this),
201
+ },
202
+ {
203
+ definition: {
204
+ name: "pica_import_streaming_link",
205
+ description: "Import works from a Spotify or Deezer URL. Paste a track, album, or playlist link " +
206
+ "and PICA will fetch all tracks and create works, recordings, people, and performer credits automatically. " +
207
+ "Two-step flow: first call without confirm to preview tracks, then call with confirm: true to execute.\n\n" +
208
+ "Supported platforms: Spotify (track/album/playlist), Deezer (track/album/playlist).\n" +
209
+ "Apple Music and artist profile URLs are not yet supported.\n\n" +
210
+ "Each imported track creates: a work (with title, ISRC, UPC, label, artwork), " +
211
+ "a recording (with ISRC, linked to work), people records for artists, " +
212
+ "performer credits, and multimedia links. Enrichment cascades fire automatically. " +
213
+ "→ then: pica_credits_update (add songwriting credits), pica_works_inspect (check gaps)",
214
+ inputSchema: {
215
+ type: "object",
216
+ properties: {
217
+ url: {
218
+ type: "string",
219
+ description: "Spotify or Deezer URL (track, album, or playlist). " +
220
+ "Examples: https://open.spotify.com/album/4aawyAB9vmqN3uQ7FjRGTy, " +
221
+ "https://deezer.com/playlist/1234567",
222
+ },
223
+ confirm: {
224
+ type: "boolean",
225
+ description: "Set to true to execute the import. Omit or set false to preview tracks first.",
226
+ },
227
+ selected_track_ids: {
228
+ type: "array",
229
+ items: { type: "string" },
230
+ description: "Optional: external IDs of specific tracks to import (from the preview). " +
231
+ "If omitted, all non-duplicate tracks are imported.",
232
+ },
233
+ },
234
+ required: ["url"],
235
+ },
236
+ },
237
+ executor: this.importStreamingLink.bind(this),
238
+ },
239
+ ];
240
+ }
241
+ async analyzeImport(args) {
242
+ const result = await this.pica.imports.analyze({
243
+ fileContent: args.file_content,
244
+ domain: args.domain,
245
+ });
246
+ const parsed = result.parsed;
247
+ const mappingCount = Object.keys(result.analysis?.mappings || {}).length;
248
+ return formatSuccess(`CSV analyzed: ${parsed.totalRows} rows, ${parsed.headers.length} columns. ` +
249
+ `${mappingCount} columns auto-mapped. ` +
250
+ `Review the mappings and run pica_import_validate to check for errors.`, {
251
+ headers: parsed.headers,
252
+ totalRows: parsed.totalRows,
253
+ sampleRows: parsed.rows.slice(0, 3),
254
+ mappings: result.analysis?.mappings,
255
+ suggestions: result.analysis?.suggestions,
256
+ });
257
+ }
258
+ async validateImport(args) {
259
+ const result = await this.pica.imports.validate({
260
+ domain: args.domain,
261
+ fileContent: args.file_content,
262
+ mapping: args.mapping,
263
+ });
264
+ if (result.valid) {
265
+ return formatSuccess(`All ${result.totalRowCount} rows are valid. Ready to import with pica_import_execute.`, {
266
+ validRowCount: result.validRowCount,
267
+ totalRowCount: result.totalRowCount,
268
+ });
269
+ }
270
+ return formatSuccess(`Validation: ${result.validRowCount}/${result.totalRowCount} rows valid, ` +
271
+ `${result.invalidRowCount} invalid. ` +
272
+ `Fix the errors or use skip_invalid_rows: true when importing.`, {
273
+ valid: result.valid,
274
+ validRowCount: result.validRowCount,
275
+ invalidRowCount: result.invalidRowCount,
276
+ totalRowCount: result.totalRowCount,
277
+ errorsByType: result.errorsByType,
278
+ errors: result.errors.slice(0, 20),
279
+ });
280
+ }
281
+ async executeImport(args) {
282
+ const result = await this.pica.imports.execute({
283
+ domain: args.domain,
284
+ fileContent: args.file_content,
285
+ mapping: args.mapping,
286
+ options: {
287
+ dryRun: args.dry_run ?? false,
288
+ skipInvalidRows: args.skip_invalid_rows ?? false,
289
+ batchSize: args.batch_size,
290
+ },
291
+ });
292
+ const prefix = result.dryRun ? "[DRY RUN] " : "";
293
+ return formatSuccess(`${prefix}Import complete: ${result.importedCount} created, ` +
294
+ `${result.updatedCount} updated, ${result.skippedCount} skipped. ` +
295
+ `${result.errors.length} errors.`, {
296
+ importedCount: result.importedCount,
297
+ updatedCount: result.updatedCount,
298
+ skippedCount: result.skippedCount,
299
+ dryRun: result.dryRun,
300
+ errors: result.errors.length > 0 ? result.errors.slice(0, 10) : undefined,
301
+ createdRecords: result.createdRecords.length <= 20
302
+ ? result.createdRecords
303
+ : `${result.createdRecords.length} records (showing first 20)`,
304
+ summary: result.summary,
305
+ });
306
+ }
307
+ async getImportFields(args) {
308
+ const fields = await this.pica.imports.getFields(args.domain);
309
+ return formatAsText({
310
+ domain: args.domain,
311
+ fields,
312
+ });
313
+ }
314
+ async getImportTemplate(args) {
315
+ const csvContent = await this.pica.imports.getTemplate(args.domain);
316
+ return formatSuccess(`Template CSV for "${args.domain}" import. Use this as a starting point.`, { csvContent });
317
+ }
318
+ async importFromSpotify(args) {
319
+ const spotifyUrl = args.spotify_url;
320
+ if (!spotifyUrl) {
321
+ return {
322
+ content: [{ type: "text", text: "Error: spotify_url is required" }],
323
+ isError: true,
324
+ };
325
+ }
326
+ try {
327
+ if (args.confirm) {
328
+ const result = await this.pica.enrichment.spotifyUrlExecute(spotifyUrl);
329
+ const data = result.data ?? result;
330
+ return formatSuccess(`Spotify import complete: ${data.worksCreated ?? 0} works created, ` +
331
+ `${data.worksEnriched ?? data.enrichResults?.length ?? 0} works enriched, ` +
332
+ `${data.duplicatesSkipped ?? 0} duplicates skipped`, data);
333
+ }
334
+ const result = await this.pica.enrichment.spotifyUrlPreview(spotifyUrl);
335
+ const data = result.data ?? result;
336
+ const trackCount = data.tracks?.length ?? 0;
337
+ const newCount = data.newTracks?.length ?? 0;
338
+ const dupCount = data.duplicates?.length ?? 0;
339
+ return formatSuccess(`Spotify preview: ${trackCount} tracks found. ` +
340
+ `${newCount} new (will be created), ${dupCount} already in catalog (will be enriched). ` +
341
+ `Call again with confirm: true to execute.`, data);
342
+ }
343
+ catch (error) {
344
+ const message = error instanceof Error ? error.message : String(error);
345
+ return {
346
+ content: [
347
+ {
348
+ type: "text",
349
+ text: `Spotify import failed: ${message}`,
350
+ },
351
+ ],
352
+ isError: true,
353
+ };
354
+ }
355
+ }
356
+ async importStreamingLink(args) {
357
+ const url = args.url;
358
+ if (!url) {
359
+ return {
360
+ content: [{ type: "text", text: "Error: url is required" }],
361
+ isError: true,
362
+ };
363
+ }
364
+ try {
365
+ if (args.confirm) {
366
+ // Execute import
367
+ const result = await this.pica.imports.streamingLinkImport(url, args.selected_track_ids);
368
+ // Generate completion hints by sampling the first created work
369
+ const hints = [];
370
+ if (result.workIds?.length > 0) {
371
+ try {
372
+ const sample = await this.pica.health.getWorkCompleteness(result.workIds[0]);
373
+ hints.push(...mapGapsToHints(sample?.gaps || sample?.missing || []));
374
+ }
375
+ catch {
376
+ // Completeness check is best-effort — don't fail the import
377
+ }
378
+ // Hint about songwriting credits for streaming imports
379
+ // (streaming platforms only provide performer credits, not writers)
380
+ if (!hints.some((h) => h.gap.includes("credit"))) {
381
+ hints.push({
382
+ gap: "no_songwriting_credits",
383
+ suggestion: "Add songwriting credits — streaming imports only include performer credits",
384
+ count: result.worksCreated,
385
+ severity: "critical",
386
+ });
387
+ }
388
+ }
389
+ return formatSuccess(`Streaming import complete: ${result.worksCreated} works, ` +
390
+ `${result.recordingsCreated} recordings, ${result.peopleCreated} people, ` +
391
+ `${result.creditsCreated} credits created. ` +
392
+ `${result.duplicatesSkipped} duplicates skipped.`, {
393
+ worksCreated: result.worksCreated,
394
+ recordingsCreated: result.recordingsCreated,
395
+ peopleCreated: result.peopleCreated,
396
+ creditsCreated: result.creditsCreated,
397
+ multimediaLinked: result.multimediaLinked,
398
+ duplicatesSkipped: result.duplicatesSkipped,
399
+ workIds: result.workIds,
400
+ }, hints);
401
+ }
402
+ // Preview mode
403
+ const preview = await this.pica.imports.streamingLinkPreview(url);
404
+ const trackSummary = preview.newTracks
405
+ .slice(0, 10)
406
+ .map((t) => ` - ${t.title} — ${t.artists.map((a) => a.name).join(", ")}${t.isrc ? ` [${t.isrc}]` : ""}`)
407
+ .join("\n");
408
+ const dupSummary = preview.duplicates.length > 0
409
+ ? `\n\n${preview.duplicates.length} duplicates found (will be skipped):\n` +
410
+ preview.duplicates
411
+ .slice(0, 5)
412
+ .map((d) => ` - "${d.track.title}" matches "${d.existingTitle}" (${d.matchType})`)
413
+ .join("\n")
414
+ : "";
415
+ return formatSuccess(`Found ${preview.tracks.length} tracks from ${preview.source.platform} ${preview.source.type}. ` +
416
+ `${preview.newTracks.length} new, ${preview.duplicates.length} duplicates.\n\n` +
417
+ `New tracks:\n${trackSummary}` +
418
+ (preview.newTracks.length > 10
419
+ ? `\n ... and ${preview.newTracks.length - 10} more`
420
+ : "") +
421
+ dupSummary +
422
+ `\n\nTo import, call again with confirm: true.`, {
423
+ source: preview.source,
424
+ totalTracks: preview.tracks.length,
425
+ newTrackCount: preview.newTracks.length,
426
+ duplicateCount: preview.duplicates.length,
427
+ newTracks: preview.newTracks.map((t) => ({
428
+ title: t.title,
429
+ artists: t.artists.map((a) => a.name),
430
+ isrc: t.isrc,
431
+ externalId: t.externalId,
432
+ })),
433
+ duplicates: preview.duplicates.map((d) => ({
434
+ title: d.track.title,
435
+ existingTitle: d.existingTitle,
436
+ existingWorkId: d.existingWorkId,
437
+ matchType: d.matchType,
438
+ })),
439
+ });
440
+ }
441
+ catch (error) {
442
+ const message = error instanceof Error ? error.message : String(error);
443
+ return {
444
+ content: [
445
+ {
446
+ type: "text",
447
+ text: `Streaming import failed: ${message}`,
448
+ },
449
+ ],
450
+ isError: true,
451
+ };
452
+ }
453
+ }
454
+ }
455
+ //# sourceMappingURL=import.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import.js","sourceRoot":"","sources":["../../src/tools/import.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAiB7D,OAAO,EACL,aAAa,EACb,YAAY,EAEZ,cAAc,GACf,MAAM,qBAAqB,CAAC;AAE7B,MAAM,aAAa,GAAG;IACpB,OAAO;IACP,QAAQ;IACR,YAAY;IACZ,WAAW;IACX,WAAW;IACX,WAAW;CACH,CAAC;AAEX,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,qBAAqB;oBAC3B,WAAW,EACT,iGAAiG;wBACjG,kGAAkG;wBAClG,0DAA0D;wBAC1D,uFAAuF;oBACzF,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,YAAY,EAAE;gCACZ,IAAI,EAAE,QAAQ;gCACd,WAAW,EACT,4EAA4E;6BAC/E;4BACD,MAAM,EAAE;gCACN,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,gDAAgD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AE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
@@ -2,47 +2,93 @@
2
2
  * Tool Registry for MCP Server
3
3
  * Manages all available tools that AI assistants can call
4
4
  */
5
- import { PicaClient } from "../pica-sdk.js";
5
+ import { PicaClient } from "@withpica/mcp-sdk";
6
+ import { ServerConfig } from "../config.js";
7
+ import { McpAuditLogger, type CallerContext } from "@withpica/mcp-utils";
6
8
  export interface ToolDefinition {
7
- name: string;
8
- description: string;
9
- inputSchema: {
10
- type: string;
11
- properties: Record<string, any>;
12
- required?: string[];
13
- additionalProperties?: boolean;
14
- };
9
+ name: string;
10
+ description: string;
11
+ inputSchema: {
12
+ type: string;
13
+ properties: Record<string, any>;
14
+ required?: string[];
15
+ additionalProperties?: boolean;
16
+ };
17
+ annotations?: {
18
+ title?: string;
19
+ readOnlyHint?: boolean;
20
+ destructiveHint?: boolean;
21
+ idempotentHint?: boolean;
22
+ openWorldHint?: boolean;
23
+ };
24
+ _meta?: {
25
+ ui?: {
26
+ resourceUri: string;
27
+ };
28
+ "ui/resourceUri"?: string;
29
+ [key: string]: unknown;
30
+ };
15
31
  }
32
+ export type ToolCategory = "catalog" | "enrichment" | "business" | "discovery" | "media" | "comms" | "settings";
33
+ export interface ToolMetadata {
34
+ category: ToolCategory;
35
+ risk: "safe" | "mutating" | "destructive";
36
+ retry_safe: boolean;
37
+ display_name: string;
38
+ credits_required?: number;
39
+ }
40
+ /**
41
+ * Build a tool description with metadata injected.
42
+ * Format: "[category] original description"
43
+ */
44
+ export declare function injectMetadataIntoDescription(description: string, metadata: ToolMetadata): string;
45
+ export declare const CATEGORY_DISPLAY: Record<ToolCategory, string>;
16
46
  export interface ToolResult {
17
- content: Array<{
18
- type: string;
19
- text: string;
20
- }>;
21
- structuredContent?: Record<string, unknown>;
22
- isError?: boolean;
47
+ content: Array<{
48
+ type: string;
49
+ text: string;
50
+ }>;
51
+ structuredContent?: Record<string, unknown>;
52
+ isError?: boolean;
23
53
  }
24
54
  export type ToolExecutor = (args: Record<string, any>) => Promise<any>;
25
55
  export declare class ToolRegistry {
26
- private tools;
27
- private pica;
28
- constructor(pica: PicaClient);
29
- /**
30
- * Register all available tools
31
- */
32
- private registerAllTools;
33
- private static readonly DESTRUCTIVE_PATTERNS;
34
- private static readonly MUTATING_PATTERNS;
35
- private static readonly SAFE_OVERRIDES;
36
- private static readonly DESTRUCTIVE_PREFIX;
37
- private static readonly MUTATING_PREFIX;
38
- private classifyTool;
39
- /**
40
- * List all available tools with write-safety prefixes injected
41
- */
42
- listTools(): ToolDefinition[];
43
- /**
44
- * Execute a tool by name
45
- */
46
- executeTool(name: string, args: Record<string, any>): Promise<any>;
56
+ private tools;
57
+ private pica;
58
+ private config?;
59
+ private reinitializeCallback?;
60
+ private signOutCallback?;
61
+ private auditLogger?;
62
+ private callerContext;
63
+ constructor(pica: PicaClient | null, config?: ServerConfig, reinitializeCallback?: (apiKey: string) => void, callerContext?: CallerContext, signOutCallback?: () => void);
64
+ setAuditLogger(logger: McpAuditLogger): void;
65
+ setCallerContext(context: CallerContext): void;
66
+ /**
67
+ * Register all available tools
68
+ */
69
+ private registerAllTools;
70
+ private static readonly DESTRUCTIVE_PATTERNS;
71
+ private static readonly MUTATING_PATTERNS;
72
+ private static readonly SAFE_OVERRIDES;
73
+ private classifyTool;
74
+ /**
75
+ * List all available tools with write-safety prefixes injected.
76
+ * When discoveryMode is enabled, only the 5 handshake-visible tools are returned.
77
+ * All other tools remain registered and callable via pica_execute.
78
+ */
79
+ listTools(): ToolDefinition[];
80
+ /**
81
+ * Build a human-readable preview of what a destructive operation will affect.
82
+ */
83
+ private buildDestructivePreview;
84
+ /**
85
+ * Sanitize tool parameters for audit logging.
86
+ * Strips confirmation tokens and truncates large string values.
87
+ */
88
+ private sanitizeParams;
89
+ /**
90
+ * Execute a tool by name
91
+ */
92
+ executeTool(name: string, args: Record<string, any>): Promise<any>;
47
93
  }
48
- //# sourceMappingURL=index.d.ts.map
94
+ //# sourceMappingURL=index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