@cyanheads/musicbrainz-mcp-server 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +466 -0
- package/CLAUDE.md +466 -0
- package/Dockerfile +121 -0
- package/LICENSE +201 -0
- package/README.md +329 -0
- package/changelog/0.1.x/0.1.0.md +27 -0
- package/changelog/template.md +127 -0
- package/dist/config/server-config.d.ts +24 -0
- package/dist/config/server-config.d.ts.map +1 -0
- package/dist/config/server-config.js +90 -0
- package/dist/config/server-config.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-server/resources/definitions/entity.resource.d.ts +33 -0
- package/dist/mcp-server/resources/definitions/entity.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/entity.resource.js +72 -0
- package/dist/mcp-server/resources/definitions/entity.resource.js.map +1 -0
- package/dist/mcp-server/resources/definitions/index.d.ts +27 -0
- package/dist/mcp-server/resources/definitions/index.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/index.js +8 -0
- package/dist/mcp-server/resources/definitions/index.js.map +1 -0
- package/dist/mcp-server/tools/definitions/_shared.d.ts +105 -0
- package/dist/mcp-server/tools/definitions/_shared.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/_shared.js +382 -0
- package/dist/mcp-server/tools/definitions/_shared.js.map +1 -0
- package/dist/mcp-server/tools/definitions/browse-entities.tool.d.ts +62 -0
- package/dist/mcp-server/tools/definitions/browse-entities.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/browse-entities.tool.js +236 -0
- package/dist/mcp-server/tools/definitions/browse-entities.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-artist.tool.d.ts +78 -0
- package/dist/mcp-server/tools/definitions/get-artist.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-artist.tool.js +200 -0
- package/dist/mcp-server/tools/definitions/get-artist.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-cover-art.tool.d.ts +42 -0
- package/dist/mcp-server/tools/definitions/get-cover-art.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-cover-art.tool.js +149 -0
- package/dist/mcp-server/tools/definitions/get-cover-art.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-label.tool.d.ts +52 -0
- package/dist/mcp-server/tools/definitions/get-label.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-label.tool.js +110 -0
- package/dist/mcp-server/tools/definitions/get-label.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-recording.tool.d.ts +58 -0
- package/dist/mcp-server/tools/definitions/get-recording.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-recording.tool.js +135 -0
- package/dist/mcp-server/tools/definitions/get-recording.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-release-group.tool.d.ts +55 -0
- package/dist/mcp-server/tools/definitions/get-release-group.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-release-group.tool.js +140 -0
- package/dist/mcp-server/tools/definitions/get-release-group.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-release.tool.d.ts +66 -0
- package/dist/mcp-server/tools/definitions/get-release.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-release.tool.js +213 -0
- package/dist/mcp-server/tools/definitions/get-release.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-work.tool.d.ts +62 -0
- package/dist/mcp-server/tools/definitions/get-work.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-work.tool.js +132 -0
- package/dist/mcp-server/tools/definitions/get-work.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/index.d.ts +468 -0
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/index.js +28 -0
- package/dist/mcp-server/tools/definitions/index.js.map +1 -0
- package/dist/mcp-server/tools/definitions/lookup-identifier.tool.d.ts +59 -0
- package/dist/mcp-server/tools/definitions/lookup-identifier.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/lookup-identifier.tool.js +214 -0
- package/dist/mcp-server/tools/definitions/lookup-identifier.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/search-entities.tool.d.ts +42 -0
- package/dist/mcp-server/tools/definitions/search-entities.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/search-entities.tool.js +187 -0
- package/dist/mcp-server/tools/definitions/search-entities.tool.js.map +1 -0
- package/dist/services/cover-art/cover-art-service.d.ts +40 -0
- package/dist/services/cover-art/cover-art-service.d.ts.map +1 -0
- package/dist/services/cover-art/cover-art-service.js +118 -0
- package/dist/services/cover-art/cover-art-service.js.map +1 -0
- package/dist/services/musicbrainz/musicbrainz-service.d.ts +81 -0
- package/dist/services/musicbrainz/musicbrainz-service.d.ts.map +1 -0
- package/dist/services/musicbrainz/musicbrainz-service.js +188 -0
- package/dist/services/musicbrainz/musicbrainz-service.js.map +1 -0
- package/dist/services/musicbrainz/rate-limiter.d.ts +32 -0
- package/dist/services/musicbrainz/rate-limiter.d.ts.map +1 -0
- package/dist/services/musicbrainz/rate-limiter.js +54 -0
- package/dist/services/musicbrainz/rate-limiter.js.map +1 -0
- package/dist/services/musicbrainz/types.d.ts +301 -0
- package/dist/services/musicbrainz/types.d.ts.map +1 -0
- package/dist/services/musicbrainz/types.js +11 -0
- package/dist/services/musicbrainz/types.js.map +1 -0
- package/package.json +103 -0
- package/server.json +111 -0
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview musicbrainz_browse_entities — paginate the COMPLETE set of
|
|
3
|
+
* entities linked to a parent MBID: every release on a label, every release-group
|
|
4
|
+
* by an artist, every recording of a work, every release in a release-group. The
|
|
5
|
+
* only complete-enumeration path — the get_* tools' embedded lists are capped at
|
|
6
|
+
* one page (25), so this is a correctness tool, not a convenience.
|
|
7
|
+
* @module mcp-server/tools/definitions/browse-entities.tool
|
|
8
|
+
*/
|
|
9
|
+
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
10
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
11
|
+
import { getMusicBrainzService, MusicBrainzService, } from '../../../services/musicbrainz/musicbrainz-service.js';
|
|
12
|
+
import { artistCreditString, classifyMbidError, formatDuration, normalizeArtistCredits, safeText, } from './_shared.js';
|
|
13
|
+
const TARGET_TYPES = ['artist', 'release-group', 'release', 'recording', 'work', 'label'];
|
|
14
|
+
/** Maps the `{type}-count` envelope key for each entity type. */
|
|
15
|
+
const COUNT_KEY = {
|
|
16
|
+
artist: 'artist-count',
|
|
17
|
+
'release-group': 'release-group-count',
|
|
18
|
+
release: 'release-count',
|
|
19
|
+
recording: 'recording-count',
|
|
20
|
+
work: 'work-count',
|
|
21
|
+
label: 'label-count',
|
|
22
|
+
};
|
|
23
|
+
const EntityRefSchema = z
|
|
24
|
+
.object({
|
|
25
|
+
mbid: z.string().describe('Entity MBID — chain to the matching musicbrainz_get_* tool.'),
|
|
26
|
+
name: z
|
|
27
|
+
.string()
|
|
28
|
+
.describe('Entity name (artist/label) or title (release-group/release/recording/work).'),
|
|
29
|
+
disambiguation: z.string().optional().describe('Short qualifier. Omitted when absent.'),
|
|
30
|
+
type: z.string().optional().describe('Entity subtype, where applicable. Omitted when absent.'),
|
|
31
|
+
artistCredit: z
|
|
32
|
+
.string()
|
|
33
|
+
.optional()
|
|
34
|
+
.describe('Credited artist string, for release-group/release/recording. Omitted otherwise.'),
|
|
35
|
+
date: z
|
|
36
|
+
.string()
|
|
37
|
+
.optional()
|
|
38
|
+
.describe('First-release/release date, where applicable. Omitted when absent.'),
|
|
39
|
+
country: z.string().optional().describe('Country code, where applicable. Omitted when absent.'),
|
|
40
|
+
length: z
|
|
41
|
+
.string()
|
|
42
|
+
.optional()
|
|
43
|
+
.describe('Recording length as m:ss. Omitted when not a recording / unknown.'),
|
|
44
|
+
})
|
|
45
|
+
.describe('A lightweight reference to a linked entity.');
|
|
46
|
+
function mapEntity(type, raw) {
|
|
47
|
+
const base = raw;
|
|
48
|
+
const disambiguation = base.disambiguation?.trim();
|
|
49
|
+
const common = { mbid: base.id, ...(disambiguation ? { disambiguation } : {}) };
|
|
50
|
+
if (type === 'artist' || type === 'label') {
|
|
51
|
+
const e = raw;
|
|
52
|
+
return {
|
|
53
|
+
...common,
|
|
54
|
+
name: e.name ?? '',
|
|
55
|
+
...(e.type ? { type: e.type } : {}),
|
|
56
|
+
...(e.country ? { country: e.country } : {}),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
if (type === 'work') {
|
|
60
|
+
const e = raw;
|
|
61
|
+
return { ...common, name: e.title ?? '', ...(e.type ? { type: e.type } : {}) };
|
|
62
|
+
}
|
|
63
|
+
if (type === 'recording') {
|
|
64
|
+
const e = raw;
|
|
65
|
+
const length = formatDuration(e.length);
|
|
66
|
+
return {
|
|
67
|
+
...common,
|
|
68
|
+
name: e.title ?? '',
|
|
69
|
+
artistCredit: artistCreditString(normalizeArtistCredits(e['artist-credit'])),
|
|
70
|
+
...(length ? { length } : {}),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
const e = raw;
|
|
74
|
+
const isReleaseGroup = type === 'release-group';
|
|
75
|
+
const date = isReleaseGroup
|
|
76
|
+
? e['first-release-date']
|
|
77
|
+
: e.date;
|
|
78
|
+
const subtype = isReleaseGroup
|
|
79
|
+
? e['primary-type']
|
|
80
|
+
: e.status;
|
|
81
|
+
return {
|
|
82
|
+
...common,
|
|
83
|
+
name: e.title ?? '',
|
|
84
|
+
...(subtype ? { type: subtype } : {}),
|
|
85
|
+
artistCredit: artistCreditString(normalizeArtistCredits(e['artist-credit'])),
|
|
86
|
+
...(date ? { date } : {}),
|
|
87
|
+
...(e.country ? { country: e.country } : {}),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
export const browseEntitiesTool = tool('musicbrainz_browse_entities', {
|
|
91
|
+
title: 'musicbrainz-mcp-server: browse entities',
|
|
92
|
+
description: 'Paginate the COMPLETE set of entities linked to a parent MBID — every release-group by an artist, every release on a label, every recording of a work, every release in a release-group. This is the only complete-enumeration path: the get_* tools embed at most one page (25) of any linked list, so use this tool whenever a linked set may exceed a page (a prolific artist, a major label with thousands of releases, a heavily-covered work). Provide exactly ONE link MBID matching a valid parent→child relationship for the target_type. Pages arbitrarily deep via offset; totalCount is the true upstream total.',
|
|
93
|
+
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
94
|
+
errors: [
|
|
95
|
+
{
|
|
96
|
+
reason: 'invalid_link',
|
|
97
|
+
code: JsonRpcErrorCode.InvalidParams,
|
|
98
|
+
when: 'No link MBID was provided, more than one was provided, or the link MBID is malformed (HTTP 400).',
|
|
99
|
+
recovery: 'Provide exactly one link MBID (e.g. link.artist) that is a valid parent for the target_type. MBIDs are 36-char UUIDs.',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
reason: 'entity_not_found',
|
|
103
|
+
code: JsonRpcErrorCode.NotFound,
|
|
104
|
+
when: 'The link MBID is well-formed but no such parent entity exists (HTTP 404).',
|
|
105
|
+
recovery: 'No parent entity exists with that MBID. Verify the ID with the matching musicbrainz_get_* tool or musicbrainz_search_entities.',
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
input: z.object({
|
|
109
|
+
target_type: z.enum(TARGET_TYPES).describe('The entity type to enumerate (the children).'),
|
|
110
|
+
link: z
|
|
111
|
+
.object({
|
|
112
|
+
artist: z
|
|
113
|
+
.string()
|
|
114
|
+
.optional()
|
|
115
|
+
.describe('Parent artist MBID (e.g. release-groups/recordings/releases by this artist).'),
|
|
116
|
+
label: z.string().optional().describe('Parent label MBID (releases on this label).'),
|
|
117
|
+
'release-group': z
|
|
118
|
+
.string()
|
|
119
|
+
.optional()
|
|
120
|
+
.describe('Parent release-group MBID (releases in this group).'),
|
|
121
|
+
recording: z
|
|
122
|
+
.string()
|
|
123
|
+
.optional()
|
|
124
|
+
.describe('Parent recording MBID (releases containing this recording).'),
|
|
125
|
+
work: z.string().optional().describe('Parent work MBID (recordings of this work).'),
|
|
126
|
+
area: z.string().optional().describe('Parent area MBID (artists/labels in this area).'),
|
|
127
|
+
})
|
|
128
|
+
.describe('Exactly one parent MBID. The valid key depends on target_type (see the description).'),
|
|
129
|
+
limit: z.number().int().min(1).max(100).default(25).describe('Page size (1–100).'),
|
|
130
|
+
offset: z
|
|
131
|
+
.number()
|
|
132
|
+
.int()
|
|
133
|
+
.min(0)
|
|
134
|
+
.default(0)
|
|
135
|
+
.describe('Result offset for deep pagination (0-based).'),
|
|
136
|
+
}),
|
|
137
|
+
output: z.object({
|
|
138
|
+
targetType: z.string().describe('The entity type that was enumerated.'),
|
|
139
|
+
linkType: z
|
|
140
|
+
.string()
|
|
141
|
+
.describe('The parent link type used (artist, label, release-group, recording, work, or area).'),
|
|
142
|
+
linkMbid: z.string().describe('The parent MBID that was browsed.'),
|
|
143
|
+
entities: z.array(EntityRefSchema).describe('This page of linked entities, in upstream order.'),
|
|
144
|
+
offset: z.number().describe('The offset used for this page.'),
|
|
145
|
+
}),
|
|
146
|
+
enrichment: {
|
|
147
|
+
totalCount: z
|
|
148
|
+
.number()
|
|
149
|
+
.describe('True total number of linked entities upstream (the {type}-count field).'),
|
|
150
|
+
truncated: z
|
|
151
|
+
.boolean()
|
|
152
|
+
.optional()
|
|
153
|
+
.describe('True when more entities remain beyond this page (offset + shown < totalCount). Absent when the page is complete.'),
|
|
154
|
+
shown: z
|
|
155
|
+
.number()
|
|
156
|
+
.optional()
|
|
157
|
+
.describe('Number of entities returned in this page. Absent when not truncated.'),
|
|
158
|
+
cap: z
|
|
159
|
+
.number()
|
|
160
|
+
.optional()
|
|
161
|
+
.describe('The page size that was applied. Absent when not truncated.'),
|
|
162
|
+
notice: z
|
|
163
|
+
.string()
|
|
164
|
+
.optional()
|
|
165
|
+
.describe('How to page further when results remain, or guidance when empty.'),
|
|
166
|
+
},
|
|
167
|
+
async handler(input, ctx) {
|
|
168
|
+
ctx.log.info('musicbrainz_browse_entities', { target: input.target_type });
|
|
169
|
+
const service = getMusicBrainzService();
|
|
170
|
+
const linkEntries = Object.entries(input.link).filter(([, v]) => typeof v === 'string' && v.length > 0);
|
|
171
|
+
const first = linkEntries[0];
|
|
172
|
+
if (linkEntries.length !== 1 || !first) {
|
|
173
|
+
throw ctx.fail('invalid_link', `Provide exactly one link MBID — received ${linkEntries.length}.`, { ...ctx.recoveryFor('invalid_link') });
|
|
174
|
+
}
|
|
175
|
+
const [linkType, linkMbid] = first;
|
|
176
|
+
let envelope;
|
|
177
|
+
try {
|
|
178
|
+
envelope = await service.browse(input.target_type, { link: linkType, linkMbid, limit: input.limit, offset: input.offset }, ctx, { signal: ctx.signal });
|
|
179
|
+
}
|
|
180
|
+
catch (error) {
|
|
181
|
+
const reason = classifyMbidError(error);
|
|
182
|
+
if (reason === 'invalid_mbid') {
|
|
183
|
+
throw ctx.fail('invalid_link', `Malformed link MBID "${linkMbid}".`, {
|
|
184
|
+
...ctx.recoveryFor('invalid_link'),
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
if (reason === 'entity_not_found') {
|
|
188
|
+
throw ctx.fail('entity_not_found', `No ${linkType} exists with MBID ${linkMbid}.`, {
|
|
189
|
+
...ctx.recoveryFor('entity_not_found'),
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
throw error;
|
|
193
|
+
}
|
|
194
|
+
const key = MusicBrainzService.pluralKey(input.target_type);
|
|
195
|
+
const rawEntities = (envelope[key] ?? []);
|
|
196
|
+
const entities = rawEntities.map((e) => mapEntity(input.target_type, e));
|
|
197
|
+
const totalCount = envelope[COUNT_KEY[input.target_type]];
|
|
198
|
+
const total = typeof totalCount === 'number' ? totalCount : input.offset + entities.length;
|
|
199
|
+
ctx.enrich.total(total);
|
|
200
|
+
const remaining = total - (input.offset + entities.length);
|
|
201
|
+
if (remaining > 0) {
|
|
202
|
+
ctx.enrich.truncated({ shown: entities.length, cap: input.limit });
|
|
203
|
+
ctx.enrich.notice(`${remaining} more linked entit${remaining === 1 ? 'y' : 'ies'} remain. Call again with offset=${input.offset + entities.length} to continue paging.`);
|
|
204
|
+
}
|
|
205
|
+
else if (entities.length === 0) {
|
|
206
|
+
ctx.enrich.notice(`No ${input.target_type} entities are linked to ${linkType} ${linkMbid}.`);
|
|
207
|
+
}
|
|
208
|
+
return {
|
|
209
|
+
targetType: input.target_type,
|
|
210
|
+
linkType,
|
|
211
|
+
linkMbid,
|
|
212
|
+
entities,
|
|
213
|
+
offset: input.offset,
|
|
214
|
+
};
|
|
215
|
+
},
|
|
216
|
+
format: (result) => {
|
|
217
|
+
const lines = [
|
|
218
|
+
`## Browse ${result.targetType} by ${result.linkType}`,
|
|
219
|
+
`**Parent:** ${result.linkMbid} | **Offset:** ${result.offset} | **This page:** ${result.entities.length}`,
|
|
220
|
+
];
|
|
221
|
+
for (const e of result.entities) {
|
|
222
|
+
const meta = [
|
|
223
|
+
e.type ? safeText(e.type) : null,
|
|
224
|
+
e.artistCredit ? safeText(e.artistCredit) : null,
|
|
225
|
+
e.date,
|
|
226
|
+
e.country,
|
|
227
|
+
e.length,
|
|
228
|
+
]
|
|
229
|
+
.filter(Boolean)
|
|
230
|
+
.join(' · ');
|
|
231
|
+
lines.push(`- **${safeText(e.name)}**${e.disambiguation ? ` (${safeText(e.disambiguation)})` : ''}${meta ? ` — ${meta}` : ''} — ${e.mbid}`);
|
|
232
|
+
}
|
|
233
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
234
|
+
},
|
|
235
|
+
});
|
|
236
|
+
//# sourceMappingURL=browse-entities.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browse-entities.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/browse-entities.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EA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AC,CAAC,OAAO;gBACT,CAAC,CAAC,MAAM;aACT;iBACE,MAAM,CAAC,OAAO,CAAC;iBACf,IAAI,CAAC,KAAK,CAAC,CAAC;YACf,KAAK,CAAC,IAAI,CACR,OAAO,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAChI,CAAC;QACJ,CAAC;QACD,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview musicbrainz_get_artist — artist profile by MBID: type, country,
|
|
3
|
+
* life span, gender, area, aliases, tags/genres, plus discography (release-groups)
|
|
4
|
+
* and band-membership / collaboration relationships and external links. The 80%
|
|
5
|
+
* artist-detail call. Discography and relationships are capped at one page by the
|
|
6
|
+
* lookup endpoint — musicbrainz_browse_entities enumerates the full set.
|
|
7
|
+
* @module mcp-server/tools/definitions/get-artist.tool
|
|
8
|
+
*/
|
|
9
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
10
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
11
|
+
export declare const getArtistTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
12
|
+
mbid: z.ZodString;
|
|
13
|
+
inc_release_groups: z.ZodDefault<z.ZodBoolean>;
|
|
14
|
+
inc_relationships: z.ZodDefault<z.ZodBoolean>;
|
|
15
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
16
|
+
mbid: z.ZodString;
|
|
17
|
+
name: z.ZodString;
|
|
18
|
+
sortName: z.ZodOptional<z.ZodString>;
|
|
19
|
+
disambiguation: z.ZodOptional<z.ZodString>;
|
|
20
|
+
type: z.ZodOptional<z.ZodString>;
|
|
21
|
+
gender: z.ZodOptional<z.ZodString>;
|
|
22
|
+
country: z.ZodOptional<z.ZodString>;
|
|
23
|
+
area: z.ZodOptional<z.ZodString>;
|
|
24
|
+
lifeSpan: z.ZodOptional<z.ZodObject<{
|
|
25
|
+
begin: z.ZodOptional<z.ZodString>;
|
|
26
|
+
end: z.ZodOptional<z.ZodString>;
|
|
27
|
+
ended: z.ZodOptional<z.ZodBoolean>;
|
|
28
|
+
}, z.core.$strip>>;
|
|
29
|
+
aliases: z.ZodArray<z.ZodObject<{
|
|
30
|
+
name: z.ZodString;
|
|
31
|
+
sortName: z.ZodOptional<z.ZodString>;
|
|
32
|
+
type: z.ZodOptional<z.ZodString>;
|
|
33
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
34
|
+
primary: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
tags: z.ZodArray<z.ZodObject<{
|
|
37
|
+
name: z.ZodString;
|
|
38
|
+
count: z.ZodNumber;
|
|
39
|
+
}, z.core.$strip>>;
|
|
40
|
+
releaseGroups: z.ZodArray<z.ZodObject<{
|
|
41
|
+
mbid: z.ZodString;
|
|
42
|
+
title: z.ZodString;
|
|
43
|
+
primaryType: z.ZodOptional<z.ZodString>;
|
|
44
|
+
secondaryTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
45
|
+
firstReleaseDate: z.ZodOptional<z.ZodString>;
|
|
46
|
+
disambiguation: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, z.core.$strip>>;
|
|
48
|
+
relationships: z.ZodArray<z.ZodObject<{
|
|
49
|
+
type: z.ZodString;
|
|
50
|
+
direction: z.ZodOptional<z.ZodString>;
|
|
51
|
+
attributes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
52
|
+
targetType: z.ZodString;
|
|
53
|
+
targetId: z.ZodOptional<z.ZodString>;
|
|
54
|
+
targetName: z.ZodOptional<z.ZodString>;
|
|
55
|
+
begin: z.ZodOptional<z.ZodString>;
|
|
56
|
+
end: z.ZodOptional<z.ZodString>;
|
|
57
|
+
}, z.core.$strip>>;
|
|
58
|
+
externalLinks: z.ZodArray<z.ZodObject<{
|
|
59
|
+
type: z.ZodString;
|
|
60
|
+
resource: z.ZodString;
|
|
61
|
+
}, z.core.$strip>>;
|
|
62
|
+
}, z.core.$strip>, readonly [{
|
|
63
|
+
readonly reason: "invalid_mbid";
|
|
64
|
+
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
65
|
+
readonly when: "The MBID is malformed or the all-zeros sentinel (MusicBrainz returns HTTP 400).";
|
|
66
|
+
readonly recovery: "MBID must be a 36-character UUID (e.g. a74b1b7f-71a5-4011-9441-d0b5e4122711). Use musicbrainz_search_entities to find an artist's MBID from its name.";
|
|
67
|
+
}, {
|
|
68
|
+
readonly reason: "entity_not_found";
|
|
69
|
+
readonly code: JsonRpcErrorCode.NotFound;
|
|
70
|
+
readonly when: "The MBID is well-formed but no artist exists with it (MusicBrainz returns HTTP 404).";
|
|
71
|
+
readonly recovery: "No artist exists with that MBID. Verify the ID, or search by name with musicbrainz_search_entities.";
|
|
72
|
+
}], {
|
|
73
|
+
readonly truncated: z.ZodOptional<z.ZodBoolean>;
|
|
74
|
+
readonly shown: z.ZodOptional<z.ZodNumber>;
|
|
75
|
+
readonly cap: z.ZodOptional<z.ZodNumber>;
|
|
76
|
+
readonly notice: z.ZodOptional<z.ZodString>;
|
|
77
|
+
}>;
|
|
78
|
+
//# sourceMappingURL=get-artist.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-artist.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-artist.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AA2CjE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwLxB,CAAC"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview musicbrainz_get_artist — artist profile by MBID: type, country,
|
|
3
|
+
* life span, gender, area, aliases, tags/genres, plus discography (release-groups)
|
|
4
|
+
* and band-membership / collaboration relationships and external links. The 80%
|
|
5
|
+
* artist-detail call. Discography and relationships are capped at one page by the
|
|
6
|
+
* lookup endpoint — musicbrainz_browse_entities enumerates the full set.
|
|
7
|
+
* @module mcp-server/tools/definitions/get-artist.tool
|
|
8
|
+
*/
|
|
9
|
+
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
10
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
11
|
+
import { getMusicBrainzService } from '../../../services/musicbrainz/musicbrainz-service.js';
|
|
12
|
+
import { AliasSchema, classifyMbidError, ExternalLinkSchema, LifeSpanSchema, MBID_EXAMPLE, normalizeAliases, normalizeLifeSpan, normalizeRelations, normalizeTags, RelationSchema, renderAliases, renderExternalLinks, renderLifeSpan, renderRelationships, renderTags, safeText, TagSchema, } from './_shared.js';
|
|
13
|
+
/** One page cap for lookup `inc` embedded lists (25 default / 100 max, no deep offset). */
|
|
14
|
+
const LOOKUP_PAGE_CAP = 25;
|
|
15
|
+
const ReleaseGroupRefSchema = z
|
|
16
|
+
.object({
|
|
17
|
+
mbid: z.string().describe('Release-group MBID — chain to musicbrainz_get_release_group.'),
|
|
18
|
+
title: z.string().describe('Release-group title.'),
|
|
19
|
+
primaryType: z
|
|
20
|
+
.string()
|
|
21
|
+
.optional()
|
|
22
|
+
.describe('Primary type (Album, Single, EP, …). Omitted when absent.'),
|
|
23
|
+
secondaryTypes: z
|
|
24
|
+
.array(z.string())
|
|
25
|
+
.optional()
|
|
26
|
+
.describe('Secondary types (Live, Compilation, …). Omitted when none.'),
|
|
27
|
+
firstReleaseDate: z.string().optional().describe('First-release date. Omitted when absent.'),
|
|
28
|
+
disambiguation: z.string().optional().describe('Short qualifier. Omitted when absent.'),
|
|
29
|
+
})
|
|
30
|
+
.describe('A release-group in the artist discography (capped to one page — use browse for all).');
|
|
31
|
+
export const getArtistTool = tool('musicbrainz_get_artist', {
|
|
32
|
+
title: 'musicbrainz-mcp-server: get artist',
|
|
33
|
+
description: "Artist profile by MBID: type (person/group/…), country, life span, gender, area, aliases, tags/genres, plus the discography (release-groups) and band-membership / collaboration relationships and external links (Wikidata QID, Discogs, official site — surfaced as url-rels chainable to those servers). The 80% artist-detail call. Discography and relationships are capped at one page (25); for a prolific artist's complete release-group list, call musicbrainz_browse_entities with target_type=release-group and the artist link.",
|
|
34
|
+
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
35
|
+
errors: [
|
|
36
|
+
{
|
|
37
|
+
reason: 'invalid_mbid',
|
|
38
|
+
code: JsonRpcErrorCode.InvalidParams,
|
|
39
|
+
when: 'The MBID is malformed or the all-zeros sentinel (MusicBrainz returns HTTP 400).',
|
|
40
|
+
recovery: `MBID must be a 36-character UUID (e.g. ${MBID_EXAMPLE}). Use musicbrainz_search_entities to find an artist's MBID from its name.`,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
reason: 'entity_not_found',
|
|
44
|
+
code: JsonRpcErrorCode.NotFound,
|
|
45
|
+
when: 'The MBID is well-formed but no artist exists with it (MusicBrainz returns HTTP 404).',
|
|
46
|
+
recovery: 'No artist exists with that MBID. Verify the ID, or search by name with musicbrainz_search_entities.',
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
input: z.object({
|
|
50
|
+
mbid: z.string().describe('Artist MBID (36-character UUID).'),
|
|
51
|
+
inc_release_groups: z
|
|
52
|
+
.boolean()
|
|
53
|
+
.default(true)
|
|
54
|
+
.describe('Include the discography (release-groups). Capped at one page; use browse for the full set.'),
|
|
55
|
+
inc_relationships: z
|
|
56
|
+
.boolean()
|
|
57
|
+
.default(true)
|
|
58
|
+
.describe('Include band-membership / collaboration relationships and external links (url-rels).'),
|
|
59
|
+
}),
|
|
60
|
+
output: z.object({
|
|
61
|
+
mbid: z.string().describe('Artist MBID.'),
|
|
62
|
+
name: z.string().describe('Artist name.'),
|
|
63
|
+
sortName: z.string().optional().describe('Sortable name form. Omitted when absent.'),
|
|
64
|
+
disambiguation: z
|
|
65
|
+
.string()
|
|
66
|
+
.optional()
|
|
67
|
+
.describe('Short qualifier distinguishing same-named artists. Omitted when absent.'),
|
|
68
|
+
type: z
|
|
69
|
+
.string()
|
|
70
|
+
.optional()
|
|
71
|
+
.describe('Artist type (Person, Group, Orchestra, …). Omitted when unknown.'),
|
|
72
|
+
gender: z
|
|
73
|
+
.string()
|
|
74
|
+
.optional()
|
|
75
|
+
.describe('Gender, for person-type artists. Omitted when unknown/inapplicable.'),
|
|
76
|
+
country: z.string().optional().describe('ISO country code. Omitted when unknown.'),
|
|
77
|
+
area: z.string().optional().describe('Associated area name. Omitted when unknown.'),
|
|
78
|
+
lifeSpan: LifeSpanSchema.optional().describe('Birth/death or formation/dissolution span. Omitted when unknown.'),
|
|
79
|
+
aliases: z.array(AliasSchema).describe('Alternate names (may be empty).'),
|
|
80
|
+
tags: z.array(TagSchema).describe('Community tags/genres with vote counts (may be empty).'),
|
|
81
|
+
releaseGroups: z
|
|
82
|
+
.array(ReleaseGroupRefSchema)
|
|
83
|
+
.describe('Discography — release-groups (one page; may be empty or capped).'),
|
|
84
|
+
relationships: z
|
|
85
|
+
.array(RelationSchema)
|
|
86
|
+
.describe('Band membership and collaboration relationships (may be empty).'),
|
|
87
|
+
externalLinks: z
|
|
88
|
+
.array(ExternalLinkSchema)
|
|
89
|
+
.describe('External resource links (url-rels) — Wikidata, Discogs, official site (may be empty).'),
|
|
90
|
+
}),
|
|
91
|
+
enrichment: {
|
|
92
|
+
truncated: z
|
|
93
|
+
.boolean()
|
|
94
|
+
.optional()
|
|
95
|
+
.describe('True when the discography hit the one-page cap and more release-groups exist. Absent when the full set fit in one page.'),
|
|
96
|
+
shown: z
|
|
97
|
+
.number()
|
|
98
|
+
.optional()
|
|
99
|
+
.describe('Number of release-groups returned. Absent when not truncated.'),
|
|
100
|
+
cap: z
|
|
101
|
+
.number()
|
|
102
|
+
.optional()
|
|
103
|
+
.describe('The one-page cap that was applied. Absent when not truncated.'),
|
|
104
|
+
notice: z.string().optional().describe('How to fetch the complete discography when truncated.'),
|
|
105
|
+
},
|
|
106
|
+
async handler(input, ctx) {
|
|
107
|
+
ctx.log.info('musicbrainz_get_artist', { mbid: input.mbid });
|
|
108
|
+
const service = getMusicBrainzService();
|
|
109
|
+
const inc = ['aliases', 'tags', 'genres'];
|
|
110
|
+
if (input.inc_release_groups)
|
|
111
|
+
inc.push('release-groups');
|
|
112
|
+
if (input.inc_relationships)
|
|
113
|
+
inc.push('artist-rels', 'url-rels');
|
|
114
|
+
let raw;
|
|
115
|
+
try {
|
|
116
|
+
raw = await service.lookup('artist', input.mbid, { inc }, ctx, {
|
|
117
|
+
signal: ctx.signal,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
const reason = classifyMbidError(error);
|
|
122
|
+
if (reason)
|
|
123
|
+
throw ctx.fail(reason, undefined, { ...ctx.recoveryFor(reason), mbid: input.mbid });
|
|
124
|
+
throw error;
|
|
125
|
+
}
|
|
126
|
+
const { relationships, externalLinks } = normalizeRelations(raw.relations);
|
|
127
|
+
const releaseGroups = (raw['release-groups'] ?? []).map((rg) => ({
|
|
128
|
+
mbid: rg.id,
|
|
129
|
+
title: rg.title ?? '',
|
|
130
|
+
...(rg['primary-type'] ? { primaryType: rg['primary-type'] } : {}),
|
|
131
|
+
...(rg['secondary-types']?.length ? { secondaryTypes: rg['secondary-types'] } : {}),
|
|
132
|
+
...(rg['first-release-date'] ? { firstReleaseDate: rg['first-release-date'] } : {}),
|
|
133
|
+
...(rg.disambiguation ? { disambiguation: rg.disambiguation } : {}),
|
|
134
|
+
}));
|
|
135
|
+
const lifeSpan = normalizeLifeSpan(raw['life-span']);
|
|
136
|
+
if (input.inc_release_groups && releaseGroups.length >= LOOKUP_PAGE_CAP) {
|
|
137
|
+
ctx.enrich.truncated({ shown: releaseGroups.length, cap: LOOKUP_PAGE_CAP });
|
|
138
|
+
ctx.enrich.notice(`Discography capped at ${LOOKUP_PAGE_CAP}. Call musicbrainz_browse_entities (target_type=release-group, link.artist=${input.mbid}) to enumerate the complete set.`);
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
mbid: raw.id,
|
|
142
|
+
name: raw.name ?? '',
|
|
143
|
+
...(raw['sort-name'] ? { sortName: raw['sort-name'] } : {}),
|
|
144
|
+
...(raw.disambiguation ? { disambiguation: raw.disambiguation } : {}),
|
|
145
|
+
...(raw.type ? { type: raw.type } : {}),
|
|
146
|
+
...(raw.gender ? { gender: raw.gender } : {}),
|
|
147
|
+
...(raw.country ? { country: raw.country } : {}),
|
|
148
|
+
...(raw.area?.name ? { area: raw.area.name } : {}),
|
|
149
|
+
...(lifeSpan ? { lifeSpan } : {}),
|
|
150
|
+
aliases: normalizeAliases(raw.aliases),
|
|
151
|
+
tags: normalizeTags(raw.tags ?? raw.genres),
|
|
152
|
+
releaseGroups,
|
|
153
|
+
relationships,
|
|
154
|
+
externalLinks,
|
|
155
|
+
};
|
|
156
|
+
},
|
|
157
|
+
format: (result) => {
|
|
158
|
+
const lines = [
|
|
159
|
+
`## ${safeText(result.name)}${result.disambiguation ? ` (${safeText(result.disambiguation)})` : ''}`,
|
|
160
|
+
];
|
|
161
|
+
lines.push(`**MBID:** ${result.mbid}`);
|
|
162
|
+
if (result.type)
|
|
163
|
+
lines.push(`**Type:** ${safeText(result.type)}`);
|
|
164
|
+
if (result.gender)
|
|
165
|
+
lines.push(`**Gender:** ${safeText(result.gender)}`);
|
|
166
|
+
if (result.country)
|
|
167
|
+
lines.push(`**Country:** ${result.country}`);
|
|
168
|
+
if (result.area)
|
|
169
|
+
lines.push(`**Area:** ${safeText(result.area)}`);
|
|
170
|
+
const ls = renderLifeSpan(result.lifeSpan);
|
|
171
|
+
if (ls)
|
|
172
|
+
lines.push(ls);
|
|
173
|
+
if (result.sortName)
|
|
174
|
+
lines.push(`**Sort name:** ${safeText(result.sortName)}`);
|
|
175
|
+
const tags = renderTags(result.tags);
|
|
176
|
+
if (tags)
|
|
177
|
+
lines.push(tags);
|
|
178
|
+
const aliases = renderAliases(result.aliases);
|
|
179
|
+
if (aliases)
|
|
180
|
+
lines.push(aliases);
|
|
181
|
+
if (result.releaseGroups.length) {
|
|
182
|
+
lines.push('', '### Discography');
|
|
183
|
+
for (const rg of result.releaseGroups) {
|
|
184
|
+
const meta = [
|
|
185
|
+
rg.primaryType ? safeText(rg.primaryType) : null,
|
|
186
|
+
...(rg.secondaryTypes?.map(safeText) ?? []),
|
|
187
|
+
rg.firstReleaseDate,
|
|
188
|
+
]
|
|
189
|
+
.filter(Boolean)
|
|
190
|
+
.join(', ');
|
|
191
|
+
const dis = rg.disambiguation ? ` [${safeText(rg.disambiguation)}]` : '';
|
|
192
|
+
lines.push(`- **${safeText(rg.title)}**${dis}${meta ? ` (${meta})` : ''} — ${rg.mbid}`);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
lines.push(...renderRelationships(result.relationships));
|
|
196
|
+
lines.push(...renderExternalLinks(result.externalLinks));
|
|
197
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
198
|
+
},
|
|
199
|
+
});
|
|
200
|
+
//# sourceMappingURL=get-artist.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-artist.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-artist.tool.ts"],"names":[],"mappings":"AAAA;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ACtC,MAAM,IAAI,GAAG;oBACX,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI;oBAChD,GAAG,CAAC,EAAE,CAAC,cAAc,EAAE,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;oBAC3C,EAAE,CAAC,gBAAgB;iBACpB;qBACE,MAAM,CAAC,OAAO,CAAC;qBACf,IAAI,CAAC,IAAI,CAAC,CAAC;gBACd,MAAM,GAAG,GAAG,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;gBACzE,KAAK,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;YAC1F,CAAC;QACH,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,GAAG,mBAAmB,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC;QACzD,KAAK,CAAC,IAAI,CAAC,GAAG,mBAAmB,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC;QACzD,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview musicbrainz_get_cover_art — Cover Art Archive images for a release
|
|
3
|
+
* or release-group MBID: front/back flags, image types, full-resolution URLs, and
|
|
4
|
+
* 250/500/1200px thumbnails. Returns an empty image set (not an error) when the
|
|
5
|
+
* entity has no art. Separate from musicbrainz_get_release so art is fetchable
|
|
6
|
+
* without the full record.
|
|
7
|
+
* @module mcp-server/tools/definitions/get-cover-art.tool
|
|
8
|
+
*/
|
|
9
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
10
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
11
|
+
export declare const getCoverArtTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
12
|
+
mbid: z.ZodString;
|
|
13
|
+
entity_type: z.ZodDefault<z.ZodEnum<{
|
|
14
|
+
"release-group": "release-group";
|
|
15
|
+
release: "release";
|
|
16
|
+
}>>;
|
|
17
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
18
|
+
mbid: z.ZodString;
|
|
19
|
+
entityType: z.ZodString;
|
|
20
|
+
representativeRelease: z.ZodOptional<z.ZodString>;
|
|
21
|
+
images: z.ZodArray<z.ZodObject<{
|
|
22
|
+
id: z.ZodString;
|
|
23
|
+
front: z.ZodBoolean;
|
|
24
|
+
back: z.ZodBoolean;
|
|
25
|
+
types: z.ZodArray<z.ZodString>;
|
|
26
|
+
imageUrl: z.ZodString;
|
|
27
|
+
thumbnail250: z.ZodOptional<z.ZodString>;
|
|
28
|
+
thumbnail500: z.ZodOptional<z.ZodString>;
|
|
29
|
+
thumbnail1200: z.ZodOptional<z.ZodString>;
|
|
30
|
+
approved: z.ZodOptional<z.ZodBoolean>;
|
|
31
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
32
|
+
}, z.core.$strip>>;
|
|
33
|
+
}, z.core.$strip>, readonly [{
|
|
34
|
+
readonly reason: "invalid_mbid";
|
|
35
|
+
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
36
|
+
readonly when: "The MBID is malformed or the all-zeros sentinel (the upstream returns HTTP 400).";
|
|
37
|
+
readonly recovery: "MBID must be a 36-character UUID (e.g. a74b1b7f-71a5-4011-9441-d0b5e4122711). Use musicbrainz_search_entities to find a release or release-group MBID.";
|
|
38
|
+
}], {
|
|
39
|
+
readonly hasArt: z.ZodBoolean;
|
|
40
|
+
readonly notice: z.ZodOptional<z.ZodString>;
|
|
41
|
+
}>;
|
|
42
|
+
//# sourceMappingURL=get-cover-art.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-cover-art.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-cover-art.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAY,MAAM,+BAA+B,CAAC;AAgC3E,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyH1B,CAAC"}
|