@withpica/mcp-server 2.43.0 → 2.45.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 (50) hide show
  1. package/CHANGELOG.md +87 -4
  2. package/README.md +3 -4
  3. package/dist/prompts/index.d.ts +8 -0
  4. package/dist/prompts/index.d.ts.map +1 -1
  5. package/dist/prompts/index.js +134 -1
  6. package/dist/prompts/index.js.map +1 -1
  7. package/dist/resources/agent-guide.d.ts +2 -2
  8. package/dist/resources/agent-guide.d.ts.map +1 -1
  9. package/dist/resources/agent-guide.js +184 -20
  10. package/dist/resources/agent-guide.js.map +1 -1
  11. package/dist/resources/index.d.ts.map +1 -1
  12. package/dist/resources/index.js +55 -1
  13. package/dist/resources/index.js.map +1 -1
  14. package/dist/resources/required-schemas.generated.d.ts +281 -19
  15. package/dist/resources/required-schemas.generated.d.ts.map +1 -1
  16. package/dist/resources/required-schemas.generated.js +591 -25
  17. package/dist/resources/required-schemas.generated.js.map +1 -1
  18. package/dist/resources/required-schemas.source.d.ts.map +1 -1
  19. package/dist/resources/required-schemas.source.js +318 -28
  20. package/dist/resources/required-schemas.source.js.map +1 -1
  21. package/dist/tools/agreement-types.js +1 -1
  22. package/dist/tools/agreement-types.js.map +1 -1
  23. package/dist/tools/agreements.js +3 -3
  24. package/dist/tools/agreements.js.map +1 -1
  25. package/dist/tools/audio-files.js +4 -4
  26. package/dist/tools/audio-files.js.map +1 -1
  27. package/dist/tools/dashboard.js +5 -5
  28. package/dist/tools/dashboard.js.map +1 -1
  29. package/dist/tools/duplicates.d.ts +9 -0
  30. package/dist/tools/duplicates.d.ts.map +1 -1
  31. package/dist/tools/duplicates.js +24 -5
  32. package/dist/tools/duplicates.js.map +1 -1
  33. package/dist/tools/enrichment.js +6 -6
  34. package/dist/tools/enrichment.js.map +1 -1
  35. package/dist/tools/exports.js +5 -5
  36. package/dist/tools/exports.js.map +1 -1
  37. package/dist/tools/index.d.ts +37 -1
  38. package/dist/tools/index.d.ts.map +1 -1
  39. package/dist/tools/index.js +54 -2
  40. package/dist/tools/index.js.map +1 -1
  41. package/dist/tools/multimedia.js +4 -4
  42. package/dist/tools/multimedia.js.map +1 -1
  43. package/dist/tools/recovery-hints.js +1 -1
  44. package/dist/tools/recovery-hints.js.map +1 -1
  45. package/dist/tools/sessions.js +4 -4
  46. package/dist/tools/sessions.js.map +1 -1
  47. package/dist/tools/split-sheets.js +7 -7
  48. package/dist/tools/split-sheets.js.map +1 -1
  49. package/package.json +2 -2
  50. package/server.json +2 -2
@@ -5,6 +5,433 @@
5
5
  // Source: required-schemas.source.ts + schema-mirror.json + ToolRegistry inputSchemas.
6
6
  // ADR-214 — required-fields contracts per workflow.
