@withpica/mcp-server-directory 1.1.0 → 1.2.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.
- package/CHANGELOG.md +43 -26
- package/dist/prompts/index.d.ts +5 -6
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +92 -135
- package/dist/prompts/index.js.map +1 -1
- package/dist/prompts/public-question-atlas.d.ts +121 -0
- package/dist/prompts/public-question-atlas.d.ts.map +1 -0
- package/dist/prompts/public-question-atlas.js +404 -0
- package/dist/prompts/public-question-atlas.js.map +1 -0
- package/dist/tools/chain.d.ts +12 -0
- package/dist/tools/chain.d.ts.map +1 -0
- package/dist/tools/chain.js +109 -0
- package/dist/tools/chain.js.map +1 -0
- package/dist/tools/index.d.ts +9 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +2 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/people.d.ts +0 -1
- package/dist/tools/people.d.ts.map +1 -1
- package/dist/tools/people.js +23 -36
- package/dist/tools/people.js.map +1 -1
- package/dist/tools/recordings.d.ts.map +1 -1
- package/dist/tools/recordings.js +7 -3
- package/dist/tools/recordings.js.map +1 -1
- package/dist/tools/search.d.ts.map +1 -1
- package/dist/tools/search.js +7 -4
- package/dist/tools/search.js.map +1 -1
- package/dist/tools/works.d.ts +0 -1
- package/dist/tools/works.d.ts.map +1 -1
- package/dist/tools/works.js +41 -42
- package/dist/tools/works.js.map +1 -1
- package/package.json +3 -2
- package/src/__tests__/prompts/index.test.ts +47 -64
- package/src/__tests__/prompts/prompt-eval-harness.test.ts +135 -104
- package/src/__tests__/tools/chain.test.ts +122 -0
- package/src/__tests__/tools/composability-chains.test.ts +4 -2
- package/src/__tests__/tools/people.test.ts +9 -3
- package/src/__tests__/tools/works.test.ts +32 -3
- package/src/prompts/index.ts +97 -141
- package/src/prompts/public-question-atlas.ts +540 -0
- package/src/tools/chain.ts +118 -0
- package/src/tools/index.ts +12 -0
- package/src/tools/people.ts +22 -41
- package/src/tools/recordings.ts +7 -3
- package/src/tools/search.ts +7 -4
- package/src/tools/works.ts +39 -46
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
// Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
|
|
2
|
+
/**
|
|
3
|
+
* Names known-ambiguous in the music-metadata domain — multiple persons
|
|
4
|
+
* sharing a stage name, or artist project names that collide with
|
|
5
|
+
* person names. Seed list per ADR-229 § Open Q2 (case-insensitive — the
|
|
6
|
+
* lint and the resolver normalise on lowercase).
|
|
7
|
+
*
|
|
8
|
+
* Grow this list as Phase 5 eval data surfaces real collisions the
|
|
9
|
+
* static seed misses. Do not prune without eval evidence — the cost of
|
|
10
|
+
* missing a real collision (wrong-tool routing on a public-facing
|
|
11
|
+
* surface) is higher than the cost of an extra resolver call.
|
|
12
|
+
*/
|
|
13
|
+
export const AMBIGUOUS_NAMES = [
|
|
14
|
+
"Bowie",
|
|
15
|
+
"Sade",
|
|
16
|
+
"Madonna",
|
|
17
|
+
"Cher",
|
|
18
|
+
"Drake",
|
|
19
|
+
"Prince",
|
|
20
|
+
"Eminem",
|
|
21
|
+
"Beyoncé",
|
|
22
|
+
"Adele",
|
|
23
|
+
"Sia",
|
|
24
|
+
];
|
|
25
|
+
export const PUBLIC_ATLAS = [
|
|
26
|
+
// ─────────────────────────────────────────────────────────────────
|
|
27
|
+
// A. Identifier-lookup — direct resolution, no disambiguation
|
|
28
|
+
// ─────────────────────────────────────────────────────────────────
|
|
29
|
+
{
|
|
30
|
+
question: "what's the ISWC for X?",
|
|
31
|
+
synonyms: ["ISWC of X", "song code for X", "registration number for X"],
|
|
32
|
+
resolves_to: { kind: "tool", name: "directory_lookup_work" },
|
|
33
|
+
clean_empty_state: {
|
|
34
|
+
message: "No work matched that title in our index. The work may not be " +
|
|
35
|
+
"registered with a society we mirror, or the title may be " +
|
|
36
|
+
"ambiguous — try a writer name or year of release to narrow.",
|
|
37
|
+
suggest_query_shape: "title + writer | title + year | ISWC if known",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
question: "lookup IPI 12345",
|
|
42
|
+
synonyms: [
|
|
43
|
+
"find IPI X",
|
|
44
|
+
"person with IPI X",
|
|
45
|
+
"who is IPI X?",
|
|
46
|
+
"look up IPI number",
|
|
47
|
+
],
|
|
48
|
+
resolves_to: { kind: "tool", name: "directory_lookup_person" },
|
|
49
|
+
clean_empty_state: {
|
|
50
|
+
message: "No creator matched that IPI in our index. The IPI may not be " +
|
|
51
|
+
"mirrored from the source society yet, or it may belong to a " +
|
|
52
|
+
"publisher rather than a writer — try the directory_list_people " +
|
|
53
|
+
"filter or search by name.",
|
|
54
|
+
suggest_query_shape: "IPI | ISNI | writer name | publisher name",
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
question: "lookup ISRC X",
|
|
59
|
+
synonyms: [
|
|
60
|
+
"what's the work for ISRC X?",
|
|
61
|
+
"find the work for this recording",
|
|
62
|
+
"look up ISRC code",
|
|
63
|
+
],
|
|
64
|
+
resolves_to: { kind: "tool", name: "directory_lookup_isrc" },
|
|
65
|
+
clean_empty_state: {
|
|
66
|
+
message: "No work matched that ISRC in our index. The recording may not " +
|
|
67
|
+
"be linked to a registered work yet, or the ISRC may belong to " +
|
|
68
|
+
"a recording outside our mirrored societies — try a title or " +
|
|
69
|
+
"writer-name lookup.",
|
|
70
|
+
suggest_query_shape: "ISRC | title + artist | ISWC if known",
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
question: "lookup ISNI X",
|
|
75
|
+
synonyms: [
|
|
76
|
+
"find creator by ISNI",
|
|
77
|
+
"person with ISNI X",
|
|
78
|
+
"look up ISNI identifier",
|
|
79
|
+
],
|
|
80
|
+
resolves_to: { kind: "tool", name: "directory_lookup_person" },
|
|
81
|
+
clean_empty_state: {
|
|
82
|
+
message: "No creator matched that ISNI in our index. The creator may not " +
|
|
83
|
+
"have an ISNI registered, or the ISNI may not be mirrored — try " +
|
|
84
|
+
"an IPI lookup or a name search.",
|
|
85
|
+
suggest_query_shape: "ISNI | IPI | creator name",
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
question: "find creator by MusicBrainz ID",
|
|
90
|
+
synonyms: ["lookup MBID X", "person with MusicBrainz ID"],
|
|
91
|
+
resolves_to: { kind: "tool", name: "directory_lookup_person" },
|
|
92
|
+
clean_empty_state: {
|
|
93
|
+
message: "No creator matched that MusicBrainz ID in our index. The MBID " +
|
|
94
|
+
"may not be mirrored, or it may identify a release/recording " +
|
|
95
|
+
"rather than a person — try an ISNI or name lookup.",
|
|
96
|
+
suggest_query_shape: "MBID | ISNI | creator name",
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
// ─────────────────────────────────────────────────────────────────
|
|
100
|
+
// B. Name-lookup — works
|
|
101
|
+
// ─────────────────────────────────────────────────────────────────
|
|
102
|
+
{
|
|
103
|
+
question: "who wrote X?",
|
|
104
|
+
synonyms: [
|
|
105
|
+
"who composed X?",
|
|
106
|
+
"writers of X",
|
|
107
|
+
"songwriters for X",
|
|
108
|
+
"credits for song X",
|
|
109
|
+
],
|
|
110
|
+
resolves_to: { kind: "tool", name: "directory_lookup_work" },
|
|
111
|
+
clean_empty_state: {
|
|
112
|
+
message: "No work matched that title. The song may not be in our index " +
|
|
113
|
+
"yet, or the title may be ambiguous (many works share the same " +
|
|
114
|
+
"title) — try a writer name or year of release.",
|
|
115
|
+
suggest_query_shape: "title + writer | title + year | ISWC if known",
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
question: "find me song X",
|
|
120
|
+
synonyms: ["look up song X by title", "is there a song called X?"],
|
|
121
|
+
resolves_to: { kind: "tool", name: "directory_lookup_work" },
|
|
122
|
+
clean_empty_state: {
|
|
123
|
+
message: "No work matched that title in our index. Try refining with the " +
|
|
124
|
+
"writer's name, year of release, or the ISWC if you have it.",
|
|
125
|
+
suggest_query_shape: "title + writer | title + year | ISWC if known",
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
question: "tell me about song X",
|
|
130
|
+
synonyms: [
|
|
131
|
+
"show me song X",
|
|
132
|
+
"what do you know about song X?",
|
|
133
|
+
"details for song X",
|
|
134
|
+
],
|
|
135
|
+
resolves_to: { kind: "tool", name: "directory_lookup_work" },
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
question: "find recordings of X",
|
|
139
|
+
synonyms: [
|
|
140
|
+
"versions of X",
|
|
141
|
+
"covers of X",
|
|
142
|
+
"who recorded X?",
|
|
143
|
+
"list recordings of song X",
|
|
144
|
+
],
|
|
145
|
+
// Disambiguation routes through directory_lookup_work first so the
|
|
146
|
+
// agent can pick the right work-row; recordings then come from the
|
|
147
|
+
// work-detail response. NEVER directory_search_recordings — that
|
|
148
|
+
// tool is audio-feature-only despite the verb match.
|
|
149
|
+
disambiguation: {
|
|
150
|
+
ambiguous_terms: AMBIGUOUS_NAMES,
|
|
151
|
+
resolver_tool: "directory_lookup_work",
|
|
152
|
+
resolver_intent: "Call directory_lookup_work first to identify the work " +
|
|
153
|
+
"(multiple works may share the title); then read the recordings[] " +
|
|
154
|
+
"field from the work-detail response. If the user typed an " +
|
|
155
|
+
"ISRC-shaped string, call directory_lookup_isrc instead. " +
|
|
156
|
+
"DO NOT call directory_search_recordings — that tool is for " +
|
|
157
|
+
"audio-feature filters (BPM/key/energy), not recording lookup.",
|
|
158
|
+
},
|
|
159
|
+
resolves_to: { kind: "tool", name: "directory_lookup_work" },
|
|
160
|
+
},
|
|
161
|
+
// ─────────────────────────────────────────────────────────────────
|
|
162
|
+
// C. Name-lookup — people (heavy disambiguation)
|
|
163
|
+
// ─────────────────────────────────────────────────────────────────
|
|
164
|
+
{
|
|
165
|
+
question: "find Bowie's songs",
|
|
166
|
+
synonyms: [
|
|
167
|
+
"songs by X",
|
|
168
|
+
"X discography",
|
|
169
|
+
"X's catalog",
|
|
170
|
+
"what has X written?",
|
|
171
|
+
],
|
|
172
|
+
disambiguation: {
|
|
173
|
+
ambiguous_terms: AMBIGUOUS_NAMES,
|
|
174
|
+
resolver_tool: "directory_lookup_person",
|
|
175
|
+
resolver_intent: "Call directory_lookup_person first to surface candidate persons " +
|
|
176
|
+
"(many stage names map to multiple creators); ask the user to " +
|
|
177
|
+
"pick one before calling directory_list_works with the resolved " +
|
|
178
|
+
"person ID.",
|
|
179
|
+
},
|
|
180
|
+
resolves_to: { kind: "tool", name: "directory_list_works" },
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
question: "who is creator X?",
|
|
184
|
+
synonyms: [
|
|
185
|
+
"find creator X",
|
|
186
|
+
"look up artist by name",
|
|
187
|
+
"find the songwriter X",
|
|
188
|
+
],
|
|
189
|
+
disambiguation: {
|
|
190
|
+
ambiguous_terms: AMBIGUOUS_NAMES,
|
|
191
|
+
resolver_tool: "directory_lookup_person",
|
|
192
|
+
resolver_intent: "Call directory_lookup_person; if the response shows multiple " +
|
|
193
|
+
"candidates (common for stage names), surface them and let the " +
|
|
194
|
+
"user pick before any follow-up call.",
|
|
195
|
+
},
|
|
196
|
+
resolves_to: { kind: "tool", name: "directory_lookup_person" },
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
question: "tell me about creator X",
|
|
200
|
+
synonyms: [
|
|
201
|
+
"show me creator X",
|
|
202
|
+
"what do you know about creator X?",
|
|
203
|
+
"details for creator X",
|
|
204
|
+
"what's X's catalog?",
|
|
205
|
+
],
|
|
206
|
+
resolves_to: { kind: "tool", name: "directory_lookup_person" },
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
question: "who performs this song?",
|
|
210
|
+
synonyms: [
|
|
211
|
+
"who recorded this version?",
|
|
212
|
+
"performers of this recording",
|
|
213
|
+
"artist on this ISRC",
|
|
214
|
+
],
|
|
215
|
+
resolves_to: { kind: "tool", name: "directory_lookup_isrc" },
|
|
216
|
+
clean_empty_state: {
|
|
217
|
+
message: "No recording matched that identifier. If you have a song title " +
|
|
218
|
+
"instead of an ISRC, look up the work and read its recordings " +
|
|
219
|
+
"list. Performer credits surface there per recording.",
|
|
220
|
+
suggest_query_shape: "ISRC | work title + artist",
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
// ─────────────────────────────────────────────────────────────────
|
|
224
|
+
// D. Discovery-traversal / chain (graph shape)
|
|
225
|
+
// ─────────────────────────────────────────────────────────────────
|
|
226
|
+
{
|
|
227
|
+
question: "show me the rights chain for X",
|
|
228
|
+
synonyms: [
|
|
229
|
+
"full graph for X",
|
|
230
|
+
"rights chain on this song",
|
|
231
|
+
"what's the chain for X?",
|
|
232
|
+
],
|
|
233
|
+
resolves_to: { kind: "tool", name: "directory_chain" },
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
question: "give me everything on this song",
|
|
237
|
+
synonyms: [
|
|
238
|
+
"everything we know about this work",
|
|
239
|
+
"what's the full picture for X?",
|
|
240
|
+
"full picture for X",
|
|
241
|
+
"the whole graph for X",
|
|
242
|
+
],
|
|
243
|
+
resolves_to: { kind: "tool", name: "directory_chain" },
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
question: "trace the chain from this writer to that work",
|
|
247
|
+
synonyms: [
|
|
248
|
+
"how is X connected to Y?",
|
|
249
|
+
"trace this credit",
|
|
250
|
+
"show the connection between X and Y",
|
|
251
|
+
],
|
|
252
|
+
resolves_to: { kind: "tool", name: "directory_chain" },
|
|
253
|
+
},
|
|
254
|
+
// ─────────────────────────────────────────────────────────────────
|
|
255
|
+
// E. Browse / filter
|
|
256
|
+
// ─────────────────────────────────────────────────────────────────
|
|
257
|
+
{
|
|
258
|
+
question: "list works in PICA",
|
|
259
|
+
synonyms: [
|
|
260
|
+
"browse the catalog",
|
|
261
|
+
"what works are in the directory?",
|
|
262
|
+
"show me all works",
|
|
263
|
+
],
|
|
264
|
+
resolves_to: { kind: "tool", name: "directory_list_works" },
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
question: "works starting with B",
|
|
268
|
+
synonyms: [
|
|
269
|
+
"list works starting with letter X",
|
|
270
|
+
"browse catalog by first letter",
|
|
271
|
+
"alphabetical work browse",
|
|
272
|
+
],
|
|
273
|
+
resolves_to: {
|
|
274
|
+
kind: "tool",
|
|
275
|
+
name: "directory_list_works",
|
|
276
|
+
default_args: { letter: "B" },
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
question: "find works by publisher X",
|
|
281
|
+
synonyms: [
|
|
282
|
+
"list publisher X's works",
|
|
283
|
+
"what's in publisher X's catalog?",
|
|
284
|
+
"publisher catalog browse",
|
|
285
|
+
],
|
|
286
|
+
resolves_to: { kind: "tool", name: "directory_list_works" },
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
question: "find works by label X",
|
|
290
|
+
synonyms: [
|
|
291
|
+
"list label X's recordings",
|
|
292
|
+
"what's on label X?",
|
|
293
|
+
"label catalog browse",
|
|
294
|
+
],
|
|
295
|
+
resolves_to: { kind: "tool", name: "directory_list_works" },
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
question: "list creators in PICA",
|
|
299
|
+
synonyms: [
|
|
300
|
+
"browse the people directory",
|
|
301
|
+
"what creators are in the directory?",
|
|
302
|
+
"show me all creators",
|
|
303
|
+
],
|
|
304
|
+
resolves_to: { kind: "tool", name: "directory_list_people" },
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
question: "people starting with B",
|
|
308
|
+
synonyms: [
|
|
309
|
+
"list creators starting with letter X",
|
|
310
|
+
"browse creators by first letter",
|
|
311
|
+
"alphabetical people browse",
|
|
312
|
+
],
|
|
313
|
+
resolves_to: {
|
|
314
|
+
kind: "tool",
|
|
315
|
+
name: "directory_list_people",
|
|
316
|
+
default_args: { letter: "B" },
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
// ─────────────────────────────────────────────────────────────────
|
|
320
|
+
// F. Audio-feature search (sync licensing — distinct from text search)
|
|
321
|
+
// ─────────────────────────────────────────────────────────────────
|
|
322
|
+
{
|
|
323
|
+
question: "find upbeat tracks around 120 BPM",
|
|
324
|
+
synonyms: [
|
|
325
|
+
"find tracks at X BPM",
|
|
326
|
+
"find energetic music for sync",
|
|
327
|
+
"tracks with high energy",
|
|
328
|
+
],
|
|
329
|
+
resolves_to: { kind: "tool", name: "directory_search_recordings" },
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
question: "find instrumental tracks in C minor",
|
|
333
|
+
synonyms: [
|
|
334
|
+
"tracks in [key]",
|
|
335
|
+
"instrumental tracks for sync",
|
|
336
|
+
"find moody music in a minor key",
|
|
337
|
+
],
|
|
338
|
+
resolves_to: { kind: "tool", name: "directory_search_recordings" },
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
question: "tracks at X BPM in [key]",
|
|
342
|
+
synonyms: [
|
|
343
|
+
"find music matching tempo and key",
|
|
344
|
+
"audio-feature search for sync",
|
|
345
|
+
"filter recordings by audio characteristics",
|
|
346
|
+
],
|
|
347
|
+
resolves_to: { kind: "tool", name: "directory_search_recordings" },
|
|
348
|
+
},
|
|
349
|
+
// ─────────────────────────────────────────────────────────────────
|
|
350
|
+
// G. Cross-type search (entity type unknown)
|
|
351
|
+
// ─────────────────────────────────────────────────────────────────
|
|
352
|
+
{
|
|
353
|
+
question: "find me X",
|
|
354
|
+
synonyms: [
|
|
355
|
+
"is there anything about X in the directory?",
|
|
356
|
+
"find any record of X",
|
|
357
|
+
"search the directory for X",
|
|
358
|
+
],
|
|
359
|
+
resolves_to: { kind: "tool", name: "directory_search" },
|
|
360
|
+
clean_empty_state: {
|
|
361
|
+
message: "No matches in our public directory. The work, creator, or " +
|
|
362
|
+
"recording may not be mirrored from a society we cover yet, or " +
|
|
363
|
+
"the spelling may differ — try an identifier (ISWC / ISRC / IPI) " +
|
|
364
|
+
"if you have one.",
|
|
365
|
+
suggest_query_shape: "name + role | identifier (ISWC/ISRC/IPI/ISNI) | title + writer",
|
|
366
|
+
},
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
question: "who or what is X?",
|
|
370
|
+
synonyms: [
|
|
371
|
+
"is X a song or a person?",
|
|
372
|
+
"what kind of thing is X?",
|
|
373
|
+
"fan-out search for X",
|
|
374
|
+
],
|
|
375
|
+
resolves_to: { kind: "tool", name: "directory_search" },
|
|
376
|
+
clean_empty_state: {
|
|
377
|
+
message: "No matches in our public directory across works or creators. " +
|
|
378
|
+
"Try narrowing to one entity type (work title or creator name), " +
|
|
379
|
+
"or supply an identifier if you have one.",
|
|
380
|
+
suggest_query_shape: "title + writer | creator name + role | identifier",
|
|
381
|
+
},
|
|
382
|
+
},
|
|
383
|
+
// ─────────────────────────────────────────────────────────────────
|
|
384
|
+
// H. Registration / status (specialised lookups)
|
|
385
|
+
// ─────────────────────────────────────────────────────────────────
|
|
386
|
+
{
|
|
387
|
+
question: "is this song registered?",
|
|
388
|
+
synonyms: [
|
|
389
|
+
"is X in PICA?",
|
|
390
|
+
"is this work known?",
|
|
391
|
+
"registration status of X",
|
|
392
|
+
"is the ISWC issued for X?",
|
|
393
|
+
],
|
|
394
|
+
resolves_to: { kind: "tool", name: "directory_lookup_work" },
|
|
395
|
+
clean_empty_state: {
|
|
396
|
+
message: "We don't have this work in our directory. That can mean it's " +
|
|
397
|
+
"unregistered, registered with a society we don't mirror, or the " +
|
|
398
|
+
"title is ambiguous. Try a writer name or year to narrow, or " +
|
|
399
|
+
"look up by ISWC if you have one.",
|
|
400
|
+
suggest_query_shape: "title + writer | title + year | ISWC if known",
|
|
401
|
+
},
|
|
402
|
+
},
|
|
403
|
+
];
|
|
404
|
+
//# sourceMappingURL=public-question-atlas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-question-atlas.js","sourceRoot":"","sources":["../../src/prompts/public-question-atlas.ts"],"names":[],"mappings":"AAAA,6DAA6D;AA8G7D;;;;;;;;;;GAUG;AACH,MAAM,C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AE;YACjB,OAAO,EACL,+DAA+D;gBAC/D,kEAAkE;gBAClE,8DAA8D;gBAC9D,kCAAkC;YACpC,mBAAmB,EACjB,+CAA+C;SAClD;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DirectoryClient } from "../client.js";
|
|
2
|
+
import { ToolDefinition, ToolExecutor } from "./index.js";
|
|
3
|
+
export declare class DirectoryChainTools {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: DirectoryClient);
|
|
6
|
+
getTools(): Array<{
|
|
7
|
+
definition: ToolDefinition;
|
|
8
|
+
executor: ToolExecutor;
|
|
9
|
+
}>;
|
|
10
|
+
private chainLookup;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=chain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../../src/tools/chain.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1D,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,MAAM,CAAkB;gBAEpB,MAAM,EAAE,eAAe;IAInC,QAAQ,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;YAgE3D,WAAW;CAyC1B"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
|
|
2
|
+
export class DirectoryChainTools {
|
|
3
|
+
client;
|
|
4
|
+
constructor(client) {
|
|
5
|
+
this.client = client;
|
|
6
|
+
}
|
|
7
|
+
getTools() {
|
|
8
|
+
return [
|
|
9
|
+
{
|
|
10
|
+
definition: {
|
|
11
|
+
name: "directory_chain",
|
|
12
|
+
tier: "read",
|
|
13
|
+
description: "Use when the user asks: 'show me the rights chain for X', " +
|
|
14
|
+
"'give me everything on this song', 'what's the full picture for X?', " +
|
|
15
|
+
"'trace the chain from this writer to that work'. " +
|
|
16
|
+
"Graph lookup — resolves a query, ISWC, or ISRC to its full rights chain in one call. " +
|
|
17
|
+
"Each result bundles the work, its writers and publishers (names + roles, no IPIs or splits), " +
|
|
18
|
+
"the linked recording (ISRC, DSP presence, duration), and audio characteristics (BPM, key, energy). " +
|
|
19
|
+
"Prefer over stitching list_works + lookup_work + lookup_person when you want the whole graph " +
|
|
20
|
+
"around a track in a single round-trip. " +
|
|
21
|
+
"Supports audio-only queries (min_bpm, key, mood, etc.) when you don't have a text query. " +
|
|
22
|
+
"→ then: directory_lookup_work (deeper work detail), directory_lookup_person (research a named writer)",
|
|
23
|
+
inputSchema: {
|
|
24
|
+
type: "object",
|
|
25
|
+
properties: {
|
|
26
|
+
q: {
|
|
27
|
+
type: "string",
|
|
28
|
+
description: "Free-text query (work title, creator name, etc.). Minimum 2 characters.",
|
|
29
|
+
},
|
|
30
|
+
identifier: {
|
|
31
|
+
type: "string",
|
|
32
|
+
description: "ISWC or ISRC — direct identifier lookup",
|
|
33
|
+
},
|
|
34
|
+
min_bpm: { type: "number", description: "Minimum BPM" },
|
|
35
|
+
max_bpm: { type: "number", description: "Maximum BPM" },
|
|
36
|
+
key: {
|
|
37
|
+
type: "string",
|
|
38
|
+
description: "Musical key (e.g. 'C', 'F#', 'Bb')",
|
|
39
|
+
},
|
|
40
|
+
key_mode: {
|
|
41
|
+
type: "string",
|
|
42
|
+
enum: ["major", "minor"],
|
|
43
|
+
description: "Key mode",
|
|
44
|
+
},
|
|
45
|
+
min_energy: {
|
|
46
|
+
type: "number",
|
|
47
|
+
description: "Minimum energy (0–1)",
|
|
48
|
+
},
|
|
49
|
+
max_energy: {
|
|
50
|
+
type: "number",
|
|
51
|
+
description: "Maximum energy (0–1)",
|
|
52
|
+
},
|
|
53
|
+
mood: {
|
|
54
|
+
type: "string",
|
|
55
|
+
description: "Mood filter (exact match)",
|
|
56
|
+
},
|
|
57
|
+
limit: {
|
|
58
|
+
type: "number",
|
|
59
|
+
description: "Max results (default 10, max 20)",
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
executor: this.chainLookup.bind(this),
|
|
65
|
+
},
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
async chainLookup(args) {
|
|
69
|
+
const params = {};
|
|
70
|
+
if (args.q)
|
|
71
|
+
params.q = String(args.q);
|
|
72
|
+
if (args.identifier)
|
|
73
|
+
params.identifier = String(args.identifier);
|
|
74
|
+
const numericKeys = [
|
|
75
|
+
"min_bpm",
|
|
76
|
+
"max_bpm",
|
|
77
|
+
"min_energy",
|
|
78
|
+
"max_energy",
|
|
79
|
+
"limit",
|
|
80
|
+
];
|
|
81
|
+
for (const k of numericKeys) {
|
|
82
|
+
if (args[k] != null)
|
|
83
|
+
params[k] = String(args[k]);
|
|
84
|
+
}
|
|
85
|
+
if (args.key)
|
|
86
|
+
params.key = args.key;
|
|
87
|
+
if (args.key_mode)
|
|
88
|
+
params.key_mode = args.key_mode;
|
|
89
|
+
if (args.mood)
|
|
90
|
+
params.mood = args.mood;
|
|
91
|
+
const response = await this.client.request("/chain", params);
|
|
92
|
+
const results = response.results || [];
|
|
93
|
+
return {
|
|
94
|
+
content: [
|
|
95
|
+
{
|
|
96
|
+
type: "text",
|
|
97
|
+
text: results.length === 0
|
|
98
|
+
? "No chain results."
|
|
99
|
+
: `Found ${results.length} chain result(s). See structuredContent for the full graph.`,
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
structuredContent: {
|
|
103
|
+
total: response.total ?? results.length,
|
|
104
|
+
results,
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=chain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain.js","sourceRoot":"","sources":["../../src/tools/chain.ts"],"names":[],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ACF,OAAO,CAAC,MAAM,KAAK,CAAC;wBAClB,CAAC,CAAC,mBAAmB;wBACrB,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,6DAA6D;iBAC3F;aACF;YACD,iBAAiB,EAAE;gBACjB,KAAK,EAAE,QAAQ,CAAC,KAAK,IAAI,OAAO,CAAC,MAAM;gBACvC,OAAO;aACR;SACF,CAAC;IACJ,CAAC;CACF"}
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { DirectoryClient } from "../client.js";
|
|
2
|
+
/**
|
|
3
|
+
* ADR-230 — authority tier on every directory_* tool. Sister of the
|
|
4
|
+
* creator + team MCP's `Tier` declaration. Every directory tool is
|
|
5
|
+
* `read` (public catalogue lookup with no mutation surface), but the
|
|
6
|
+
* field is required for cross-surface uniformity and lint enforcement.
|
|
7
|
+
*/
|
|
8
|
+
export type Tier = "read" | "draft" | "write" | "destructive";
|
|
2
9
|
export interface ToolDefinition {
|
|
3
10
|
name: string;
|
|
11
|
+
/** ADR-230 — see {@link Tier}. Required on every directory tool. */
|
|
12
|
+
tier: Tier;
|
|
4
13
|
description: string;
|
|
5
14
|
inputSchema: {
|
|
6
15
|
type: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAQ/C;;;;;GAKG;AACH,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,aAAa,CAAC;AAE9D,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,IAAI,EAAE,IAAI,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAChC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;KACrB,CAAC;CACH;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/C,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;AAEvE,qBAAa,YAAY;IACvB,OAAO,CAAC,KAAK,CAGX;gBAEU,MAAM,EAAE,eAAe;IAkBnC,SAAS,IAAI,cAAc,EAAE;IAIvB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;CAgBzE"}
|
package/dist/tools/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { DirectoryWorksTools } from "./works.js";
|
|
|
3
3
|
import { DirectoryPeopleTools } from "./people.js";
|
|
4
4
|
import { DirectorySearchTools } from "./search.js";
|
|
5
5
|
import { DirectoryRecordingsTools } from "./recordings.js";
|
|
6
|
+
import { DirectoryChainTools } from "./chain.js";
|
|
6
7
|
import { formatError, logError, ToolExecutionError } from "../utils/errors.js";
|
|
7
8
|
export class ToolRegistry {
|
|
8
9
|
tools;
|
|
@@ -13,6 +14,7 @@ export class ToolRegistry {
|
|
|
13
14
|
new DirectoryPeopleTools(client),
|
|
14
15
|
new DirectorySearchTools(client),
|
|
15
16
|
new DirectoryRecordingsTools(client),
|
|
17
|
+
new DirectoryChainTools(client),
|
|
16
18
|
];
|
|
17
19
|
for (const group of groups) {
|
|
18
20
|
for (const tool of group.getTools()) {
|
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAG7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAG7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AA8B/E,MAAM,OAAO,YAAY;IACf,KAAK,CAGX;IAEF,YAAY,MAAuB;QACjC,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,EAAE,CAAC;QAEvB,MAAM,MAAM,GAAG;YACb,IAAI,mBAAmB,CAAC,MAAM,CAAC;YAC/B,IAAI,oBAAoB,CAAC,MAAM,CAAC;YAChC,IAAI,oBAAoB,CAAC,MAAM,CAAC;YAChC,IAAI,wBAAwB,CAAC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EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG1D,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,MAAM,CAAkB;gBAEpB,MAAM,EAAE,eAAe;IAInC,QAAQ,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"people.d.ts","sourceRoot":"","sources":["../../src/tools/people.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG1D,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,MAAM,CAAkB;gBAEpB,MAAM,EAAE,eAAe;IAInC,QAAQ,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;YAwE3D,UAAU;YAwBV,YAAY;CAsF3B"}
|