@withpica/mcp-server 2.10.0 → 2.22.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 (98) hide show
  1. package/CHANGELOG.md +838 -0
  2. package/dist/config.d.ts +9 -9
  3. package/dist/index.d.ts +1 -1
  4. package/dist/prompts/index.d.ts +64 -64
  5. package/dist/resources/index.d.ts +53 -53
  6. package/dist/server.d.ts +49 -49
  7. package/dist/tools/agreement-types.d.ts.map +1 -1
  8. package/dist/tools/agreement-types.js +14 -128
  9. package/dist/tools/agreement-types.js.map +1 -1
  10. package/dist/tools/agreements.d.ts.map +1 -1
  11. package/dist/tools/agreements.js +11 -109
  12. package/dist/tools/agreements.js.map +1 -1
  13. package/dist/tools/app-tools.d.ts.map +1 -1
  14. package/dist/tools/app-tools.js +30 -8
  15. package/dist/tools/app-tools.js.map +1 -1
  16. package/dist/tools/assets.d.ts.map +1 -1
  17. package/dist/tools/assets.js +17 -257
  18. package/dist/tools/assets.js.map +1 -1
  19. package/dist/tools/audio-files.d.ts.map +1 -1
  20. package/dist/tools/audio-files.js +10 -2
  21. package/dist/tools/audio-files.js.map +1 -1
  22. package/dist/tools/bulk.d.ts +7 -1
  23. package/dist/tools/bulk.d.ts.map +1 -1
  24. package/dist/tools/bulk.js +24 -2
  25. package/dist/tools/bulk.js.map +1 -1
  26. package/dist/tools/collaborators.js +7 -7
  27. package/dist/tools/collaborators.js.map +1 -1
  28. package/dist/tools/credits.d.ts.map +1 -1
  29. package/dist/tools/credits.js +27 -13
  30. package/dist/tools/credits.js.map +1 -1
  31. package/dist/tools/custody.d.ts.map +1 -1
  32. package/dist/tools/custody.js +2 -1
  33. package/dist/tools/custody.js.map +1 -1
  34. package/dist/tools/discovery.d.ts.map +1 -1
  35. package/dist/tools/discovery.js +8 -0
  36. package/dist/tools/discovery.js.map +1 -1
  37. package/dist/tools/enrichment.d.ts +47 -0
  38. package/dist/tools/enrichment.d.ts.map +1 -1
  39. package/dist/tools/enrichment.js +418 -21
  40. package/dist/tools/enrichment.js.map +1 -1
  41. package/dist/tools/exports.d.ts.map +1 -1
  42. package/dist/tools/exports.js +5 -1
  43. package/dist/tools/exports.js.map +1 -1
  44. package/dist/tools/import.js +3 -3
  45. package/dist/tools/import.js.map +1 -1
  46. package/dist/tools/index.d.ts +88 -72
  47. package/dist/tools/labels.d.ts +20 -0
  48. package/dist/tools/labels.d.ts.map +1 -0
  49. package/dist/tools/labels.js +47 -0
  50. package/dist/tools/labels.js.map +1 -0
  51. package/dist/tools/metadata.d.ts.map +1 -1
  52. package/dist/tools/metadata.js +37 -0
  53. package/dist/tools/metadata.js.map +1 -1
  54. package/dist/tools/multimedia.d.ts.map +1 -1
  55. package/dist/tools/multimedia.js +86 -11
  56. package/dist/tools/multimedia.js.map +1 -1
  57. package/dist/tools/notes.d.ts.map +1 -1
  58. package/dist/tools/notes.js +4 -1
  59. package/dist/tools/notes.js.map +1 -1
  60. package/dist/tools/people.d.ts +38 -38
  61. package/dist/tools/projects.d.ts +1 -0
  62. package/dist/tools/projects.d.ts.map +1 -1
  63. package/dist/tools/projects.js +188 -17
  64. package/dist/tools/projects.js.map +1 -1
  65. package/dist/tools/publishers.d.ts +15 -1
  66. package/dist/tools/publishers.d.ts.map +1 -1
  67. package/dist/tools/publishers.js +43 -9
  68. package/dist/tools/publishers.js.map +1 -1
  69. package/dist/tools/recordings.d.ts +30 -30
  70. package/dist/tools/recovery-hints.d.ts.map +1 -1
  71. package/dist/tools/recovery-hints.js +49 -0
  72. package/dist/tools/recovery-hints.js.map +1 -1
  73. package/dist/tools/releases.d.ts +14 -1
  74. package/dist/tools/releases.d.ts.map +1 -1
  75. package/dist/tools/releases.js +247 -36
  76. package/dist/tools/releases.js.map +1 -1
  77. package/dist/tools/search.d.ts +20 -20
  78. package/dist/tools/sessions.d.ts.map +1 -1
  79. package/dist/tools/sessions.js +42 -8
  80. package/dist/tools/sessions.js.map +1 -1
  81. package/dist/tools/settings.d.ts +1 -0
  82. package/dist/tools/settings.d.ts.map +1 -1
  83. package/dist/tools/settings.js +51 -1
  84. package/dist/tools/settings.js.map +1 -1
  85. package/dist/tools/share-links.d.ts.map +1 -1
  86. package/dist/tools/share-links.js +19 -53
  87. package/dist/tools/share-links.js.map +1 -1
  88. package/dist/tools/split-sheets.d.ts.map +1 -1
  89. package/dist/tools/split-sheets.js +3 -42
  90. package/dist/tools/split-sheets.js.map +1 -1
  91. package/dist/tools/team.d.ts.map +1 -1
  92. package/dist/tools/team.js +9 -4
  93. package/dist/tools/team.js.map +1 -1
  94. package/dist/tools/uploads.d.ts.map +1 -1
  95. package/dist/tools/uploads.js +9 -2
  96. package/dist/tools/uploads.js.map +1 -1
  97. package/dist/tools/works.d.ts +38 -38
  98. package/package.json +1 -1
