@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.
Files changed (89) hide show
  1. package/AGENTS.md +466 -0
  2. package/CLAUDE.md +466 -0
  3. package/Dockerfile +121 -0
  4. package/LICENSE +201 -0
  5. package/README.md +329 -0
  6. package/changelog/0.1.x/0.1.0.md +27 -0
  7. package/changelog/template.md +127 -0
  8. package/dist/config/server-config.d.ts +24 -0
  9. package/dist/config/server-config.d.ts.map +1 -0
  10. package/dist/config/server-config.js +90 -0
  11. package/dist/config/server-config.js.map +1 -0
  12. package/dist/index.d.ts +10 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +27 -0
  15. package/dist/index.js.map +1 -0
  16. package/dist/mcp-server/resources/definitions/entity.resource.d.ts +33 -0
  17. package/dist/mcp-server/resources/definitions/entity.resource.d.ts.map +1 -0
  18. package/dist/mcp-server/resources/definitions/entity.resource.js +72 -0
  19. package/dist/mcp-server/resources/definitions/entity.resource.js.map +1 -0
  20. package/dist/mcp-server/resources/definitions/index.d.ts +27 -0
  21. package/dist/mcp-server/resources/definitions/index.d.ts.map +1 -0
  22. package/dist/mcp-server/resources/definitions/index.js +8 -0
  23. package/dist/mcp-server/resources/definitions/index.js.map +1 -0
  24. package/dist/mcp-server/tools/definitions/_shared.d.ts +105 -0
  25. package/dist/mcp-server/tools/definitions/_shared.d.ts.map +1 -0
  26. package/dist/mcp-server/tools/definitions/_shared.js +382 -0
  27. package/dist/mcp-server/tools/definitions/_shared.js.map +1 -0
  28. package/dist/mcp-server/tools/definitions/browse-entities.tool.d.ts +62 -0
  29. package/dist/mcp-server/tools/definitions/browse-entities.tool.d.ts.map +1 -0
  30. package/dist/mcp-server/tools/definitions/browse-entities.tool.js +236 -0
  31. package/dist/mcp-server/tools/definitions/browse-entities.tool.js.map +1 -0
  32. package/dist/mcp-server/tools/definitions/get-artist.tool.d.ts +78 -0
  33. package/dist/mcp-server/tools/definitions/get-artist.tool.d.ts.map +1 -0
  34. package/dist/mcp-server/tools/definitions/get-artist.tool.js +200 -0
  35. package/dist/mcp-server/tools/definitions/get-artist.tool.js.map +1 -0
  36. package/dist/mcp-server/tools/definitions/get-cover-art.tool.d.ts +42 -0
  37. package/dist/mcp-server/tools/definitions/get-cover-art.tool.d.ts.map +1 -0
  38. package/dist/mcp-server/tools/definitions/get-cover-art.tool.js +149 -0
  39. package/dist/mcp-server/tools/definitions/get-cover-art.tool.js.map +1 -0
  40. package/dist/mcp-server/tools/definitions/get-label.tool.d.ts +52 -0
  41. package/dist/mcp-server/tools/definitions/get-label.tool.d.ts.map +1 -0
  42. package/dist/mcp-server/tools/definitions/get-label.tool.js +110 -0
  43. package/dist/mcp-server/tools/definitions/get-label.tool.js.map +1 -0
  44. package/dist/mcp-server/tools/definitions/get-recording.tool.d.ts +58 -0
  45. package/dist/mcp-server/tools/definitions/get-recording.tool.d.ts.map +1 -0
  46. package/dist/mcp-server/tools/definitions/get-recording.tool.js +135 -0
  47. package/dist/mcp-server/tools/definitions/get-recording.tool.js.map +1 -0
  48. package/dist/mcp-server/tools/definitions/get-release-group.tool.d.ts +55 -0
  49. package/dist/mcp-server/tools/definitions/get-release-group.tool.d.ts.map +1 -0
  50. package/dist/mcp-server/tools/definitions/get-release-group.tool.js +140 -0
  51. package/dist/mcp-server/tools/definitions/get-release-group.tool.js.map +1 -0
  52. package/dist/mcp-server/tools/definitions/get-release.tool.d.ts +66 -0
  53. package/dist/mcp-server/tools/definitions/get-release.tool.d.ts.map +1 -0
  54. package/dist/mcp-server/tools/definitions/get-release.tool.js +213 -0
  55. package/dist/mcp-server/tools/definitions/get-release.tool.js.map +1 -0
  56. package/dist/mcp-server/tools/definitions/get-work.tool.d.ts +62 -0
  57. package/dist/mcp-server/tools/definitions/get-work.tool.d.ts.map +1 -0
  58. package/dist/mcp-server/tools/definitions/get-work.tool.js +132 -0
  59. package/dist/mcp-server/tools/definitions/get-work.tool.js.map +1 -0
  60. package/dist/mcp-server/tools/definitions/index.d.ts +468 -0
  61. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -0
  62. package/dist/mcp-server/tools/definitions/index.js +28 -0
  63. package/dist/mcp-server/tools/definitions/index.js.map +1 -0
  64. package/dist/mcp-server/tools/definitions/lookup-identifier.tool.d.ts +59 -0
  65. package/dist/mcp-server/tools/definitions/lookup-identifier.tool.d.ts.map +1 -0
  66. package/dist/mcp-server/tools/definitions/lookup-identifier.tool.js +214 -0
  67. package/dist/mcp-server/tools/definitions/lookup-identifier.tool.js.map +1 -0
  68. package/dist/mcp-server/tools/definitions/search-entities.tool.d.ts +42 -0
  69. package/dist/mcp-server/tools/definitions/search-entities.tool.d.ts.map +1 -0
  70. package/dist/mcp-server/tools/definitions/search-entities.tool.js +187 -0
  71. package/dist/mcp-server/tools/definitions/search-entities.tool.js.map +1 -0
  72. package/dist/services/cover-art/cover-art-service.d.ts +40 -0
  73. package/dist/services/cover-art/cover-art-service.d.ts.map +1 -0
  74. package/dist/services/cover-art/cover-art-service.js +118 -0
  75. package/dist/services/cover-art/cover-art-service.js.map +1 -0
  76. package/dist/services/musicbrainz/musicbrainz-service.d.ts +81 -0
  77. package/dist/services/musicbrainz/musicbrainz-service.d.ts.map +1 -0
  78. package/dist/services/musicbrainz/musicbrainz-service.js +188 -0
  79. package/dist/services/musicbrainz/musicbrainz-service.js.map +1 -0
  80. package/dist/services/musicbrainz/rate-limiter.d.ts +32 -0
  81. package/dist/services/musicbrainz/rate-limiter.d.ts.map +1 -0
  82. package/dist/services/musicbrainz/rate-limiter.js +54 -0
  83. package/dist/services/musicbrainz/rate-limiter.js.map +1 -0
  84. package/dist/services/musicbrainz/types.d.ts +301 -0
  85. package/dist/services/musicbrainz/types.d.ts.map +1 -0
  86. package/dist/services/musicbrainz/types.js +11 -0
  87. package/dist/services/musicbrainz/types.js.map +1 -0
  88. package/package.json +103 -0
  89. package/server.json +111 -0