7
7
  export const REQUIRED_SCHEMAS = {
8
+ "agreement-required": {
9
+ "workflow": "agreement-required",
10
+ "summary": "Required fields to create an agreement, then attach works and (optionally) render from a template.",
11
+ "primary_tool": "pica_agreements_create",
12
+ "primary_required": [
13
+ "title",
14
+ "agreement_type",
15
+ "other_party_name"
16
+ ],
17
+ "primary_recommended": [
18
+ "id",
19
+ "other_party_type",
20
+ "description",
21
+ "notes",
22
+ "tags",
23
+ "agreement_category",
24
+ "status",
25
+ "signing_date",
26
+ "start_date",
27
+ "end_date",
28
+ "expires_at",
29
+ "renewal_date",
30
+ "termination_date",
31
+ "counterparty_org_id",
32
+ "counterparty_email",
33
+ "advance_amount",
34
+ "advance_currency",
35
+ "is_recoupable",
36
+ "financial_terms",
37
+ "agreement_terms",
38
+ "termination_notice_period_days",
39
+ "include_future_works"
40
+ ],
41
+ "enums": {
42
+ "agreement_type": [
43
+ "admin_only",
44
+ "artist_contract",
45
+ "co_publishing",
46
+ "distribution",
47
+ "library_music",
48
+ "master_recording",
49
+ "other",
50
+ "production",
51
+ "publishing_admin",
52
+ "report",
53
+ "sub_publishing",
54
+ "termination"
55
+ ],
56
+ "other_party_type": [
57
+ "artist",
58
+ "individual",
59
+ "label",
60
+ "music_library",
61
+ "other",
62
+ "production_company",
63
+ "publisher"
64
+ ],
65
+ "status": [
66
+ "active",
67
+ "cancelled",
68
+ "completed",
69
+ "draft",
70
+ "expired",
71
+ "fully_executed",
72
+ "partially_signed",
73
+ "pending_signature",
74
+ "terminated",
75
+ "unknown"
76
+ ]
77
+ },
78
+ "companion_calls": [
79
+ {
80
+ "tool": "pica_agreements_update",
81
+ "when": "After creation — to amend any inline field. Status changes trigger notifications; counterparty_org_id changes require the linked-org check at the route layer.",
82
+ "required": [
83
+ "id"
84
+ ]
85
+ },
86
+ {
87
+ "tool": "pica_agreements_link_work",
88
+ "when": "Attach a work to the agreement. Optionally set a royalty split percentage per work.",
89
+ "required": [
90
+ "agreement_id",
91
+ "work_id"
92
+ ]
93
+ },
94
+ {
95
+ "tool": "pica_agreement_templates_render",
96
+ "when": "Template-driven flow — fill an agreement template with catalog data (work_id + people_ids) before creating the agreement row.",
97
+ "required": [
98
+ "id"
99
+ ]
100
+ }
101
+ ],
102
+ "example": {
103
+ "title": "Songwriter Admin Deal — Midnight Rivers",
104
+ "agreement_type": "publishing_admin",
105
+ "other_party_name": "Indigo Music Publishing Ltd."
106
+ }
107
+ },
108
+ "audio-upload-required": {
109
+ "workflow": "audio-upload-required",
110
+ "summary": "Three-step chain to add an audio master / stem / version to the catalog: presign → PUT → finalize, then optional async analyze + poll.",
111
+ "primary_tool": "pica_audio_presigned_upload",
112
+ "primary_required": [
113
+ "filename",
114
+ "content_type",
115
+ "file_size"
116
+ ],
117
+ "primary_recommended": [
118
+ "work_id",
119
+ "title",
120
+ "file_type"
121
+ ],
122
+ "enums": {
123
+ "file_type": [
124
+ "demo",
125
+ "instrumental",
126
+ "master",
127
+ "stem",
128
+ "version"
129
+ ],
130
+ "classification": [
131
+ "composition",
132
+ "demo",
133
+ "drum_pack",
134
+ "loop",
135
+ "other",
136
+ "released_song",
137
+ "sample",
138
+ "stem",
139
+ "unreleased_song"
140
+ ]
141
+ },
142
+ "companion_calls": [
143
+ {
144
+ "tool": "pica_audio_complete_upload",
145
+ "when": "Step 2 — after the uploader PUTs the file to the signed URL returned by step 1. Finalizes the upload, writes the audio_files row, and (optionally) links or auto-creates a recording for master files.",
146
+ "required": [
147
+ "upload_id",
148
+ "key",
149
+ "bucket",
150
+ "filename",
151
+ "content_type",
152
+ "file_size"
153
+ ]
154
+ },
155
+ {
156
+ "tool": "pica_audio_analyze",
157
+ "when": "Step 3 (optional, async). Triggers BPM / key / mood feature extraction (Librosa) and lyrics transcription (Whisper). Each side bills 1 credit. Does not auto-run on complete_upload — explicit call required.",
158
+ "required": [
159
+ "id"
160
+ ]
161
+ },
162
+ {
163
+ "tool": "pica_audio_inspect",
164
+ "when": "Step 4 (poll). Call with sections: ['analysis', 'status'] until the analysis job reports complete. Lyrics transcripts land on the analysis row, not works.lyrics — copy is a separate step.",
165
+ "required": [
166
+ "id"
167
+ ]
168
+ }
169
+ ],
170
+ "example": {
171
+ "filename": "midnight-rivers-master.wav",
172
+ "content_type": "audio/wav",
173
+ "file_size": 48234567,
174
+ "work_id": "<optional uuid — auto-creates a recording for master files>"
175
+ }
176
+ },
177
+ "claim-required": {
178
+ "workflow": "claim-required",
179
+ "summary": "Resolve pending discoveries (credits, custody, artist links) into your catalog. Each discovery type has a typed claim verb; the generic discoveries_review surface accepts/rejects without specialised handling.",
180
+ "primary_tool": "pica_discoveries_query",
181
+ "primary_required": [],
182
+ "primary_recommended": [
183
+ "status",
184
+ "limit"
185
+ ],
186
+ "enums": {
187
+ "status": [
188
+ "expired",
189
+ "pending",
190
+ "resolved",
191
+ "revoked"
192
+ ],
193
+ "match_basis": [
194
+ "email",
195
+ "ipi",
196
+ "ipn",
197
+ "isni",
198
+ "musicbrainz"
199
+ ],
200
+ "custody_type": [
201
+ "composition",
202
+ "master"
203
+ ]
204
+ },
205
+ "companion_calls": [
206
+ {
207
+ "tool": "pica_discoveries_review",
208
+ "when": "Generic accept/reject for any discovery row — accepted discoveries update your catalog automatically. Use for non-credit / non-custody / non-artist discoveries, or when the typed claim tools refuse on rate-limit / state preconditions.",
209
+ "required": [
210
+ "discovery_id",
211
+ "status"
212
+ ]
213
+ },
214
+ {
215
+ "tool": "pica_claim_credit",
216
+ "when": "Drain a discovered_credits row and insert a work_credits row in your catalog. Rate-limited to 20 claims/hour. Re-claiming an already-resolved row returns DISCOVERY_ALREADY_RESOLVED (409).",
217
+ "required": [
218
+ "id"
219
+ ]
220
+ },
221
+ {
222
+ "tool": "pica_claim_custody",
223
+ "when": "Drain a discovered_custody row into a pending custody_claims row with +72h silent-consent auto-approve. The current custodian keeps the catalog row until the window elapses.",
224
+ "required": [
225
+ "id"
226
+ ]
227
+ },
228
+ {
229
+ "tool": "pica_claim_artist",
230
+ "when": "Drain a discovered_artists row instantly (identity evidence already validated at discovery time). Requires your identity to already be linked via pica_update_my_identity. Refuses (409) when an open artist_claims review row exists.",
231
+ "required": [
232
+ "id"
233
+ ]
234
+ }
235
+ ],
236
+ "example": {
237
+ "status": "pending",
238
+ "limit": 50
239
+ }
240
+ },
241
+ "enrichment-resolve-required": {
242
+ "workflow": "enrichment-resolve-required",
243
+ "summary": "Fan out enrichment across every eligible source for an entity (work / recording / person), then review fuzzy Tier B matches in the proposals queue. Tier A identifier matches apply directly; Tier B fuzzy matches queue as proposals.",
244
+ "primary_tool": "pica_resolve_work",
245
+ "primary_required": [
246
+ "work_id"
247
+ ],
248
+ "primary_recommended": [
249
+ "sources",
250
+ "include_fuzzy"
251
+ ],
252
+ "enums": {
253
+ "status": [
254
+ "applied",
255
+ "expired",
256
+ "pending",
257
+ "rejected"
258
+ ],
259
+ "entity_type": [
260
+ "person",
261
+ "recording",
262
+ "work"
263
+ ],
264
+ "proposal_action": [
265
+ "create",
266
+ "update"
267
+ ]
268
+ },
269
+ "companion_calls": [
270
+ {
271
+ "tool": "pica_resolve_recording",
272
+ "when": "Recording-side variant. Fans out across Spotify, YouTube, MusicBrainz, Discogs. Triggered by spotify_track_uri / youtube_video_id on the recording.",
273
+ "required": [
274
+ "recording_id"
275
+ ]
276
+ },
277
+ {
278
+ "tool": "pica_resolve_person",
279
+ "when": "Person-side variant. Fans out across ISNI and MusicBrainz (Wikidata downstream). Triggered by isni / musicbrainz_id on the person.",
280
+ "required": [
281
+ "person_id"
282
+ ]
283
+ },
284
+ {
285
+ "tool": "pica_enrichment_proposals_list",
286
+ "when": "After resolve — list pending Tier B fuzzy matches awaiting review. Only pending status is returned.",
287
+ "required": []
288
+ },
289
+ {
290
+ "tool": "pica_enrichment_proposal_apply",
291
+ "when": "Commit a reviewed proposal. Drift detection runs first on update proposals — pass force=true only after the user has reviewed any conflicts from a prior drift_detected response.",
292
+ "required": [
293
+ "proposal_id"
294
+ ]
295
+ },
296
+ {
297
+ "tool": "pica_enrichment_proposal_reject",
298
+ "when": "Dismiss a proposal. Content-hash suppression permanently blocks re-proposal of the same exact content; cascade only re-proposes if the source data genuinely changes.",
299
+ "required": [
300
+ "proposal_id"
301
+ ]
302
+ }
303
+ ],
304
+ "example": {
305
+ "work_id": "<uuid>",
306
+ "sources": [
307
+ "mlc",
308
+ "spotify"
309
+ ],
310
+ "include_fuzzy": true
311
+ }
312
+ },
313
+ "export-required": {
314
+ "workflow": "export-required",
315
+ "summary": "Generate exports of the works catalog in formats matching the destination — CSV/JSON for general use, CWR for PRO registration, industry-ready packages for publishers/labels/sync, CAR for diligence and finance, AI-consent for declaration matrices.",
316
+ "primary_tool": "pica_export_catalog_csv",
317
+ "primary_required": [],
318
+ "primary_recommended": [
319
+ "format"
320
+ ],
321
+ "enums": {},
322
+ "companion_calls": [
323
+ {
324
+ "tool": "pica_export_song_registration",
325
+ "when": "CWR-compatible song-registration export, formatted for PRO/CMO submission. Billing-gated.",
326
+ "required": []
327
+ },
328
+ {
329
+ "tool": "pica_export_industry_ready",
330
+ "when": "Industry-ready metadata package — formatted for distribution to publishers, labels, and sync agents. Billing-gated.",
331
+ "required": []
332
+ },
333
+ {
334
+ "tool": "pica_export_catalog_asset_report",
335
+ "when": "Catalog Asset Report (CAR) — unified ZIP bundle with cover PDF, evidence folders, integrity manifest. Property-lending framing for finance / insurance / diligence. Nested `sections` object accepts boolean flags: valuation, assets, agreements, intelligence, audio. Ownership is always included. Billing-gated.",
336
+ "required": []
337
+ },
338
+ {
339
+ "tool": "pica_export_ai_consent",
340
+ "when": "AI-usage consent declaration matrix — per-work + per-contributor declarations of human-made / AI-assisted / AI-generated.",
341
+ "required": []
342
+ }
343
+ ],
344
+ "example": {
345
+ "format": "csv"
346
+ }
347
+ },
348
+ "multimedia-required": {
349
+ "workflow": "multimedia-required",
350
+ "summary": "Required fields to register a multimedia item (photo / video / audio / external streaming link), and the patterns for importing or attaching to a work.",
351
+ "primary_tool": "pica_multimedia_create",
352
+ "primary_required": [
353
+ "title",
354
+ "content_type"
355
+ ],
356
+ "primary_recommended": [
357
+ "url",
358
+ "classification",
359
+ "caption",
360
+ "description",
361
+ "tags",
362
+ "credits",
363
+ "duration_seconds",
364
+ "collection_id",
365
+ "display_order",
366
+ "is_featured",
367
+ "is_published",
368
+ "venue",
369
+ "event_name",
370
+ "performance_date",
371
+ "setlist_position",
372
+ "sync_side",
373
+ "spotify_url",
374
+ "spotify_track_uri",
375
+ "spotify_track_id",
376
+ "youtube_url",
377
+ "youtube_video_id",
378
+ "soundcloud_url",
379
+ "thumbnail_url"
380
+ ],
381
+ "enums": {
382
+ "content_type": [
383
+ "live_performance",
384
+ "soundcloud_track",
385
+ "spotify_track",
386
+ "uploaded_audio",
387
+ "uploaded_photo",
388
+ "uploaded_video",
389
+ "youtube_video"
390
+ ],
391
+ "classification": [
392
+ "album_artwork",
393
+ "artist_showcase",
394
+ "behind_the_scenes",
395
+ "general",
396
+ "live_performance",
397
+ "music_video",
398
+ "promo_material",
399
+ "studio_session",
400
+ "sync_placement"
401
+ ]
402
+ },
403
+ "companion_calls": [
404
+ {
405
+ "tool": "pica_multimedia_import_url",
406
+ "when": "Import an external image or video URL — downloads the file into PICA storage rather than referencing it externally. Use for Spotify artwork, web images, etc.",
407
+ "required": [
408
+ "url"
409
+ ]
410
+ },
411
+ {
412
+ "tool": "pica_multimedia_link_youtube",
413
+ "when": "YouTube-specific variant — pulls thumbnail, title, and view count automatically. Use this instead of pica_multimedia_create for YouTube videos.",
414
+ "required": [
415
+ "youtube_video_id",
416
+ "title"
417
+ ]
418
+ },
419
+ {
420
+ "tool": "pica_multimedia_link_work",
421
+ "when": "Attach an existing multimedia item to a work with a typed relationship (music_video_for, sync_placement, album_artwork, etc.).",
422
+ "required": [
423
+ "multimedia_id",
424
+ "work_id",
425
+ "relationship_type"
426
+ ]
427
+ }
428
+ ],
429
+ "example": {
430
+ "title": "Midnight Rivers — Official Music Video",
431
+ "content_type": "youtube_video",
432
+ "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
433
+ }
434
+ },
8
435
  "person-required": {
9
436
  "workflow": "person-required",
10
437
  "summary": "Required fields to register a person (writer, performer, producer, publisher). Identifiers (IPI / ISNI / PRO / MusicBrainz / etc.) are inline-settable at create time.",
@@ -112,18 +539,9 @@ export const REQUIRED_SCHEMAS = {
112
539
  "companion_calls": [],
113
540
  "example": {
114
541
  "recording_id": "<uuid>",
115
- "credits": [
116
- {
117
- "credited_name": "The Riverbed Trio",
118
- "role": "MainArtist",
119
- "display_order": 0
120
- },
121
- {
122
- "credited_name": "Sam Producer",
123
- "role": "Producer",
124
- "display_order": 1
125
- }
126
- ]
542
+ "credited_name": "The Riverbed Trio",
543
+ "role": "MainArtist",
544
+ "person_id": "<uuid>"
127
545
  }
128
546
  },
129
547
  "recording-required": {
@@ -177,15 +595,11 @@ export const REQUIRED_SCHEMAS = {
177
595
  "companion_calls": [
178
596
  {
179
597
  "tool": "pica_recording_credits_update",
180
- "when": "Batch — attach MainArtist / Producer / Engineer credits to the recording.",
598
+ "when": "Per credit — attach a single MainArtist / Producer / Engineer credit. Call once per person; does NOT take a credits[] batch (asymmetric with pica_credits_update for works).",
181
599
  "required": [
182
600
  "recording_id",
183
- "credits"
184
- ],
185
- "per_row_required": [
186
601
  "credited_name",
187
- "role",
188
- "display_order"
602
+ "role"
189
603
  ]
190
604
  },
191
605
  {
@@ -204,9 +618,161 @@ export const REQUIRED_SCHEMAS = {
204
618
  "duration_ms": 213000
205
619
  }
206
620
  },
621
+ "recording-splits-required": {
622
+ "workflow": "recording-splits-required",
623
+ "summary": "Required fields per row when assigning master-rights ownership on a recording. Distinct from publishing splits on works (those flow through pica_credits_update + pica_split_sheet_*). Recording splits drive master royalty payouts and downstream credit gating; pica_recording_splits_create runs an ADR-200 Class D form-confirmation gate when the client supports `elicitation/url`. Use `dry_run: true` for a no-op preview before committing.",
624
+ "primary_tool": "pica_recording_splits_create",
625
+ "primary_required": [
626
+ "recording_id",
627
+ "split_type",
628
+ "percentage"
629
+ ],
630
+ "primary_recommended": [
631
+ "person_id",
632
+ "role",
633
+ "territory",
634
+ "start_date",
635
+ "end_date",
636
+ "notes",
637
+ "dry_run"
638
+ ],
639
+ "enums": {
640
+ "split_type": [
641
+ "master",
642
+ "mechanical",
643
+ "performance",
644
+ "sync"
645
+ ],
646
+ "role": [
647
+ "engineer",
648
+ "label",
649
+ "masterer",
650
+ "mixer",
651
+ "other",
652
+ "owner",
653
+ "performer",
654
+ "producer"
655
+ ]
656
+ },
657
+ "companion_calls": [
658
+ {
659
+ "tool": "pica_recording_splits_verify",
660
+ "when": "After create — explicitly mark a split as confirmed/agreed by the relevant parties. Sets verified=true + verified_at + verified_by on the row.",
661
+ "required": [
662
+ "recording_id",
663
+ "split_id"
664
+ ]
665
+ },
666
+ {
667
+ "tool": "pica_recording_splits_list",
668
+ "when": "List all splits on a recording — verify totals and per-row verification state.",
669
+ "required": [
670
+ "recording_id"
671
+ ]
672
+ }
673
+ ],
674
+ "example": {
675
+ "recording_id": "<uuid>",
676
+ "split_type": "master",
677
+ "percentage": 50,
678
+ "role": "owner",
679
+ "person_id": "<optional uuid>",
680
+ "territory": "worldwide"
681
+ }
682
+ },
683
+ "session-required": {
684
+ "workflow": "session-required",
685
+ "summary": "Required fields to log a studio session — title + start_time + end_time (ISO 8601 datetimes). Optional `session_type_id` is a UUID FK to the org's session_types lookup table; resolve via pica_sessions_types. The `status` column accepts scheduled / in_progress / completed / cancelled per the inputSchema, but the values are NOT enforced by a DB CHECK constraint — verify against the live tool's inputSchema if values matter to the caller.",
686
+ "primary_tool": "pica_sessions_create",
687
+ "primary_required": [
688
+ "title",
689
+ "start_time",
690
+ "end_time"
691
+ ],
692
+ "primary_recommended": [
693
+ "description",
694
+ "session_type_id",
695
+ "timezone",
696
+ "is_all_day",
697
+ "location",
698
+ "location_url",
699
+ "work_id",
700
+ "recording_id",
701
+ "status",
702
+ "notes",
703
+ "metadata",
704
+ "participants"
705
+ ],
706
+ "enums": {},
707
+ "companion_calls": [
708
+ {
709
+ "tool": "pica_sessions_types",
710
+ "when": "Pre-flight to discover valid session_type_id values for this org. The lookup table is org-scoped and seeded with recording / mixing / mastering / writing / production / rehearsal entries on org bootstrap.",
711
+ "required": []
712
+ },
713
+ {
714
+ "tool": "pica_sessions_get",
715
+ "when": "After creation — verify the session row + participants persisted as expected. Reads back the full session record including any participants attached at create time.",
716
+ "required": [
717
+ "id"
718
+ ]
719
+ },
720
+ {
721
+ "tool": "pica_sessions_list",
722
+ "when": "Discovery / browse — list recent or upcoming sessions for the workspace.",
723
+ "required": []
724
+ }
725
+ ],
726
+ "example": {
727
+ "title": "Vocal recording — Midnight Rivers",
728
+ "start_time": "2026-05-08T14:00:00+01:00",
729
+ "end_time": "2026-05-08T17:00:00+01:00",
730
+ "session_type_id": "<uuid from pica_sessions_types>",
731
+ "location": "Tileyard Studios",
732
+ "work_id": "<optional uuid>"
733
+ }
734
+ },
735
+ "split-sheet-required": {
736
+ "workflow": "split-sheet-required",
737
+ "summary": "Required fields to generate a publishing split sheet on a work. Pre-condition: the work's writer credits (set via pica_credits_update) must already total 100% — pica_split_sheet_generate validates and returns 400 otherwise. The generated sheet snapshots current splits + signature state; pica_split_sheet_send notifies each credited writer for review/signature. The split_sheets.status column defaults 'draft' and is NOT enforced by a DB CHECK constraint.",
738
+ "primary_tool": "pica_split_sheet_generate",
739
+ "primary_required": [
740
+ "work_id"
741
+ ],
742
+ "primary_recommended": [],
743
+ "enums": {},
744
+ "companion_calls": [
745
+ {
746
+ "tool": "pica_split_sheet_send",
747
+ "when": "After generate — notify each credited writer for review/signature via in-app notification + Telegram (if connected) + email. Non-PICA-user writers receive a collaboration invite email instead. Soft-fails per-writer; aggregate result reports delivered / not_a_pica_user / failed counts.",
748
+ "required": [
749
+ "work_id",
750
+ "split_sheet_id"
751
+ ]
752
+ },
753
+ {
754
+ "tool": "pica_split_sheet_get",
755
+ "when": "Read back a specific sheet with its full content + signature state. Use after send to check who has signed.",
756
+ "required": [
757
+ "work_id",
758
+ "split_sheet_id"
759
+ ]
760
+ },
761
+ {
762
+ "tool": "pica_split_sheet_list",
763
+ "when": "List all sheets for a work — useful when multiple revisions exist (e.g. a sheet was generated, splits changed, regenerate).",
764
+ "required": [
765
+ "work_id"
766
+ ]
767
+ }
768
+ ],
769
+ "example": {
770
+ "work_id": "<uuid — credits must total 100% first via pica_credits_update>"
771
+ }
772
+ },
207
773
  "work-credits-required": {
208
774
  "workflow": "work-credits-required",
209
- "summary": "Required fields per credit row when attaching writer/composer/publisher credits to a work. Splits sum to 100 across writers.",
775
+ "summary": "Required fields per credit row when attaching writer/composer/publisher credits to a work. The tool exposes `role` (mapped to credit_type on work_credits internally) and `splits` (mapped to writer_split_percentage). Splits must sum to 100. The `enums.credit_type` block reflects the column-level CHECK; pass these values via the `role` field.",
210
776
  "primary_tool": "pica_credits_update",
211
777
  "primary_required": [
212
778
  "work_id",
@@ -250,13 +816,13 @@ export const REQUIRED_SCHEMAS = {
250
816
  "credits": [
251
817
  {
252
818
  "person_id": "<uuid>",
253
- "credit_type": "writer",
254
- "writer_split_percentage": 50
819
+ "role": "writer",
820
+ "splits": 50
255
821
  },
256
822
  {
257
823
  "person_id": "<uuid>",
258
- "credit_type": "writer",
259
- "writer_split_percentage": 50
824
+ "role": "writer",
825
+ "splits": 50
260
826
  }
261
827
  ]
262
828
  }
@@ -320,9 +886,9 @@ export const REQUIRED_SCHEMAS = {
320
886
  ],
321
887
  "per_row_required": [
322
888
  "person_id",
323
- "credit_type"
889
+ "role"
324
890
  ],
325
- "constraint": "writer_split_percentage values must sum to 100 across all writer credits for the work."
891
+ "constraint": "splits values must sum to 100 across all credits for the work (the tool maps role→credit_type and splits→writer_split_percentage on work_credits)."
326
892
  },
327
893
  {
328
894
  "tool": "pica_works_update",