@@ -31,17 +31,54 @@ export class PublishersTools {
31
31
  {
32
32
  definition: {
33
33
  name: "pica_publishers_create",
34
- description: "Create a new publisher record. Check pica_publishers_query first to avoid duplicates.",
34
+ description: "Create (or fetch existing) publisher in the catalog-wide " +
35
+ "`global_publishers` table. Idempotent by ipi_number — if a " +
36
+ "publisher with the same IPI already exists, returns the existing " +
37
+ "row. Check `pica_publishers_query` first to avoid duplicates and " +
38
+ "to resolve parent_publisher_id.",
35
39
  inputSchema: {
36
40
  type: "object",
37
41
  properties: {
38
- name: { type: "string", description: "Publisher name" },
39
- ipi: {
42
+ name: { type: "string", description: "Publisher name." },
43
+ ipi_number: {
40
44
  type: "string",
41
- description: "Publisher IPI number (9-11 digits)",
45
+ description: "Publisher IPI number (9-11 digits; normalised to 11 with " +
46
+ "leading zero-padding). Required.",
47
+ },
48
+ legal_name: {
49
+ type: "string",
50
+ description: "Legal entity name (e.g. 'Example Publishing Ltd.') — optional.",
51
+ },
52
+ country: {
53
+ type: "string",
54
+ description: "ISO country code (e.g. 'GB', 'US').",
55
+ },
56
+ isni: {
57
+ type: "string",
58
+ description: "ISNI identifier (16-character alphanumeric) if the publisher has one.",
59
+ },
60
+ publisher_type: {
61
+ type: "string",
62
+ description: "Category label (e.g. 'major', 'indie', 'admin', 'self_published'). Freeform — no backend CHECK.",
63
+ },
64
+ wikidata_id: {
65
+ type: "string",
66
+ description: "Wikidata Q-number (e.g. 'Q123456').",
67
+ },
68
+ parent_publisher_id: {
69
+ type: "string",
70
+ description: "UUID of parent publisher for subsidiary/admin relationships. FK → global_publishers.id. Use `pica_publishers_query` to find the parent's ID before passing it here; the route returns FK_NOT_FOUND if the UUID does not exist.",
71
+ },
72
+ founded_date: {
73
+ type: "string",
74
+ description: "Founding date (YYYY-MM-DD).",
75
+ },
76
+ headquarters: {
77
+ type: "string",
78
+ description: "Freeform location (e.g. 'London, UK').",
42
79
  },
43
80
  },
44
- required: ["name"],
81
+ required: ["name", "ipi_number"],
45
82
  },
46
83
  },
47
84
  executor: this.createPublisher.bind(this),
@@ -59,10 +96,7 @@ export class PublishersTools {
59
96
  });
60
97
  }
61
98
  async createPublisher(args) {
62
- const result = await this.pica.publishers.create({
63
- name: args.name,
64
- ipi: args.ipi,
65
- });
99
+ const result = await this.pica.publishers.create(args);
66
100
  return formatSuccess("Publisher created", result);
67
101
  }
68
102
  }