@@ -0,0 +1,149 @@
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 { tool, z } from '@cyanheads/mcp-ts-core';
10
+ import { JsonRpcErrorCode, McpError } from '@cyanheads/mcp-ts-core/errors';
11
+ import { getCoverArtService } from '../../../services/cover-art/cover-art-service.js';
12
+ import { MBID_EXAMPLE, safeText } from './_shared.js';
13
+ const ImageSchema = z
14
+ .object({
15
+ id: z.string().describe('Cover Art Archive image ID.'),
16
+ front: z.boolean().describe('Whether this is a designated front image.'),
17
+ back: z.boolean().describe('Whether this is a designated back image.'),
18
+ types: z
19
+ .array(z.string())
20
+ .describe('Image types (Front, Back, Booklet, Medium, …; may be empty).'),
21
+ imageUrl: z
22
+ .string()
23
+ .describe('Full-resolution image URL (linked, not rehosted — copyright stays with the rights holder).'),
24
+ thumbnail250: z.string().optional().describe('250px thumbnail URL. Omitted when unavailable.'),
25
+ thumbnail500: z.string().optional().describe('500px thumbnail URL. Omitted when unavailable.'),
26
+ thumbnail1200: z
27
+ .string()
28
+ .optional()
29
+ .describe('1200px thumbnail URL. Omitted when unavailable.'),
30
+ approved: z
31
+ .boolean()
32
+ .optional()
33
+ .describe('Whether the image is community-approved. Omitted when unknown.'),
34
+ comment: z.string().optional().describe('Editor comment on the image. Omitted when absent.'),
35
+ })
36
+ .describe('One cover-art image with its full URL and thumbnails.');
37
+ export const getCoverArtTool = tool('musicbrainz_get_cover_art', {
38
+ title: 'musicbrainz-mcp-server: get cover art',
39
+ description: "Cover Art Archive images for a release or release-group MBID: front/back flags, image types, full-resolution URLs, and 250/500/1200px thumbnail URLs. Returns an empty image set (NOT an error) when the entity has no art — absence of art is information. Art is served at the release level; a release-group MBID resolves to a representative release's art automatically. URLs are linked, never rehosted — image copyright stays with the rights holders (only MusicBrainz core metadata is CC0).",
40
+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
41
+ errors: [
42
+ {
43
+ reason: 'invalid_mbid',
44
+ code: JsonRpcErrorCode.InvalidParams,
45
+ when: 'The MBID is malformed or the all-zeros sentinel (the upstream returns HTTP 400).',
46
+ recovery: `MBID must be a 36-character UUID (e.g. ${MBID_EXAMPLE}). Use musicbrainz_search_entities to find a release or release-group MBID.`,
47
+ },
48
+ ],
49
+ input: z.object({
50
+ mbid: z.string().describe('Release or release-group MBID (36-character UUID).'),
51
+ entity_type: z
52
+ .enum(['release', 'release-group'])
53
+ .default('release')
54
+ .describe('Whether the MBID is a release (default) or a release-group.'),
55
+ }),
56
+ output: z.object({
57
+ mbid: z.string().describe('The MBID that was queried.'),
58
+ entityType: z.string().describe('Whether the MBID was treated as a release or release-group.'),
59
+ representativeRelease: z
60
+ .string()
61
+ .optional()
62
+ .describe('For a release-group query, the release MBID whose art was returned. Omitted for direct release queries.'),
63
+ images: z.array(ImageSchema).describe('Cover-art images (empty when the entity has no art).'),
64
+ }),
65
+ enrichment: {
66
+ hasArt: z.boolean().describe('Whether any cover art exists for this entity.'),
67
+ notice: z.string().optional().describe('Notice when no art exists for the entity.'),
68
+ },
69
+ async handler(input, ctx) {
70
+ ctx.log.info('musicbrainz_get_cover_art', { mbid: input.mbid, entityType: input.entity_type });
71
+ const service = getCoverArtService();
72
+ let raw;
73
+ try {
74
+ raw = await service.getImages(input.entity_type, input.mbid, ctx, { signal: ctx.signal });
75
+ }
76
+ catch (error) {
77
+ // 404 (no art) is mapped to an empty set inside the service; a 400 (malformed
78
+ // MBID) still surfaces here as InvalidParams.
79
+ if (error instanceof McpError && error.code === JsonRpcErrorCode.InvalidParams) {
80
+ throw ctx.fail('invalid_mbid', undefined, {
81
+ ...ctx.recoveryFor('invalid_mbid'),
82
+ mbid: input.mbid,
83
+ });
84
+ }
85
+ throw error;
86
+ }
87
+ const images = (raw.images ?? []).map((img) => ({
88
+ id: String(img.id ?? ''),
89
+ front: img.front === true,
90
+ back: img.back === true,
91
+ types: img.types ?? [],
92
+ imageUrl: img.image ?? '',
93
+ ...(img.thumbnails?.['250'] ? { thumbnail250: img.thumbnails['250'] } : {}),
94
+ ...(img.thumbnails?.['500'] ? { thumbnail500: img.thumbnails['500'] } : {}),
95
+ ...(img.thumbnails?.['1200'] ? { thumbnail1200: img.thumbnails['1200'] } : {}),
96
+ ...(typeof img.approved === 'boolean' ? { approved: img.approved } : {}),
97
+ ...(img.comment ? { comment: img.comment } : {}),
98
+ }));
99
+ ctx.enrich({ hasArt: images.length > 0 });
100
+ if (images.length === 0) {
101
+ ctx.enrich.notice(`No cover art exists for ${input.entity_type} ${input.mbid}. This is not an error — the Cover Art Archive simply has no images for it.`);
102
+ }
103
+ // The representative release MBID is the trailing path segment of the `release`
104
+ // URL the CAA returns (present on release-group lookups after the 307 redirect).
105
+ const representativeRelease = raw.release?.split('/').filter(Boolean).pop();
106
+ return {
107
+ mbid: input.mbid,
108
+ entityType: input.entity_type,
109
+ ...(input.entity_type === 'release-group' && representativeRelease
110
+ ? { representativeRelease }
111
+ : {}),
112
+ images,
113
+ };
114
+ },
115
+ format: (result) => {
116
+ const lines = [`## Cover art: ${result.entityType} ${result.mbid}`];
117
+ if (result.representativeRelease)
118
+ lines.push(`**Representative release:** ${result.representativeRelease}`);
119
+ if (result.images.length === 0) {
120
+ lines.push('', '_No cover art available for this entity._');
121
+ }
122
+ else {
123
+ lines.push(`**Images:** ${result.images.length}`);
124
+ for (const img of result.images) {
125
+ const flags = [
126
+ img.front ? 'front' : null,
127
+ img.back ? 'back' : null,
128
+ ...img.types.map(safeText),
129
+ ]
130
+ .filter(Boolean)
131
+ .join(', ');
132
+ lines.push(`\n### Image ${safeText(img.id)}${flags ? ` (${flags})` : ''}`);
133
+ lines.push(`**Full:** ${safeText(img.imageUrl)}`);
134
+ if (img.thumbnail250)
135
+ lines.push(`**250px:** ${safeText(img.thumbnail250)}`);
136
+ if (img.thumbnail500)
137
+ lines.push(`**500px:** ${safeText(img.thumbnail500)}`);
138
+ if (img.thumbnail1200)
139
+ lines.push(`**1200px:** ${safeText(img.thumbnail1200)}`);
140
+ if (typeof img.approved === 'boolean')
141
+ lines.push(`**Approved:** ${img.approved ? 'yes' : 'no'}`);
142
+ if (img.comment)
143
+ lines.push(`**Comment:** ${safeText(img.comment)}`);
144
+ }
145
+ }
146
+ return [{ type: 'text', text: lines.join('\n') }];
147
+ },
148
+ });
149
+ //# sourceMappingURL=get-cover-art.tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-cover-art.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-cover-art.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAE/E,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEtD,MAAM,WAAW,GAAG,CAAC;KAClB,MAAM,CAAC;IACN,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;IACtD,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;IACxE,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;IACtE,KAAK,EAAE,CAAC;SACL,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,CAAC,8DAA8D,CAAC;IAC3E,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,QAAQ,CACP,4FAA4F,CAC7F;IACH,YAAY,EAAE,CAAC,CAAC,MAAM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AAgB,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YACvE,CAAC;QACH,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,52 @@
1
+ /**
2
+ * @fileoverview musicbrainz_get_label — label by MBID: type, country, life span,
3
+ * label code, area, aliases, tags, and external links. Its releases are a
4
+ * potentially huge linked set — fetch them via musicbrainz_browse_entities
5
+ * (release by label), not here.
6
+ * @module mcp-server/tools/definitions/get-label.tool
7
+ */
8
+ import { z } from '@cyanheads/mcp-ts-core';
9
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
10
+ export declare const getLabelTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
11
+ mbid: z.ZodString;
12
+ }, z.core.$strip>, z.ZodObject<{
13
+ mbid: z.ZodString;
14
+ name: z.ZodString;
15
+ sortName: z.ZodOptional<z.ZodString>;
16
+ disambiguation: z.ZodOptional<z.ZodString>;
17
+ type: z.ZodOptional<z.ZodString>;
18
+ labelCode: z.ZodOptional<z.ZodNumber>;
19
+ country: z.ZodOptional<z.ZodString>;
20
+ area: z.ZodOptional<z.ZodString>;
21
+ lifeSpan: z.ZodOptional<z.ZodObject<{
22
+ begin: z.ZodOptional<z.ZodString>;
23
+ end: z.ZodOptional<z.ZodString>;
24
+ ended: z.ZodOptional<z.ZodBoolean>;
25
+ }, z.core.$strip>>;
26
+ aliases: z.ZodArray<z.ZodObject<{
27
+ name: z.ZodString;
28
+ sortName: z.ZodOptional<z.ZodString>;
29
+ type: z.ZodOptional<z.ZodString>;
30
+ locale: z.ZodOptional<z.ZodString>;
31
+ primary: z.ZodOptional<z.ZodBoolean>;
32
+ }, z.core.$strip>>;
33
+ tags: z.ZodArray<z.ZodObject<{
34
+ name: z.ZodString;
35
+ count: z.ZodNumber;
36
+ }, z.core.$strip>>;
37
+ externalLinks: z.ZodArray<z.ZodObject<{
38
+ type: z.ZodString;
39
+ resource: z.ZodString;
40
+ }, z.core.$strip>>;
41
+ }, z.core.$strip>, readonly [{
42
+ readonly reason: "invalid_mbid";
43
+ readonly code: JsonRpcErrorCode.InvalidParams;
44
+ readonly when: "The MBID is malformed or the all-zeros sentinel (MusicBrainz returns HTTP 400).";
45
+ readonly recovery: "MBID must be a 36-character UUID (e.g. a74b1b7f-71a5-4011-9441-d0b5e4122711). Use musicbrainz_search_entities (entity_type=label) to find one from a name.";
46
+ }, {
47
+ readonly reason: "entity_not_found";
48
+ readonly code: JsonRpcErrorCode.NotFound;
49
+ readonly when: "The MBID is well-formed but no label exists with it (MusicBrainz returns HTTP 404).";
50
+ readonly recovery: "No label exists with that MBID. Verify the ID, or search by name with musicbrainz_search_entities.";
51
+ }], undefined>;
52
+ //# sourceMappingURL=get-label.tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-label.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-label.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAqBjE,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA0GvB,CAAC"}
@@ -0,0 +1,110 @@
1
+ /**
2
+ * @fileoverview musicbrainz_get_label — label by MBID: type, country, life span,
3
+ * label code, area, aliases, tags, and external links. Its releases are a
4
+ * potentially huge linked set — fetch them via musicbrainz_browse_entities
5
+ * (release by label), not here.
6
+ * @module mcp-server/tools/definitions/get-label.tool
7
+ */
8
+ import { tool, z } from '@cyanheads/mcp-ts-core';
9
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
10
+ import { getMusicBrainzService } from '../../../services/musicbrainz/musicbrainz-service.js';
11
+ import { AliasSchema, classifyMbidError, ExternalLinkSchema, LifeSpanSchema, MBID_EXAMPLE, normalizeAliases, normalizeLifeSpan, normalizeRelations, normalizeTags, renderAliases, renderExternalLinks, renderLifeSpan, renderTags, safeText, TagSchema, } from './_shared.js';
12
+ export const getLabelTool = tool('musicbrainz_get_label', {
13
+ title: 'musicbrainz-mcp-server: get label',
14
+ description: "Label by MBID: type (Original Production, Reissue, Imprint, …), country, life span, label code (the LC number), area, aliases, tags, and external links (url-rels — Wikidata, Discogs, official site). A label's releases are a potentially huge linked set (a major label can have tens of thousands), so they are NOT embedded here — enumerate them with musicbrainz_browse_entities (target_type=release, link.label).",
15
+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
16
+ errors: [
17
+ {
18
+ reason: 'invalid_mbid',
19
+ code: JsonRpcErrorCode.InvalidParams,
20
+ when: 'The MBID is malformed or the all-zeros sentinel (MusicBrainz returns HTTP 400).',
21
+ recovery: `MBID must be a 36-character UUID (e.g. ${MBID_EXAMPLE}). Use musicbrainz_search_entities (entity_type=label) to find one from a name.`,
22
+ },
23
+ {
24
+ reason: 'entity_not_found',
25
+ code: JsonRpcErrorCode.NotFound,
26
+ when: 'The MBID is well-formed but no label exists with it (MusicBrainz returns HTTP 404).',
27
+ recovery: 'No label exists with that MBID. Verify the ID, or search by name with musicbrainz_search_entities.',
28
+ },
29
+ ],
30
+ input: z.object({
31
+ mbid: z.string().describe('Label MBID (36-character UUID).'),
32
+ }),
33
+ output: z.object({
34
+ mbid: z.string().describe('Label MBID.'),
35
+ name: z.string().describe('Label name.'),
36
+ sortName: z.string().optional().describe('Sortable name form. Omitted when absent.'),
37
+ disambiguation: z.string().optional().describe('Short qualifier. Omitted when absent.'),
38
+ type: z.string().optional().describe('Label type. Omitted when unknown.'),
39
+ labelCode: z
40
+ .number()
41
+ .optional()
42
+ .describe('Label code (LC number), without the "LC" prefix. Omitted when absent.'),
43
+ country: z.string().optional().describe('ISO country code. Omitted when unknown.'),
44
+ area: z.string().optional().describe('Associated area name. Omitted when unknown.'),
45
+ lifeSpan: LifeSpanSchema.optional().describe('Founding/dissolution span. Omitted when unknown.'),
46
+ aliases: z.array(AliasSchema).describe('Alternate names (may be empty).'),
47
+ tags: z.array(TagSchema).describe('Community tags/genres (may be empty).'),
48
+ externalLinks: z
49
+ .array(ExternalLinkSchema)
50
+ .describe('External resource links (url-rels) (may be empty).'),
51
+ }),
52
+ async handler(input, ctx) {
53
+ ctx.log.info('musicbrainz_get_label', { mbid: input.mbid });
54
+ const service = getMusicBrainzService();
55
+ let raw;
56
+ try {
57
+ raw = await service.lookup('label', input.mbid, { inc: ['aliases', 'tags', 'genres', 'url-rels'] }, ctx, { signal: ctx.signal });
58
+ }
59
+ catch (error) {
60
+ const reason = classifyMbidError(error);
61
+ if (reason)
62
+ throw ctx.fail(reason, undefined, { ...ctx.recoveryFor(reason), mbid: input.mbid });
63
+ throw error;
64
+ }
65
+ const { externalLinks } = normalizeRelations(raw.relations);
66
+ const lifeSpan = normalizeLifeSpan(raw['life-span']);
67
+ return {
68
+ mbid: raw.id,
69
+ name: raw.name ?? '',
70
+ ...(raw['sort-name'] ? { sortName: raw['sort-name'] } : {}),
71
+ ...(raw.disambiguation ? { disambiguation: raw.disambiguation } : {}),
72
+ ...(raw.type ? { type: raw.type } : {}),
73
+ ...(typeof raw['label-code'] === 'number' ? { labelCode: raw['label-code'] } : {}),
74
+ ...(raw.country ? { country: raw.country } : {}),
75
+ ...(raw.area?.name ? { area: raw.area.name } : {}),
76
+ ...(lifeSpan ? { lifeSpan } : {}),
77
+ aliases: normalizeAliases(raw.aliases),
78
+ tags: normalizeTags(raw.tags ?? raw.genres),
79
+ externalLinks,
80
+ };
81
+ },
82
+ format: (result) => {
83
+ const lines = [
84
+ `## ${safeText(result.name)}${result.disambiguation ? ` (${safeText(result.disambiguation)})` : ''}`,
85
+ ];
86
+ lines.push(`**MBID:** ${result.mbid}`);
87
+ if (result.type)
88
+ lines.push(`**Type:** ${safeText(result.type)}`);
89
+ if (typeof result.labelCode === 'number')
90
+ lines.push(`**Label code:** LC ${result.labelCode}`);
91
+ if (result.country)
92
+ lines.push(`**Country:** ${result.country}`);
93
+ if (result.area)
94
+ lines.push(`**Area:** ${safeText(result.area)}`);
95
+ const ls = renderLifeSpan(result.lifeSpan);
96
+ if (ls)
97
+ lines.push(ls);
98
+ if (result.sortName)
99
+ lines.push(`**Sort name:** ${safeText(result.sortName)}`);
100
+ const tags = renderTags(result.tags);
101
+ if (tags)
102
+ lines.push(tags);
103
+ const aliases = renderAliases(result.aliases);
104
+ if (aliases)
105
+ lines.push(aliases);
106
+ lines.push(...renderExternalLinks(result.externalLinks));
107
+ return [{ type: 'text', text: lines.join('\n') }];
108
+ },
109
+ });
110
+ //# sourceMappingURL=get-label.tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-label.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-label.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAEtF,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,UAAU,EACV,QAAQ,EACR,SAAS,GACV,MAAM,cAAc,CAAC;AAEtB,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,uBAAuB,EAAE;IACxD,KAAK,EAAE,mCAAmC;IAC1C,WAAW,EACT,4ZAA4Z;IAC9Z,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EA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M,CAAC,OAAO,CAAC,CAAC;QAC9C,IAAI,OAAO;YAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACjC,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,58 @@
1
+ /**
2
+ * @fileoverview musicbrainz_get_recording — recording (a specific performance/
3
+ * track) by MBID: length, artist credits, ISRCs, the releases it appears on, the
4
+ * work(s) it performs, and performance/production relationships (who played,
5
+ * produced, engineered, conducted — with role and credited artist MBID).
6
+ * @module mcp-server/tools/definitions/get-recording.tool
7
+ */
8
+ import { z } from '@cyanheads/mcp-ts-core';
9
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
10
+ export declare const getRecordingTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
11
+ mbid: z.ZodString;
12
+ inc_relationships: z.ZodDefault<z.ZodBoolean>;
13
+ }, z.core.$strip>, z.ZodObject<{
14
+ mbid: z.ZodString;
15
+ title: z.ZodString;
16
+ disambiguation: z.ZodOptional<z.ZodString>;
17
+ length: z.ZodOptional<z.ZodString>;
18
+ artistCredit: z.ZodArray<z.ZodObject<{
19
+ name: z.ZodString;
20
+ artistId: z.ZodString;
21
+ artistName: z.ZodString;
22
+ joinPhrase: z.ZodOptional<z.ZodString>;
23
+ }, z.core.$strip>>;
24
+ artistCreditString: z.ZodString;
25
+ isrcs: z.ZodArray<z.ZodString>;
26
+ firstReleaseDate: z.ZodOptional<z.ZodString>;
27
+ releases: z.ZodArray<z.ZodObject<{
28
+ mbid: z.ZodString;
29
+ title: z.ZodString;
30
+ date: z.ZodOptional<z.ZodString>;
31
+ country: z.ZodOptional<z.ZodString>;
32
+ }, z.core.$strip>>;
33
+ relationships: z.ZodArray<z.ZodObject<{
34
+ type: z.ZodString;
35
+ direction: z.ZodOptional<z.ZodString>;
36
+ attributes: z.ZodOptional<z.ZodArray<z.ZodString>>;
37
+ targetType: z.ZodString;
38
+ targetId: z.ZodOptional<z.ZodString>;
39
+ targetName: z.ZodOptional<z.ZodString>;
40
+ begin: z.ZodOptional<z.ZodString>;
41
+ end: z.ZodOptional<z.ZodString>;
42
+ }, z.core.$strip>>;
43
+ externalLinks: z.ZodArray<z.ZodObject<{
44
+ type: z.ZodString;
45
+ resource: z.ZodString;
46
+ }, z.core.$strip>>;
47
+ }, z.core.$strip>, readonly [{
48
+ readonly reason: "invalid_mbid";
49
+ readonly code: JsonRpcErrorCode.InvalidParams;
50
+ readonly when: "The MBID is malformed or the all-zeros sentinel (MusicBrainz returns HTTP 400).";
51
+ readonly recovery: "MBID must be a 36-character UUID (e.g. a74b1b7f-71a5-4011-9441-d0b5e4122711). Use musicbrainz_search_entities (entity_type=recording) to find one from a title.";
52
+ }, {
53
+ readonly reason: "entity_not_found";
54
+ readonly code: JsonRpcErrorCode.NotFound;
55
+ readonly when: "The MBID is well-formed but no recording exists with it (MusicBrainz returns HTTP 404).";
56
+ readonly recovery: "No recording exists with that MBID. Verify the ID, or search by title with musicbrainz_search_entities.";
57
+ }], undefined>;
58
+ //# sourceMappingURL=get-recording.tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-recording.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-recording.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AA4BjE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA0H3B,CAAC"}
@@ -0,0 +1,135 @@
1
+ /**
2
+ * @fileoverview musicbrainz_get_recording — recording (a specific performance/
3
+ * track) by MBID: length, artist credits, ISRCs, the releases it appears on, the
4
+ * work(s) it performs, and performance/production relationships (who played,
5
+ * produced, engineered, conducted — with role and credited artist MBID).
6
+ * @module mcp-server/tools/definitions/get-recording.tool
7
+ */
8
+ import { tool, z } from '@cyanheads/mcp-ts-core';
9
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
10
+ import { getMusicBrainzService } from '../../../services/musicbrainz/musicbrainz-service.js';
11
+ import { ArtistCreditSchema, artistCreditString, classifyMbidError, ExternalLinkSchema, formatDuration, MBID_EXAMPLE, normalizeArtistCredits, normalizeRelations, RelationSchema, renderArtistCredits, renderExternalLinks, renderRelationships, safeText, } from './_shared.js';
12
+ const ReleaseAppearanceSchema = z
13
+ .object({
14
+ mbid: z.string().describe('Release MBID — chain to musicbrainz_get_release.'),
15
+ title: z.string().describe('Release title.'),
16
+ date: z.string().optional().describe('Release date. Omitted when absent.'),
17
+ country: z.string().optional().describe('Release country code. Omitted when absent.'),
18
+ })
19
+ .describe('A release this recording appears on.');
20
+ export const getRecordingTool = tool('musicbrainz_get_recording', {
21
+ title: 'musicbrainz-mcp-server: get recording',
22
+ description: 'Recording (a specific performance/track, distinct from the abstract work) by MBID: length, artist credits, ISRCs, the releases it appears on, the work(s) it performs (work-rels — chain to musicbrainz_get_work), and performance/production relationships (who played, produced, engineered, conducted — each with the role and the credited artist MBID). Relationships are capped at one page; for a heavily-covered recording call musicbrainz_browse_entities with target_type=recording and link.work.',
23
+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
24
+ errors: [
25
+ {
26
+ reason: 'invalid_mbid',
27
+ code: JsonRpcErrorCode.InvalidParams,
28
+ when: 'The MBID is malformed or the all-zeros sentinel (MusicBrainz returns HTTP 400).',
29
+ recovery: `MBID must be a 36-character UUID (e.g. ${MBID_EXAMPLE}). Use musicbrainz_search_entities (entity_type=recording) to find one from a title.`,
30
+ },
31
+ {
32
+ reason: 'entity_not_found',
33
+ code: JsonRpcErrorCode.NotFound,
34
+ when: 'The MBID is well-formed but no recording exists with it (MusicBrainz returns HTTP 404).',
35
+ recovery: 'No recording exists with that MBID. Verify the ID, or search by title with musicbrainz_search_entities.',
36
+ },
37
+ ],
38
+ input: z.object({
39
+ mbid: z.string().describe('Recording MBID (36-character UUID).'),
40
+ inc_relationships: z
41
+ .boolean()
42
+ .default(true)
43
+ .describe('Include performance/production relationships (performers, producers, engineers) and work-rels.'),
44
+ }),
45
+ output: z.object({
46
+ mbid: z.string().describe('Recording MBID.'),
47
+ title: z.string().describe('Recording title.'),
48
+ disambiguation: z.string().optional().describe('Short qualifier. Omitted when absent.'),
49
+ length: z.string().optional().describe('Recording length as m:ss. Omitted when unknown.'),
50
+ artistCredit: z.array(ArtistCreditSchema).describe('Credited artists (may be empty).'),
51
+ artistCreditString: z
52
+ .string()
53
+ .describe('Display string of the artist credit with join phrases.'),
54
+ isrcs: z.array(z.string()).describe('ISRCs assigned to this recording (may be empty).'),
55
+ firstReleaseDate: z
56
+ .string()
57
+ .optional()
58
+ .describe('Earliest release date for this recording. Omitted when absent.'),
59
+ releases: z
60
+ .array(ReleaseAppearanceSchema)
61
+ .describe('Releases this recording appears on (may be empty).'),
62
+ relationships: z
63
+ .array(RelationSchema)
64
+ .describe('Performance/production relationships and work-rels (may be empty).'),
65
+ externalLinks: z
66
+ .array(ExternalLinkSchema)
67
+ .describe('External resource links (url-rels) (may be empty).'),
68
+ }),
69
+ async handler(input, ctx) {
70
+ ctx.log.info('musicbrainz_get_recording', { mbid: input.mbid });
71
+ const service = getMusicBrainzService();
72
+ const inc = ['artist-credits', 'releases', 'isrcs'];
73
+ if (input.inc_relationships)
74
+ inc.push('artist-rels', 'work-rels', 'url-rels');
75
+ let raw;
76
+ try {
77
+ raw = await service.lookup('recording', input.mbid, { inc }, ctx, {
78
+ signal: ctx.signal,
79
+ });
80
+ }
81
+ catch (error) {
82
+ const reason = classifyMbidError(error);
83
+ if (reason)
84
+ throw ctx.fail(reason, undefined, { ...ctx.recoveryFor(reason), mbid: input.mbid });
85
+ throw error;
86
+ }
87
+ const credits = normalizeArtistCredits(raw['artist-credit']);
88
+ const { relationships, externalLinks } = normalizeRelations(raw.relations);
89
+ const length = formatDuration(raw.length);
90
+ const releases = (raw.releases ?? []).map((r) => ({
91
+ mbid: r.id,
92
+ title: r.title ?? '',
93
+ ...(r.date ? { date: r.date } : {}),
94
+ ...(r.country ? { country: r.country } : {}),
95
+ }));
96
+ return {
97
+ mbid: raw.id,
98
+ title: raw.title ?? '',
99
+ ...(raw.disambiguation ? { disambiguation: raw.disambiguation } : {}),
100
+ ...(length ? { length } : {}),
101
+ artistCredit: credits,
102
+ artistCreditString: artistCreditString(credits),
103
+ isrcs: raw.isrcs ?? [],
104
+ ...(raw['first-release-date'] ? { firstReleaseDate: raw['first-release-date'] } : {}),
105
+ releases,
106
+ relationships,
107
+ externalLinks,
108
+ };
109
+ },
110
+ format: (result) => {
111
+ const lines = [
112
+ `## ${safeText(result.title)}${result.disambiguation ? ` (${safeText(result.disambiguation)})` : ''}`,
113
+ ];
114
+ lines.push(`**MBID:** ${result.mbid}`);
115
+ lines.push(`**Artist:** ${safeText(result.artistCreditString)}`);
116
+ if (result.length)
117
+ lines.push(`**Length:** ${result.length}`);
118
+ if (result.firstReleaseDate)
119
+ lines.push(`**First release:** ${result.firstReleaseDate}`);
120
+ if (result.isrcs.length)
121
+ lines.push(`**ISRCs:** ${result.isrcs.join(', ')}`);
122
+ lines.push(...renderArtistCredits(result.artistCredit));
123
+ if (result.releases.length) {
124
+ lines.push('', `### Appears on (${result.releases.length})`);
125
+ for (const r of result.releases) {
126
+ const meta = [r.date, r.country].filter(Boolean).join(', ');
127
+ lines.push(`- **${safeText(r.title)}**${meta ? ` (${meta})` : ''} — ${r.mbid}`);
128
+ }
129
+ }
130
+ lines.push(...renderRelationships(result.relationships));
131
+ lines.push(...renderExternalLinks(result.externalLinks));
132
+ return [{ type: 'text', text: lines.join('\n') }];
133
+ },
134
+ });
135
+ //# sourceMappingURL=get-recording.tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-recording.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-recording.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAEtF,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,QAAQ,GACT,MAAM,cAAc,CAAC;AAEtB,MAAM,uBAAuB,GAAG,CAAC;KAC9B,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kDAAkD,CAAC;IAC7E,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IAC5C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;IAC1E,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;CACtF,CAAC;KACD,QAAQ,CAAC,sCAAsC,CAAC,CAAC;AAEpD,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC,2BAA2B,EAAE;IAChE,KAAK,EAAE,uCAAuC;IAC9C,WAAW,EACT,+eAA+e;IACjf,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,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MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC5D,KAAK,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;YAClF,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,55 @@
1
+ /**
2
+ * @fileoverview musicbrainz_get_release_group — release-group ("the album" above
3
+ * specific pressings) by MBID: primary + secondary type, first-release date,
4
+ * artist credit, the list of releases (editions), tags/genres, and whether cover
5
+ * art exists. Use musicbrainz_get_release for a specific edition's tracklist.
6
+ * @module mcp-server/tools/definitions/get-release-group.tool
7
+ */
8
+ import { z } from '@cyanheads/mcp-ts-core';
9
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
10
+ export declare const getReleaseGroupTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
11
+ mbid: z.ZodString;
12
+ }, z.core.$strip>, z.ZodObject<{
13
+ mbid: z.ZodString;
14
+ title: z.ZodString;
15
+ disambiguation: z.ZodOptional<z.ZodString>;
16
+ primaryType: z.ZodOptional<z.ZodString>;
17
+ secondaryTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
18
+ firstReleaseDate: z.ZodOptional<z.ZodString>;
19
+ artistCredit: z.ZodArray<z.ZodObject<{
20
+ name: z.ZodString;
21
+ artistId: z.ZodString;
22
+ artistName: z.ZodString;
23
+ joinPhrase: z.ZodOptional<z.ZodString>;
24
+ }, z.core.$strip>>;
25
+ artistCreditString: z.ZodString;
26
+ releases: z.ZodArray<z.ZodObject<{
27
+ mbid: z.ZodString;
28
+ title: z.ZodString;
29
+ date: z.ZodOptional<z.ZodString>;
30
+ country: z.ZodOptional<z.ZodString>;
31
+ status: z.ZodOptional<z.ZodString>;
32
+ disambiguation: z.ZodOptional<z.ZodString>;
33
+ }, z.core.$strip>>;
34
+ tags: z.ZodArray<z.ZodObject<{
35
+ name: z.ZodString;
36
+ count: z.ZodNumber;
37
+ }, z.core.$strip>>;
38
+ coverArt: z.ZodObject<{
39
+ exists: z.ZodBoolean;
40
+ count: z.ZodOptional<z.ZodNumber>;
41
+ front: z.ZodOptional<z.ZodBoolean>;
42
+ back: z.ZodOptional<z.ZodBoolean>;
43
+ }, z.core.$strip>;
44
+ }, z.core.$strip>, readonly [{
45
+ readonly reason: "invalid_mbid";
46
+ readonly code: JsonRpcErrorCode.InvalidParams;
47
+ readonly when: "The MBID is malformed or the all-zeros sentinel (MusicBrainz returns HTTP 400).";
48
+ readonly recovery: "MBID must be a 36-character UUID (e.g. a74b1b7f-71a5-4011-9441-d0b5e4122711). Use musicbrainz_search_entities (entity_type=release-group) to find one from a title.";
49
+ }, {
50
+ readonly reason: "entity_not_found";
51
+ readonly code: JsonRpcErrorCode.NotFound;
52
+ readonly when: "The MBID is well-formed but no release-group exists with it (MusicBrainz returns HTTP 404).";
53
+ readonly recovery: "No release-group exists with that MBID. Verify the ID, or search by title with musicbrainz_search_entities.";
54
+ }], undefined>;
55
+ //# sourceMappingURL=get-release-group.tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-release-group.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-release-group.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAiCjE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAgI9B,CAAC"}