@@ -1 +1 @@
1
- {"version":3,"file":"publishers.js","sourceRoot":"","sources":["../../src/tools/publishers.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAQ7D,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAE1E,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,uBAAuB;oBAC7B,WAAW,EACT,2EAA2E;wBAC3E,0DAA0D;oBAC5D,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,KAAK,EAAE;gCACL,IAAI,EAAE,QAAQ;gCACd,WAAW,EA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CAAC,MAAM;SACzB,CAAC,CAAC;IACL,CAAC;IAEO,KAAK,CAAC,eAAe,CAC3B,IAA6B;QAE7B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAC9C,IAA+B,CAChC,CAAC;QACF,OAAO,aAAa,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IACpD,CAAC;CACF"}
@@ -8,34 +8,34 @@
8
8
  import { PicaClient } from "@withpica/mcp-sdk";
9
9
  import { ToolDefinition, ToolExecutor } from "./index.js";
10
10
  export declare class RecordingsTools {
11
- private pica;
12
- constructor(pica: PicaClient);
13
- /**
14
- * Get all recordings tools
15
- */
16
- getTools(): Array<{
17
- definition: ToolDefinition;
18
- executor: ToolExecutor;
19
- }>;
20
- /**
21
- * Query recordings — list all, search by text, or filter by work
22
- */
23
- private queryRecordings;
24
- /**
25
- * Inspect a recording — get details with optional section filtering
26
- */
27
- private inspectRecording;
28
- /**
29
- * Create recording
30
- */
31
- private createRecording;
32
- /**
33
- * Update recording
34
- */
35
- private updateRecording;
36
- /**
37
- * Delete recording
38
- */
39
- private deleteRecording;
11
+ private pica;
12
+ constructor(pica: PicaClient);
13
+ /**
14
+ * Get all recordings tools
15
+ */
16
+ getTools(): Array<{
17
+ definition: ToolDefinition;
18
+ executor: ToolExecutor;
19
+ }>;
20
+ /**
21
+ * Query recordings — list all, search by text, or filter by work
22
+ */
23
+ private queryRecordings;
24
+ /**
25
+ * Inspect a recording — get details with optional section filtering
26
+ */
27
+ private inspectRecording;
28
+ /**
29
+ * Create recording
30
+ */
31
+ private createRecording;
32
+ /**
33
+ * Update recording
34
+ */
35
+ private updateRecording;
36
+ /**
37
+ * Delete recording
38
+ */
39
+ private deleteRecording;
40
40
  }
41
- //# sourceMappingURL=recordings.d.ts.map
41
+ //# sourceMappingURL=recordings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"recovery-hints.d.ts","sourceRoot":"","sources":["../../src/tools/recovery-hints.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,CA+QzD,CAAC;AAEF,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAChB,YAAY,GAAG,SAAS,CAI1B"}
1
+ {"version":3,"file":"recovery-hints.d.ts","sourceRoot":"","sources":["../../src/tools/recovery-hints.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,CAqUzD,CAAC;AAEF,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAChB,YAAY,GAAG,SAAS,CAI1B"}
@@ -125,7 +125,19 @@ export const RECOVERY_HINTS = {
125
125
  },
126
126
  ],
127
127
  // ── enrichment tools ──
128
+ //
129
+ // ADR-179 Phase 1 (2026-04-17): the five per-source `pica_enrich_work_*`
130
+ // tools were folded into `pica_resolve_work`. Every call now returns
131
+ // `TOOL_DEPRECATED` (jsonrpc -32070) with a suggested replacement call.
132
+ // The NO_MATCH / MISSING_INPUT hints below are dead code today but stay
133
+ // in the registry until the tools are removed in the next minor so
134
+ // they don't disappear from `pica_tool_details` mid-version.
128
135
  pica_enrich_work_spotify: [
136
+ {
137
+ error_code: "TOOL_DEPRECATED",
138
+ suggestion: "deprecated — use pica_resolve_work with sources: ['spotify']",
139
+ next_tool: "pica_resolve_work",
140
+ },
129
141
  {
130
142
  error_code: "NO_MATCH",
131
143
  suggestion: "no Spotify match — try MusicBrainz",
@@ -138,6 +150,11 @@ export const RECOVERY_HINTS = {
138
150
  },
139
151
  ],
140
152
  pica_enrich_work_musicbrainz: [
153
+ {
154
+ error_code: "TOOL_DEPRECATED",
155
+ suggestion: "deprecated — use pica_resolve_work with sources: ['musicbrainz']",
156
+ next_tool: "pica_resolve_work",
157
+ },
141
158
  {
142
159
  error_code: "NO_MATCH",
143
160
  suggestion: "no MusicBrainz match — try MLC",
@@ -145,6 +162,11 @@ export const RECOVERY_HINTS = {
145
162
  },
146
163
  ],
147
164
  pica_enrich_work_mlc: [
165
+ {
166
+ error_code: "TOOL_DEPRECATED",
167
+ suggestion: "deprecated — use pica_resolve_work with sources: ['mlc']",
168
+ next_tool: "pica_resolve_work",
169
+ },
148
170
  {
149
171
  error_code: "NO_MATCH",
150
172
  suggestion: "no MLC match — try Discogs",
@@ -157,6 +179,11 @@ export const RECOVERY_HINTS = {
157
179
  },
158
180
  ],
159
181
  pica_enrich_work_discogs: [
182
+ {
183
+ error_code: "TOOL_DEPRECATED",
184
+ suggestion: "deprecated — use pica_resolve_work with sources: ['discogs']",
185
+ next_tool: "pica_resolve_work",
186
+ },
160
187
  {
161
188
  error_code: "NO_MATCH",
162
189
  suggestion: "no Discogs match — try adding identifiers manually",
@@ -164,13 +191,30 @@ export const RECOVERY_HINTS = {
164
191
  },
165
192
  ],
166
193
  pica_enrich_work_youtube: [
194
+ {
195
+ error_code: "TOOL_DEPRECATED",
196
+ suggestion: "deprecated — use pica_resolve_work with sources: ['youtube']",
197
+ next_tool: "pica_resolve_work",
198
+ },
167
199
  {
168
200
  error_code: "NO_MATCH",
169
201
  suggestion: "no YouTube data — ensure a YouTube video is linked",
170
202
  next_tool: "pica_multimedia_link_youtube",
171
203
  },
172
204
  ],
205
+ //
206
+ // ADR-179 Phase 2 (2026-04-17): the two per-source `pica_people_enrich_*`
207
+ // tools were folded into `pica_resolve_person`. Every call now returns
208
+ // `TOOL_DEPRECATED` (jsonrpc -32070) with a suggested replacement call.
209
+ // The NO_MATCH hints below are dead code today but stay in the registry
210
+ // until the tools are removed in the next minor so they don't disappear
211
+ // from `pica_tool_details` mid-version.
173
212
  pica_people_enrich_isni: [
213
+ {
214
+ error_code: "TOOL_DEPRECATED",
215
+ suggestion: "deprecated — use pica_resolve_person with sources: ['isni']",
216
+ next_tool: "pica_resolve_person",
217
+ },
174
218
  {
175
219
  error_code: "NO_MATCH",
176
220
  suggestion: "no ISNI match — try MusicBrainz",
@@ -178,6 +222,11 @@ export const RECOVERY_HINTS = {
178
222
  },
179
223
  ],
180
224
  pica_people_enrich_musicbrainz: [
225
+ {
226
+ error_code: "TOOL_DEPRECATED",
227
+ suggestion: "deprecated — use pica_resolve_person with sources: ['musicbrainz']",
228
+ next_tool: "pica_resolve_person",
229
+ },
181
230
  {
182
231
  error_code: "NO_MATCH",
183
232
  suggestion: "no MusicBrainz match — try adding identifiers manually",
@@ -1 +1 @@
1
- {"version":3,"file":"recovery-hints.js","sourceRoot":"","sources":["../../src/tools/recovery-hints.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAe7D,MAAM,CAAC,MAAM,cAAc,GAAmC;IAC5D,0BAA0B;IAC1B,iBAAiB,EAAE;QACjB;YACE,UAAU,EAAE,WAAW;YACvB,UAAU,EAAE,8BAA8B;YAC1C,SAAS,EAAE,kBAAkB;SAC9B;QACD;YACE,UAAU,EAAE,kBAAkB;YAC9B,UAAU,EAAE,wCAAwC;YACpD,SAAS,EAAE,oBAAoB;SAChC;KACF;IACD,sBAAsB,EAAE;QACtB;YACE,UAAU,EAAE,mBAAmB;YAC/B,UAAU,EAAE,gDAAgD;YAC5D,SAAS,EAAE,kBAAkB;SAC9B;KACF;IACD,kBAAkB,EAAE;QAClB;YACE,UAAU,EAAE,WAAW;YACvB,UAAU,EAAE,+BAA+B;YAC3C,SAAS,EAAE,mBAAmB;SAC/B;QACD;YACE,UAAU,EAAE,oBAAoB;YAChC,UAAU,EAAE,qC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ACF;IACD,kBAAkB,EAAE;QAClB;YACE,UAAU,EAAE,eAAe;YAC3B,UAAU,EAAE,0CAA0C;YACtD,SAAS,EAAE,2BAA2B;SACvC;KACF;IACD,sBAAsB,EAAE;QACtB;YACE,UAAU,EAAE,gBAAgB;YAC5B,UAAU,EAAE,yCAAyC;YACrD,SAAS,EAAE,yBAAyB;SACrC;KACF;CACF,CAAC;AAEF,MAAM,UAAU,eAAe,CAC7B,QAAgB,EAChB,SAAiB;IAEjB,MAAM,KAAK,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;IACvC,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAC7B,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC;AACvD,CAAC"}
1
+ {"version":3,"file":"recovery-hints.js","sourceRoot":"","sources":["../../src/tools/recovery-hints.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAe7D,MAAM,CAAC,MAAM,cAAc,GAAmC;IAC5D,0BAA0B;IAC1B,iBAAiB,EAAE;QACjB;YACE,UAAU,EAAE,WAAW;YACvB,UAAU,EAAE,8BAA8B;YAC1C,SAAS,EAAE,kBAAkB;SAC9B;QACD;YACE,UAAU,EAAE,kBAAkB;YAC9B,UAAU,EAAE,wCAAwC;YACpD,SAAS,EAAE,oBAAoB;SAChC;KACF;IACD,sBAAsB,EAAE;QACtB;YACE,UAAU,EAAE,mBAAmB;YAC/B,UAAU,EAAE,gDAAgD;YAC5D,SAAS,EAAE,kBAAkB;SAC9B;KACF;IACD,kBAAkB,EAAE;QAClB;YACE,UAAU,EAAE,WAAW;YACvB,UAAU,EAAE,+BAA+B;YAC3C,SAAS,EAAE,mBAAmB;SAC/B;QACD;YACE,UAAU,EAAE,oBAAoB;YAChC,UAAU,EAAE,qCAAqC;YACjD,SAAS,EAAE,qBAAqB;SACjC;KACF;IACD,sBAAsB,EAAE;QACtB;YACE,UAA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AAU,KAAK,SAAS,CAAC,CAAC;AACvD,CAAC"}
@@ -1,5 +1,13 @@
1
1
  /**
2
- * Releases Tools — manage releases (albums, EPs, singles with release dates, labels, and UPCs)
2
+ * Releases Tools — manage releases (albums, EPs, singles with release
3
+ * dates, labels, distributors, UPCs, and artwork).
4
+ *
5
+ * ADR-174 Decision 3 reconciliation: label and distributor are
6
+ * FK-modelled via `label_organization_id` / `distributor_organization_id`
7
+ * to `organisations`. Agents resolve a name to an ID via
8
+ * `pica_labels_query` (ADR-174) or `pica_search_all` before calling
9
+ * create/update. Freetext `label` was removed; it never corresponded to a
10
+ * real column on `releases`.
3
11
  */
4
12
  import { PicaClient } from "@withpica/mcp-sdk";
5
13
  import { ToolDefinition, ToolExecutor } from "./index.js";
@@ -10,6 +18,11 @@ export declare class ReleasesTools {
10
18
  definition: ToolDefinition;
11
19
  executor: ToolExecutor;
12
20
  }>;
21
+ private attachTrack;
22
+ private listTracks;
23
+ private detachTrack;
24
+ private reorderTracks;
25
+ private attachRecordingWithWork;
13
26
  private listReleases;
14
27
  private getRelease;
15
28
  private createRelease;
@@ -1 +1 @@
1
- {"version":3,"file":"releases.d.ts","sourceRoot":"","sources":["../../src/tools/releases.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAGtE,qBAAa,aAAa;IACxB,OAAO,CAAC,IAAI,CAAa;gBAEb,IAAI,EAAE,UAAU;IAI5B,QAAQ,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;YAuG3D,YAAY;YAQZ,UAAU;YAKV,aAAa;YAMb,aAAa;CAK5B"}
1
+ {"version":3,"file":"releases.d.ts","sourceRoot":"","sources":["../../src/tools/releases.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AA0EtE,qBAAa,aAAa;IACxB,OAAO,CAAC,IAAI,CAAa;gBAEb,IAAI,EAAE,UAAU;IAI5B,QAAQ,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;YA2N3D,WAAW;YAUX,UAAU;YAKV,WAAW;YAYX,aAAa;YAQb,uBAAuB;YAcvB,YAAY;YAQZ,UAAU;YAKV,aAAa;YAMb,aAAa;CAK5B"}
@@ -1,5 +1,72 @@
1
1
  // Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
2
2
  import { formatSuccess, formatStructuredList } from "@withpica/mcp-utils";
3
+ /**
4
+ * Canonical write-schema for `releases`. Every property below must
5
+ * correspond to a real column on `public.releases`. Keep this list
6
+ * tight — reintroducing a phantom field is the exact regression
7
+ * ADR-174 Phase 2 exists to prevent.
8
+ */
9
+ const RELEASE_WRITE_PROPERTIES = {
10
+ title: {
11
+ type: "string",
12
+ description: "Release title",
13
+ },
14
+ release_date: {
15
+ type: "string",
16
+ description: "Release date (YYYY-MM-DD)",
17
+ },
18
+ release_type: {
19
+ type: "string",
20
+ description: "Release type",
21
+ enum: ["album", "ep", "single", "compilation"],
22
+ },
23
+ pre_release_date: {
24
+ type: "string",
25
+ description: "Pre-release / announcement date (YYYY-MM-DD)",
26
+ },
27
+ upc: {
28
+ type: "string",
29
+ description: "Universal Product Code (UPC/EAN barcode)",
30
+ },
31
+ catalog_number: {
32
+ type: "string",
33
+ description: "Label catalog number",
34
+ },
35
+ label_organization_id: {
36
+ type: "string",
37
+ description: "organisations.id of the label (must be an org with org_type='label'). " +
38
+ "Resolve a label name to an ID via pica_labels_query first — never pass a free-text name.",
39
+ },
40
+ distributor_organization_id: {
41
+ type: "string",
42
+ description: "organisations.id of the distributor. Resolve a distributor name via pica_search_all first.",
43
+ },
44
+ artwork_url: {
45
+ type: "string",
46
+ description: "Album artwork URL",
47
+ },
48
+ spotify_album_uri: {
49
+ type: "string",
50
+ description: "Spotify album URI (e.g. spotify:album:…)",
51
+ },
52
+ spotify_url: {
53
+ type: "string",
54
+ description: "Spotify album web URL",
55
+ },
56
+ apple_music_url: {
57
+ type: "string",
58
+ description: "Apple Music album URL",
59
+ },
60
+ other_urls: {
61
+ type: "object",
62
+ description: "DSP URLs keyed by service name (e.g. { tidal: '…', deezer: '…' })",
63
+ additionalProperties: { type: "string" },
64
+ },
65
+ notes: {
66
+ type: "string",
67
+ description: "Internal notes",
68
+ },
69
+ };
3
70
  export class ReleasesTools {
4
71
  pica;
5
72
  constructor(pica) {
@@ -10,7 +77,7 @@ export class ReleasesTools {
10
77
  {
11
78
  definition: {
12
79
  name: "pica_releases_list",
13
- description: "List releases — albums, EPs, and singles with release dates, labels, and UPCs.",
80
+ description: "List releases — albums, EPs, and singles with release dates, labels, distributors, and UPCs.",
14
81
  inputSchema: {
15
82
  type: "object",
16
83
  properties: {
@@ -40,69 +107,213 @@ export class ReleasesTools {
40
107
  {
41
108
  definition: {
42
109
  name: "pica_releases_create",
43
- description: "Create a new release — set the title, date, release type, label, and UPC.",
110
+ description: "Create a new release — set title, dates, type, catalog number, " +
111
+ "label/distributor organisation IDs, artwork, DSP URLs, and notes. " +
112
+ "For label_organization_id use pica_labels_query first to resolve a name to an ID " +
113
+ "(freetext label names are not accepted — the DB stores label as an FK to organisations).",
114
+ inputSchema: {
115
+ type: "object",
116
+ properties: RELEASE_WRITE_PROPERTIES,
117
+ required: ["title"],
118
+ },
119
+ },
120
+ executor: this.createRelease.bind(this),
121
+ },
122
+ {
123
+ definition: {
124
+ name: "pica_releases_update",
125
+ description: "Update release details — any field in the release write schema. " +
126
+ "For label_organization_id use pica_labels_query first to resolve a name to an ID.",
44
127
  inputSchema: {
45
128
  type: "object",
46
129
  properties: {
47
- title: {
48
- type: "string",
49
- description: "Release title",
50
- },
51
- release_date: {
130
+ id: { type: "string", description: "Release ID" },
131
+ ...RELEASE_WRITE_PROPERTIES,
132
+ },
133
+ required: ["id"],
134
+ },
135
+ },
136
+ executor: this.updateRelease.bind(this),
137
+ },
138
+ // ADR-173: release-track primitives + compound workflow
139
+ {
140
+ definition: {
141
+ name: "pica_releases_attach_track",
142
+ description: "Attach a recording and/or work to a release at a specific (disc, track) position. " +
143
+ "At least one of recording_id or work_id must be provided. Idempotent on " +
144
+ "(release_id, disc_number, track_number) — a second call at the same position " +
145
+ "updates the existing row rather than creating a duplicate. " +
146
+ "→ then: pica_releases_list_tracks (verify tracklist), pica_releases_reorder_tracks (change order)",
147
+ inputSchema: {
148
+ type: "object",
149
+ properties: {
150
+ release_id: { type: "string", description: "Release ID" },
151
+ recording_id: {
52
152
  type: "string",
53
- description: "Release date (YYYY-MM-DD)",
153
+ description: "Recording ID (optional — at least one of recording_id or work_id must be provided)",
54
154
  },
55
- release_type: {
155
+ work_id: {
56
156
  type: "string",
57
- description: "Release type (album, ep, single, compilation)",
157
+ description: "Work ID (optional omit for licensed-masters releases where no composition record exists)",
58
158
  },
59
- upc: {
60
- type: "string",
61
- description: "Universal Product Code (UPC/EAN barcode)",
159
+ track_number: {
160
+ type: "number",
161
+ description: "Position on disc (1-based)",
62
162
  },
63
- catalog_number: {
64
- type: "string",
65
- description: "Label catalog number",
163
+ disc_number: {
164
+ type: "number",
165
+ description: "Disc number (default 1)",
66
166
  },
67
167
  },
68
- required: ["title"],
168
+ required: ["release_id", "track_number"],
69
169
  },
70
170
  },
71
- executor: this.createRelease.bind(this),
171
+ executor: this.attachTrack.bind(this),
72
172
  },
73
173
  {
74
174
  definition: {
75
- name: "pica_releases_update",
76
- description: "Update release details title, date, release type, label, UPC, or catalog number.",
175
+ name: "pica_releases_list_tracks",
176
+ description: "List tracks on a release in (disc_number, track_number) order with " +
177
+ "inlined title, artist, ISRC, and duration from the linked recording and work. " +
178
+ "→ then: pica_releases_reorder_tracks (change order), pica_recordings_inspect (deep-dive a track)",
77
179
  inputSchema: {
78
180
  type: "object",
79
181
  properties: {
80
- id: { type: "string", description: "Release ID" },
81
- title: { type: "string", description: "Updated title" },
82
- release_date: {
83
- type: "string",
84
- description: "Updated release date (YYYY-MM-DD)",
182
+ release_id: { type: "string", description: "Release ID" },
183
+ },
184
+ required: ["release_id"],
185
+ },
186
+ },
187
+ executor: this.listTracks.bind(this),
188
+ },
189
+ {
190
+ definition: {
191
+ name: "pica_releases_detach_track",
192
+ description: "Remove a track from a release by position. Soft-confirmation: call without " +
193
+ "confirm:true to see a preview of the row that would be removed, then call " +
194
+ "again with confirm:true to execute.",
195
+ inputSchema: {
196
+ type: "object",
197
+ properties: {
198
+ release_id: { type: "string", description: "Release ID" },
199
+ track_number: {
200
+ type: "number",
201
+ description: "Position on disc (1-based)",
85
202
  },
86
- release_type: {
87
- type: "string",
88
- description: "Updated release type (album, ep, single, compilation)",
203
+ disc_number: {
204
+ type: "number",
205
+ description: "Disc number (default 1)",
89
206
  },
90
- upc: {
91
- type: "string",
92
- description: "Updated UPC",
207
+ confirm: {
208
+ type: "boolean",
209
+ description: "Set to true to execute the detach after reviewing the preview",
93
210
  },
94
- catalog_number: {
95
- type: "string",
96
- description: "Updated catalog number",
211
+ },
212
+ required: ["release_id", "track_number"],
213
+ },
214
+ },
215
+ executor: this.detachTrack.bind(this),
216
+ },
217
+ {
218
+ definition: {
219
+ name: "pica_releases_reorder_tracks",
220
+ description: "Reorder tracks on a release atomically. Pass the full new order as an array " +
221
+ "of { track_id, track_number, disc_number } — the entire reorder commits or " +
222
+ "rolls back as one transaction. Duplicate (disc_number, track_number) pairs " +
223
+ "in the payload are rejected before any DB write.",
224
+ inputSchema: {
225
+ type: "object",
226
+ properties: {
227
+ release_id: { type: "string", description: "Release ID" },
228
+ new_order: {
229
+ type: "array",
230
+ description: "New ordering of tracks. Every existing track should appear here.",
231
+ items: {
232
+ type: "object",
233
+ properties: {
234
+ track_id: {
235
+ type: "string",
236
+ description: "release_tracks.id",
237
+ },
238
+ track_number: { type: "number" },
239
+ disc_number: {
240
+ type: "number",
241
+ description: "Default 1",
242
+ },
243
+ },
244
+ required: ["track_id", "track_number"],
245
+ },
97
246
  },
98
247
  },
99
- required: ["id"],
248
+ required: ["release_id", "new_order"],
100
249
  },
101
250
  },
102
- executor: this.updateRelease.bind(this),
251
+ executor: this.reorderTracks.bind(this),
252
+ },
253
+ {
254
+ definition: {
255
+ name: "pica_releases_attach_recording_with_work",
256
+ description: "Attach a recording to a release at a specific position, automatically " +
257
+ "pulling the recording's linked work (if any) onto the same track row. " +
258
+ "Saves agents the recordings.work_id lookup that pica_releases_attach_track " +
259
+ "would otherwise require. Idempotent on (release_id, disc_number, track_number).",
260
+ inputSchema: {
261
+ type: "object",
262
+ properties: {
263
+ release_id: { type: "string", description: "Release ID" },
264
+ recording_id: { type: "string", description: "Recording ID" },
265
+ track_number: {
266
+ type: "number",
267
+ description: "Position on disc (1-based)",
268
+ },
269
+ disc_number: {
270
+ type: "number",
271
+ description: "Disc number (default 1)",
272
+ },
273
+ },
274
+ required: ["release_id", "recording_id", "track_number"],
275
+ },
276
+ },
277
+ executor: this.attachRecordingWithWork.bind(this),
103
278
  },
104
279
  ];
105
280
  }
281
+ async attachTrack(args) {
282
+ const track = await this.pica.releases.attachTrack(args.release_id, {
283
+ recording_id: args.recording_id ?? null,
284
+ work_id: args.work_id ?? null,
285
+ track_number: args.track_number,
286
+ disc_number: args.disc_number,
287
+ });
288
+ return formatSuccess("Track attached to release", track);
289
+ }
290
+ async listTracks(args) {
291
+ const tracks = await this.pica.releases.listTracks(args.release_id);
292
+ return formatSuccess("Release tracks retrieved", tracks);
293
+ }
294
+ async detachTrack(args) {
295
+ const result = await this.pica.releases.detachTrack(args.release_id, {
296
+ track_number: args.track_number,
297
+ disc_number: args.disc_number,
298
+ confirm: args.confirm,
299
+ });
300
+ const message = result?.data?.confirmed
301
+ ? "Track detached from release"
302
+ : "Preview of track to be detached — call again with confirm:true to execute";
303
+ return formatSuccess(message, result);
304
+ }
305
+ async reorderTracks(args) {
306
+ const tracks = await this.pica.releases.reorderTracks(args.release_id, args.new_order);
307
+ return formatSuccess("Release tracks reordered", tracks);
308
+ }
309
+ async attachRecordingWithWork(args) {
310
+ const track = await this.pica.releases.attachRecordingWithWork(args.release_id, {
311
+ recording_id: args.recording_id,
312
+ track_number: args.track_number,
313
+ disc_number: args.disc_number,
314
+ });
315
+ return formatSuccess("Recording attached to release with work", track);
316
+ }
106
317
  async listReleases(args) {
107
318
  const result = await this.pica.releases.list({
108
319
  limit: args.limit,