@cyanheads/cern-inspire-mcp-server 0.1.1

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 (90) hide show
  1. package/AGENTS.md +504 -0
  2. package/CLAUDE.md +504 -0
  3. package/Dockerfile +177 -0
  4. package/LICENSE +201 -0
  5. package/README.md +311 -0
  6. package/changelog/0.1.x/0.1.0.md +9 -0
  7. package/changelog/0.1.x/0.1.1.md +22 -0
  8. package/changelog/template.md +151 -0
  9. package/dist/index.d.ts +7 -0
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +23 -0
  12. package/dist/index.js.map +1 -0
  13. package/dist/mcp-server/resources/definitions/index.d.ts +106 -0
  14. package/dist/mcp-server/resources/definitions/index.d.ts.map +1 -0
  15. package/dist/mcp-server/resources/definitions/index.js +7 -0
  16. package/dist/mcp-server/resources/definitions/index.js.map +1 -0
  17. package/dist/mcp-server/resources/definitions/inspire-literature.resource.d.ts +110 -0
  18. package/dist/mcp-server/resources/definitions/inspire-literature.resource.d.ts.map +1 -0
  19. package/dist/mcp-server/resources/definitions/inspire-literature.resource.js +69 -0
  20. package/dist/mcp-server/resources/definitions/inspire-literature.resource.js.map +1 -0
  21. package/dist/mcp-server/tools/definitions/export-citations.tool.d.ts +65 -0
  22. package/dist/mcp-server/tools/definitions/export-citations.tool.d.ts.map +1 -0
  23. package/dist/mcp-server/tools/definitions/export-citations.tool.js +120 -0
  24. package/dist/mcp-server/tools/definitions/export-citations.tool.js.map +1 -0
  25. package/dist/mcp-server/tools/definitions/get-citation-summary.tool.d.ts +159 -0
  26. package/dist/mcp-server/tools/definitions/get-citation-summary.tool.d.ts.map +1 -0
  27. package/dist/mcp-server/tools/definitions/get-citation-summary.tool.js +262 -0
  28. package/dist/mcp-server/tools/definitions/get-citation-summary.tool.js.map +1 -0
  29. package/dist/mcp-server/tools/definitions/get-paper.tool.d.ts +195 -0
  30. package/dist/mcp-server/tools/definitions/get-paper.tool.d.ts.map +1 -0
  31. package/dist/mcp-server/tools/definitions/get-paper.tool.js +356 -0
  32. package/dist/mcp-server/tools/definitions/get-paper.tool.js.map +1 -0
  33. package/dist/mcp-server/tools/definitions/index.d.ts +675 -0
  34. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -0
  35. package/dist/mcp-server/tools/definitions/index.js +23 -0
  36. package/dist/mcp-server/tools/definitions/index.js.map +1 -0
  37. package/dist/mcp-server/tools/definitions/list-reference.tool.d.ts +33 -0
  38. package/dist/mcp-server/tools/definitions/list-reference.tool.d.ts.map +1 -0
  39. package/dist/mcp-server/tools/definitions/list-reference.tool.js +312 -0
  40. package/dist/mcp-server/tools/definitions/list-reference.tool.js.map +1 -0
  41. package/dist/mcp-server/tools/definitions/search-authors.tool.d.ts +92 -0
  42. package/dist/mcp-server/tools/definitions/search-authors.tool.d.ts.map +1 -0
  43. package/dist/mcp-server/tools/definitions/search-authors.tool.js +298 -0
  44. package/dist/mcp-server/tools/definitions/search-authors.tool.js.map +1 -0
  45. package/dist/mcp-server/tools/definitions/search-experiments.tool.d.ts +80 -0
  46. package/dist/mcp-server/tools/definitions/search-experiments.tool.d.ts.map +1 -0
  47. package/dist/mcp-server/tools/definitions/search-experiments.tool.js +223 -0
  48. package/dist/mcp-server/tools/definitions/search-experiments.tool.js.map +1 -0
  49. package/dist/mcp-server/tools/definitions/search-hepdata.tool.d.ts +81 -0
  50. package/dist/mcp-server/tools/definitions/search-hepdata.tool.d.ts.map +1 -0
  51. package/dist/mcp-server/tools/definitions/search-hepdata.tool.js +225 -0
  52. package/dist/mcp-server/tools/definitions/search-hepdata.tool.js.map +1 -0
  53. package/dist/mcp-server/tools/definitions/search-literature.tool.d.ts +127 -0
  54. package/dist/mcp-server/tools/definitions/search-literature.tool.d.ts.map +1 -0
  55. package/dist/mcp-server/tools/definitions/search-literature.tool.js +331 -0
  56. package/dist/mcp-server/tools/definitions/search-literature.tool.js.map +1 -0
  57. package/dist/mcp-server/tools/inputs.d.ts +80 -0
  58. package/dist/mcp-server/tools/inputs.d.ts.map +1 -0
  59. package/dist/mcp-server/tools/inputs.js +100 -0
  60. package/dist/mcp-server/tools/inputs.js.map +1 -0
  61. package/dist/services/http/fetch-bounded.d.ts +45 -0
  62. package/dist/services/http/fetch-bounded.d.ts.map +1 -0
  63. package/dist/services/http/fetch-bounded.js +79 -0
  64. package/dist/services/http/fetch-bounded.js.map +1 -0
  65. package/dist/services/inspire/identifiers.d.ts +55 -0
  66. package/dist/services/inspire/identifiers.d.ts.map +1 -0
  67. package/dist/services/inspire/identifiers.js +98 -0
  68. package/dist/services/inspire/identifiers.js.map +1 -0
  69. package/dist/services/inspire/inspire-service.d.ts +104 -0
  70. package/dist/services/inspire/inspire-service.d.ts.map +1 -0
  71. package/dist/services/inspire/inspire-service.js +525 -0
  72. package/dist/services/inspire/inspire-service.js.map +1 -0
  73. package/dist/services/inspire/normalize.d.ts +30 -0
  74. package/dist/services/inspire/normalize.d.ts.map +1 -0
  75. package/dist/services/inspire/normalize.js +438 -0
  76. package/dist/services/inspire/normalize.js.map +1 -0
  77. package/dist/services/inspire/types.d.ts +505 -0
  78. package/dist/services/inspire/types.d.ts.map +1 -0
  79. package/dist/services/inspire/types.js +8 -0
  80. package/dist/services/inspire/types.js.map +1 -0
  81. package/dist/services/inspire/vocabulary.d.ts +22 -0
  82. package/dist/services/inspire/vocabulary.d.ts.map +1 -0
  83. package/dist/services/inspire/vocabulary.js +68 -0
  84. package/dist/services/inspire/vocabulary.js.map +1 -0
  85. package/dist/utils/render.d.ts +40 -0
  86. package/dist/utils/render.d.ts.map +1 -0
  87. package/dist/utils/render.js +112 -0
  88. package/dist/utils/render.js.map +1 -0
  89. package/package.json +112 -0
  90. package/server.json +100 -0
@@ -0,0 +1,298 @@
1
+ /**
2
+ * @fileoverview cern_inspire_search_authors — INSPIRE-HEP author profiles by
3
+ * name, BAI, ORCID, INSPIRE ID, or author recid: positions, identifiers,
4
+ * advisors, arXiv categories, and the literature query that selects each
5
+ * person's papers. Returns ranked candidates; never auto-picks among namesakes.
6
+ * @module mcp-server/tools/definitions/search-authors.tool
7
+ */
8
+ import { tool, z } from '@cyanheads/mcp-ts-core';
9
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
10
+ import { authorQueryInput, blankAsUnset } from '../inputs.js';
11
+ import { getInspireService } from '../../../services/inspire/inspire-service.js';
12
+ import { atLineStart, inline, printUrl } from '../../../utils/render.js';
13
+ const MAX_LIMIT = 25;
14
+ const positionSchema = z
15
+ .object({
16
+ institution: z.string().describe('Institution name as INSPIRE records it.'),
17
+ rank: z
18
+ .string()
19
+ .optional()
20
+ .describe('Rank or role (e.g. SENIOR, PHD, POSTDOC), when recorded.'),
21
+ startDate: z.string().optional().describe('Start date (YYYY or YYYY-MM), when recorded.'),
22
+ endDate: z.string().optional().describe('End date (YYYY or YYYY-MM), when recorded.'),
23
+ institutionRecid: z
24
+ .string()
25
+ .optional()
26
+ .describe('INSPIRE institution record ID, when the position links one.'),
27
+ })
28
+ .describe('One position held.');
29
+ const authorProfileSchema = z
30
+ .object({
31
+ recid: z
32
+ .string()
33
+ .describe('INSPIRE author record ID; pass to cern_inspire_get_citation_summary.'),
34
+ name: z.string().describe('Name as INSPIRE records it, "Last, First".'),
35
+ preferredName: z.string().optional().describe('Preferred display name, when recorded.'),
36
+ bai: z
37
+ .string()
38
+ .optional()
39
+ .describe('INSPIRE BAI (exact, case-sensitive); use in literature queries as "a <BAI>" or pass as author to cern_inspire_get_citation_summary.'),
40
+ orcid: z.string().optional().describe('ORCID iD, when the profile links one.'),
41
+ inspireId: z
42
+ .string()
43
+ .optional()
44
+ .describe('INSPIRE ID (INSPIRE- plus 8 digits), when recorded.'),
45
+ otherIds: z
46
+ .array(z
47
+ .object({
48
+ schema: z.string().describe('Identifier scheme (e.g. WIKIPEDIA, TWITTER, SPIRES).'),
49
+ value: z.string().describe('Identifier value in that scheme.'),
50
+ })
51
+ .describe('One further identifier.'))
52
+ .describe('Identifiers beyond BAI, ORCID, and INSPIRE ID.'),
53
+ status: z.string().optional().describe('Career status INSPIRE records (e.g. active, retired).'),
54
+ stub: z
55
+ .boolean()
56
+ .optional()
57
+ .describe('True when the profile is an unclaimed stub generated from paper metadata.'),
58
+ currentPositions: z.array(positionSchema).describe('Positions marked current.'),
59
+ pastPositions: z.array(positionSchema).describe('Earlier positions.'),
60
+ arxivCategories: z
61
+ .array(z.string().describe('arXiv category.'))
62
+ .describe('arXiv categories the person publishes in.'),
63
+ advisors: z
64
+ .array(z
65
+ .object({
66
+ name: z.string().describe('Advisor name.'),
67
+ degreeType: z
68
+ .string()
69
+ .optional()
70
+ .describe('Degree supervised (e.g. phd, master), when recorded.'),
71
+ recid: z.string().optional().describe('Advisor author record ID, when linked.'),
72
+ })
73
+ .describe('One advisor.'))
74
+ .describe('Advisors INSPIRE records.'),
75
+ urls: z
76
+ .array(z
77
+ .object({
78
+ url: z.string().describe('URL.'),
79
+ description: z.string().optional().describe('Label INSPIRE gives the URL, when any.'),
80
+ })
81
+ .describe('One web link.'))
82
+ .describe('Web links on the profile.'),
83
+ awards: z
84
+ .array(z
85
+ .object({
86
+ name: z.string().describe('Award name.'),
87
+ year: z.number().optional().describe('Year awarded, when recorded.'),
88
+ })
89
+ .describe('One award.'))
90
+ .describe('Awards INSPIRE records.'),
91
+ literatureQuery: z
92
+ .string()
93
+ .describe("Literature query selecting this person's papers; pass to cern_inspire_search_literature."),
94
+ })
95
+ .describe('One matching author profile.');
96
+ /** The route-specific zero-hit fragment (design § search_authors). */
97
+ const ZERO_HIT_HINTS = {
98
+ name: 'Try "Last, First", fewer name parts, or search papers with cern_inspire_search_literature using "a <name>".',
99
+ bai: "BAIs are exact and case-sensitive, and usually spell out the first name (Jane.Doe.1); search by name to find the profile's BAI.",
100
+ inspire_id: 'INSPIRE IDs are INSPIRE- plus 8 digits; search by name instead.',
101
+ orcid: 'The profile may not have an ORCID linked; search by name instead.',
102
+ recid: 'Author and literature records are numbered separately, so a paper recid matches no profile; search by name instead.',
103
+ };
104
+ /** Name parts folded for comparison: accents and case dropped, punctuation splits parts. */
105
+ const nameParts = (text) => text
106
+ .normalize('NFD')
107
+ .replace(/\p{M}/gu, '')
108
+ .toLowerCase()
109
+ .split(/[^\p{L}\p{N}]+/u)
110
+ .filter(Boolean);
111
+ /** Family-name parts shorter than this (`'t`, `de`) don't identify a surname on their own. */
112
+ const MIN_SURNAME_PART = 3;
113
+ /**
114
+ * True when some profile's family name (its `name` before the comma) appears in
115
+ * the query: as a whole run of the query's name parts, or through any one of its
116
+ * parts at least {@link MIN_SURNAME_PART} long, so `Hooft` finds `'t Hooft` and a
117
+ * two-letter surname still needs the whole run. The match may sit anywhere in the
118
+ * query, since a free-text name arrives as "Last, First", "First Last", or a bare surname.
119
+ */
120
+ function carriesQueriedSurname(query, authors) {
121
+ const queryParts = nameParts(query);
122
+ const queryRun = ` ${queryParts.join(' ')} `;
123
+ return authors.some((a) => {
124
+ const family = nameParts(a.name.split(',')[0] ?? '');
125
+ if (family.length === 0)
126
+ return false;
127
+ return (queryRun.includes(` ${family.join(' ')} `) ||
128
+ family.some((part) => part.length >= MIN_SURNAME_PART && queryParts.includes(part)));
129
+ });
130
+ }
131
+ function renderPosition(p) {
132
+ const span = p.startDate || p.endDate
133
+ ? `${p.startDate ? inline(p.startDate) : '?'}–${p.endDate ? inline(p.endDate) : ''}`
134
+ : undefined;
135
+ const details = [
136
+ p.rank && inline(p.rank),
137
+ span,
138
+ p.institutionRecid && `institution recid ${p.institutionRecid}`,
139
+ ].filter(Boolean);
140
+ return `- ${atLineStart(inline(p.institution))}${details.length > 0 ? ` (${details.join(' · ')})` : ''}`;
141
+ }
142
+ function renderAuthor(a, position) {
143
+ const heading = a.preferredName
144
+ ? `${inline(a.name)} (preferred: ${inline(a.preferredName)})`
145
+ : inline(a.name);
146
+ const lines = [`### ${position}. ${heading || '(unnamed)'}`];
147
+ const ids = [
148
+ `**recid:** ${a.recid}`,
149
+ a.bai && `**BAI:** ${inline(a.bai)}`,
150
+ a.orcid && `**ORCID:** ${inline(a.orcid)}`,
151
+ a.inspireId && `**INSPIRE ID:** ${inline(a.inspireId)}`,
152
+ ].filter(Boolean);
153
+ lines.push(ids.join(' · '));
154
+ const profile = [
155
+ a.status && `**Status:** ${inline(a.status)}`,
156
+ a.stub !== undefined &&
157
+ `**Stub:** ${a.stub ? 'yes (unclaimed profile built from paper metadata)' : 'no'}`,
158
+ ].filter(Boolean);
159
+ if (profile.length > 0)
160
+ lines.push(profile.join(' · '));
161
+ lines.push(`**Literature query:** \`${a.literatureQuery}\``);
162
+ if (a.currentPositions.length > 0) {
163
+ lines.push('**Current positions:**', ...a.currentPositions.map(renderPosition));
164
+ }
165
+ if (a.pastPositions.length > 0) {
166
+ lines.push('**Past positions:**', ...a.pastPositions.map(renderPosition));
167
+ }
168
+ if (a.arxivCategories.length > 0) {
169
+ lines.push(`**arXiv categories:** ${a.arxivCategories.map(inline).join(', ')}`);
170
+ }
171
+ if (a.advisors.length > 0) {
172
+ lines.push('**Advisors:**', ...a.advisors.map((adv) => {
173
+ const details = [
174
+ adv.degreeType && `degree ${inline(adv.degreeType)}`,
175
+ adv.recid && `author recid ${adv.recid}`,
176
+ ].filter(Boolean);
177
+ return `- ${atLineStart(inline(adv.name))}${details.length > 0 ? ` (${details.join(' · ')})` : ''}`;
178
+ }));
179
+ }
180
+ if (a.otherIds.length > 0) {
181
+ lines.push(`**Other IDs:** ${a.otherIds.map((id) => `${inline(id.schema)} ${inline(id.value)}`).join('; ')}`);
182
+ }
183
+ if (a.urls.length > 0) {
184
+ lines.push('**URLs:**', ...a.urls.map((u) => `- ${atLineStart(printUrl(u.url))}${u.description ? ` — ${inline(u.description)}` : ''}`));
185
+ }
186
+ if (a.awards.length > 0) {
187
+ lines.push(`**Awards:** ${a.awards.map((aw) => `${inline(aw.name)}${aw.year === undefined ? '' : ` (${aw.year})`}`).join('; ')}`);
188
+ }
189
+ return lines;
190
+ }
191
+ export const searchAuthorsTool = tool('cern_inspire_search_authors', {
192
+ title: 'Search INSPIRE authors',
193
+ description: "Find physicist profiles in INSPIRE-HEP by name, INSPIRE BAI, ORCID, INSPIRE ID, or author recid. Each profile carries its recid, BAI, ORCID, current and past positions, advisors, arXiv categories, links, awards, and a literatureQuery that selects the person's papers in cern_inspire_search_literature. A name returns ranked candidates (a bare surname can match tens of thousands of profiles, and a less-cited namesake can rank first), so confirm the person from positions and categories before passing a bai or recid to cern_inspire_get_citation_summary. An identifier matches exactly.",
194
+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
195
+ input: z.object({
196
+ query: authorQueryInput,
197
+ limit: blankAsUnset(z.number().int().min(1).max(MAX_LIMIT).default(5)).describe(`Profiles to return (1–${MAX_LIMIT}, default 5).`),
198
+ }),
199
+ output: z.object({
200
+ authors: z
201
+ .array(authorProfileSchema)
202
+ .describe('Matching profiles, in INSPIRE relevance order.'),
203
+ }),
204
+ enrichment: {
205
+ totalCount: z.number().describe('Total author profiles the query matched.'),
206
+ truncated: z.boolean().describe('True when more profiles matched than were returned.'),
207
+ shown: z.number().describe('Number of profiles returned.'),
208
+ cap: z.number().describe('The limit applied.'),
209
+ matchedAs: z
210
+ .string()
211
+ .describe('How the query was read: orcid, inspire_id, bai, or recid (exact identifier match), or name (free-text search).'),
212
+ notice: z.string().optional().describe('Guidance on an empty or capped result.'),
213
+ },
214
+ enrichmentTrailer: {
215
+ matchedAs: { label: 'Matched as' },
216
+ },
217
+ errors: [
218
+ {
219
+ reason: 'invalid_query',
220
+ code: JsonRpcErrorCode.ValidationError,
221
+ when: 'INSPIRE answered 400 to a parameter value it refuses.',
222
+ recovery: 'Check the name or identifier form against cern_inspire_list_reference topic identifiers, then retry cern_inspire_search_authors.',
223
+ severity: 'notice',
224
+ thrownBy: 'service',
225
+ },
226
+ {
227
+ reason: 'inspire_rate_limited',
228
+ code: JsonRpcErrorCode.RateLimited,
229
+ when: 'INSPIRE returned 429 after the pacer and retries.',
230
+ recovery: 'Wait the retry-after seconds this error states (at least 5), then retry this call; INSPIRE allows 15 requests per 5 seconds from one address.',
231
+ retryable: true,
232
+ thrownBy: 'service',
233
+ },
234
+ {
235
+ reason: 'pacer_shed',
236
+ code: JsonRpcErrorCode.RateLimited,
237
+ when: "The server's outbound INSPIRE queue could not start the request within the call's remaining budget.",
238
+ recovery: "This server's INSPIRE request queue is saturated; wait the seconds in this error's retryAfter field (about 5 when it is not shown), then retry this call with fewer cern_inspire calls running in parallel.",
239
+ retryable: true,
240
+ thrownBy: 'service',
241
+ },
242
+ {
243
+ reason: 'upstream_unreadable',
244
+ code: JsonRpcErrorCode.ServiceUnavailable,
245
+ when: 'The INSPIRE body exceeded the byte ceiling, was HTML where JSON was expected, or was invalid JSON.',
246
+ recovery: 'Retry this call in a few seconds; if it fails again, retry cern_inspire_search_authors with a smaller limit.',
247
+ thrownBy: 'service',
248
+ },
249
+ ],
250
+ async handler(input, ctx) {
251
+ ctx.enrich({ truncated: false, shown: 0, cap: input.limit, matchedAs: 'name' });
252
+ ctx.enrich.total(0);
253
+ const inspire = getInspireService();
254
+ const result = await inspire.searchAuthors(input.query, input.limit, inspire.beginCall(ctx));
255
+ const shown = result.authors.length;
256
+ ctx.enrich({ matchedAs: result.matchedAs, shown });
257
+ ctx.enrich.total(result.total);
258
+ ctx.log.info('Author search completed', {
259
+ matchedAs: result.matchedAs,
260
+ total: result.total,
261
+ shown,
262
+ deletedDropped: result.deletedDropped,
263
+ });
264
+ const truncated = result.total > shown + result.deletedDropped;
265
+ const notices = [];
266
+ if (result.matchedAs === 'name' &&
267
+ shown > 0 &&
268
+ !carriesQueriedSurname(input.query, result.authors)) {
269
+ notices.push(`No profile on this page has a surname in "${inline(input.query)}"; INSPIRE widened the match by reading name parts as initials, so these may be other people. Check the spelling, or search by BAI or ORCID.`);
270
+ }
271
+ if (truncated) {
272
+ notices.push(input.limit < MAX_LIMIT
273
+ ? `More profiles matched; raise limit (max ${MAX_LIMIT}), add name parts, or search by BAI or ORCID to pin one person.`
274
+ : 'More profiles matched than the 25 returned; add name parts, or search by BAI or ORCID to pin one person.');
275
+ }
276
+ if (result.total === 0) {
277
+ notices.push(`No INSPIRE author profile matched "${inline(input.query)}" as ${result.matchedAs}.`, ZERO_HIT_HINTS[result.matchedAs]);
278
+ }
279
+ if (result.deletedDropped > 0) {
280
+ notices.push(`${result.deletedDropped} matching profile${result.deletedDropped === 1 ? ' is' : 's are'} marked deleted in INSPIRE and ${result.deletedDropped === 1 ? 'was' : 'were'} dropped from this result.`);
281
+ }
282
+ if (truncated) {
283
+ ctx.enrich.truncated({ shown, cap: input.limit, guidance: notices.join(' ') });
284
+ }
285
+ else if (notices.length > 0) {
286
+ ctx.enrich.notice(notices.join(' '));
287
+ }
288
+ return { authors: result.authors };
289
+ },
290
+ format: (result) => {
291
+ const lines = [`## INSPIRE author profiles (${result.authors.length})`];
292
+ result.authors.forEach((author, i) => {
293
+ lines.push('', ...renderAuthor(author, i + 1));
294
+ });
295
+ return [{ type: 'text', text: lines.join('\n') }];
296
+ },
297
+ });
298
+ //# sourceMappingURL=search-authors.tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-authors.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/search-authors.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,gBAAgB,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElE,MAAM,SAAS,GAAG,EAAE,CAAC;AAErB,MAAM,cAAc,GAAG,CAAC;KACrB,MAAM,CAAC;IACN,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,C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AAM,CAAC,cAAc,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,kCAAkC,MAAM,CAAC,cAAc,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,4BAA4B,CACpM,CAAC;QACJ,CAAC;QAED,IAAI,SAAS,EAAE,CAAC;YACd,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACjF,CAAC;aAAM,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC9B,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QACvC,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;IACrC,CAAC;IAED,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE;QACjB,MAAM,KAAK,GAAG,CAAC,+BAA+B,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;QACxE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACnC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;QACH,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,80 @@
1
+ /**
2
+ * @fileoverview cern_inspire_search_experiments — INSPIRE-HEP experiment,
3
+ * collaboration, and facility records by name or legacy name: accelerator, host
4
+ * institutions, lifecycle dates, paper count, and the literature query that
5
+ * selects each experiment's papers.
6
+ * @module mcp-server/tools/definitions/search-experiments.tool
7
+ */
8
+ import { z } from '@cyanheads/mcp-ts-core';
9
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
10
+ export declare const searchExperimentsTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
11
+ query: z.ZodString;
12
+ limit: z.ZodPreprocess<z.ZodDefault<z.ZodNumber>, unknown>;
13
+ }, z.core.$strip>, z.ZodObject<{
14
+ experiments: z.ZodArray<z.ZodObject<{
15
+ recid: z.ZodString;
16
+ legacyName: z.ZodString;
17
+ name: z.ZodOptional<z.ZodString>;
18
+ shortName: z.ZodOptional<z.ZodString>;
19
+ longName: z.ZodOptional<z.ZodString>;
20
+ accelerator: z.ZodOptional<z.ZodString>;
21
+ institutions: z.ZodArray<z.ZodObject<{
22
+ name: z.ZodString;
23
+ recid: z.ZodOptional<z.ZodString>;
24
+ }, z.core.$strip>>;
25
+ collaboration: z.ZodOptional<z.ZodObject<{
26
+ name: z.ZodString;
27
+ subgroups: z.ZodArray<z.ZodString>;
28
+ }, z.core.$strip>>;
29
+ classification: z.ZodArray<z.ZodString>;
30
+ projectTypes: z.ZodArray<z.ZodString>;
31
+ dateProposed: z.ZodOptional<z.ZodString>;
32
+ dateApproved: z.ZodOptional<z.ZodString>;
33
+ dateStarted: z.ZodOptional<z.ZodString>;
34
+ dateCompleted: z.ZodOptional<z.ZodString>;
35
+ ongoing: z.ZodOptional<z.ZodBoolean>;
36
+ numberOfPapers: z.ZodOptional<z.ZodNumber>;
37
+ description: z.ZodOptional<z.ZodString>;
38
+ urls: z.ZodArray<z.ZodObject<{
39
+ url: z.ZodString;
40
+ description: z.ZodOptional<z.ZodString>;
41
+ }, z.core.$strip>>;
42
+ nameVariants: z.ZodArray<z.ZodString>;
43
+ core: z.ZodOptional<z.ZodBoolean>;
44
+ literatureQuery: z.ZodOptional<z.ZodString>;
45
+ }, z.core.$strip>>;
46
+ }, z.core.$strip>, readonly [{
47
+ readonly reason: "invalid_query";
48
+ readonly code: JsonRpcErrorCode.ValidationError;
49
+ readonly when: "INSPIRE answered 400 to a parameter value it refuses.";
50
+ readonly recovery: "Retry cern_inspire_search_experiments with a plain experiment, collaboration, or accelerator name.";
51
+ readonly severity: "notice";
52
+ readonly thrownBy: "service";
53
+ }, {
54
+ readonly reason: "inspire_rate_limited";
55
+ readonly code: JsonRpcErrorCode.RateLimited;
56
+ readonly when: "INSPIRE returned 429 after the pacer and retries.";
57
+ readonly recovery: "Wait the retry-after seconds this error states (at least 5), then retry this call; INSPIRE allows 15 requests per 5 seconds from one address.";
58
+ readonly retryable: true;
59
+ readonly thrownBy: "service";
60
+ }, {
61
+ readonly reason: "pacer_shed";
62
+ readonly code: JsonRpcErrorCode.RateLimited;
63
+ readonly when: "The server's outbound INSPIRE queue could not start the request within the call's remaining budget.";
64
+ readonly recovery: "This server's INSPIRE request queue is saturated; wait the seconds in this error's retryAfter field (about 5 when it is not shown), then retry this call with fewer cern_inspire calls running in parallel.";
65
+ readonly retryable: true;
66
+ readonly thrownBy: "service";
67
+ }, {
68
+ readonly reason: "upstream_unreadable";
69
+ readonly code: JsonRpcErrorCode.ServiceUnavailable;
70
+ readonly when: "The INSPIRE body exceeded the byte ceiling, was HTML where JSON was expected, or was invalid JSON.";
71
+ readonly recovery: "Retry this call in a few seconds; if it fails again, retry cern_inspire_search_experiments with a smaller limit.";
72
+ readonly thrownBy: "service";
73
+ }], {
74
+ readonly totalCount: z.ZodNumber;
75
+ readonly truncated: z.ZodBoolean;
76
+ readonly shown: z.ZodNumber;
77
+ readonly cap: z.ZodNumber;
78
+ readonly notice: z.ZodOptional<z.ZodString>;
79
+ }>;
80
+ //# sourceMappingURL=search-experiments.tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-experiments.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/search-experiments.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AA0JjE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4GhC,CAAC"}
@@ -0,0 +1,223 @@
1
+ /**
2
+ * @fileoverview cern_inspire_search_experiments — INSPIRE-HEP experiment,
3
+ * collaboration, and facility records by name or legacy name: accelerator, host
4
+ * institutions, lifecycle dates, paper count, and the literature query that
5
+ * selects each experiment's papers.
6
+ * @module mcp-server/tools/definitions/search-experiments.tool
7
+ */
8
+ import { tool, z } from '@cyanheads/mcp-ts-core';
9
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
10
+ import { blankAsUnset } from '../inputs.js';
11
+ import { getInspireService } from '../../../services/inspire/inspire-service.js';
12
+ import { atLineStart, inline, printUrl, quote } from '../../../utils/render.js';
13
+ const MAX_LIMIT = 25;
14
+ const experimentSchema = z
15
+ .object({
16
+ recid: z.string().describe('INSPIRE experiment record ID.'),
17
+ legacyName: z
18
+ .string()
19
+ .describe('INSPIRE legacy name (e.g. CERN-LHC-ATLAS), the key literatureQuery uses.'),
20
+ name: z.string().optional().describe('Experiment name (e.g. ATLAS), when recorded.'),
21
+ shortName: z.string().optional().describe('Short form of the name, when recorded.'),
22
+ longName: z.string().optional().describe('Full descriptive name, when recorded.'),
23
+ accelerator: z.string().optional().describe('Accelerator the experiment runs at, when any.'),
24
+ institutions: z
25
+ .array(z
26
+ .object({
27
+ name: z.string().describe('Institution name.'),
28
+ recid: z.string().optional().describe('INSPIRE institution record ID, when linked.'),
29
+ })
30
+ .describe('One host institution.'))
31
+ .describe('Host institutions.'),
32
+ collaboration: z
33
+ .object({
34
+ name: z.string().describe('Collaboration name.'),
35
+ subgroups: z
36
+ .array(z.string().describe('Subgroup name.'))
37
+ .describe('Named subgroups of the collaboration.'),
38
+ })
39
+ .optional()
40
+ .describe('The collaboration running the experiment, when recorded.'),
41
+ classification: z
42
+ .array(z.string().describe('Classification path, e.g. "Collider Experiments|Hadrons|p p".'))
43
+ .describe('INSPIRE classification paths.'),
44
+ projectTypes: z
45
+ .array(z.string().describe('Project type.'))
46
+ .describe('Project types (e.g. experiment, collaboration, accelerator).'),
47
+ dateProposed: z.string().optional().describe('Date proposed, when recorded.'),
48
+ dateApproved: z.string().optional().describe('Date approved, when recorded.'),
49
+ dateStarted: z.string().optional().describe('Date started, when recorded.'),
50
+ dateCompleted: z
51
+ .string()
52
+ .optional()
53
+ .describe('Date completed; omitted while ongoing or when unrecorded.'),
54
+ ongoing: z
55
+ .boolean()
56
+ .optional()
57
+ .describe('True when INSPIRE marks the experiment as still running, false when it records a completion date; omitted when INSPIRE records neither, so the status is unknown.'),
58
+ numberOfPapers: z
59
+ .number()
60
+ .optional()
61
+ .describe("INSPIRE's stored paper count; it can trail the number of records literatureQuery matches."),
62
+ description: z.string().optional().describe('Description as INSPIRE records it.'),
63
+ urls: z
64
+ .array(z
65
+ .object({
66
+ url: z.string().describe('URL.'),
67
+ description: z.string().optional().describe('Label INSPIRE gives the URL, when any.'),
68
+ })
69
+ .describe('One web link.'))
70
+ .describe('Web links.'),
71
+ nameVariants: z
72
+ .array(z.string().describe('Alternative name.'))
73
+ .describe('Alternative names INSPIRE matches.'),
74
+ core: z.boolean().optional().describe('True when INSPIRE marks the record as core HEP.'),
75
+ literatureQuery: z
76
+ .string()
77
+ .optional()
78
+ .describe("Literature query selecting this experiment's papers; pass to cern_inspire_search_literature, or as query to cern_inspire_get_citation_summary. Absent when the record has no legacy name, or the name holds a quote or backslash that cannot sit inside the query's quoted clause."),
79
+ })
80
+ .describe('One matching experiment record.');
81
+ function renderExperiment(e, position) {
82
+ const title = [inline(e.legacyName) || '(no legacy name)', e.name && inline(e.name)]
83
+ .filter(Boolean)
84
+ .join(' — ');
85
+ const lines = [`### ${position}. ${title}`];
86
+ lines.push([
87
+ `**recid:** ${e.recid}`,
88
+ e.shortName && `**Short name:** ${inline(e.shortName)}`,
89
+ e.accelerator && `**Accelerator:** ${inline(e.accelerator)}`,
90
+ e.numberOfPapers !== undefined && `**Papers (INSPIRE count):** ${e.numberOfPapers}`,
91
+ e.core !== undefined && `**Core:** ${e.core ? 'yes' : 'no'}`,
92
+ ]
93
+ .filter(Boolean)
94
+ .join(' · '));
95
+ if (e.longName)
96
+ lines.push(`**Long name:** ${inline(e.longName)}`);
97
+ if (e.collaboration) {
98
+ const subgroups = e.collaboration.subgroups.length > 0
99
+ ? ` (subgroups: ${e.collaboration.subgroups.map(inline).join(', ')})`
100
+ : '';
101
+ lines.push(`**Collaboration:** ${inline(e.collaboration.name)}${subgroups}`);
102
+ }
103
+ const dates = [
104
+ e.dateProposed && `proposed ${inline(e.dateProposed)}`,
105
+ e.dateApproved && `approved ${inline(e.dateApproved)}`,
106
+ e.dateStarted && `started ${inline(e.dateStarted)}`,
107
+ e.dateCompleted && `completed ${inline(e.dateCompleted)}`,
108
+ ].filter(Boolean);
109
+ const ongoing = e.ongoing === undefined ? 'not recorded' : e.ongoing ? 'yes' : 'no';
110
+ lines.push(`**Dates:** ${dates.length > 0 ? dates.join(' · ') : 'Not available'} · **Ongoing:** ${ongoing}`);
111
+ if (e.institutions.length > 0) {
112
+ lines.push(`**Institutions:** ${e.institutions
113
+ .map((i) => `${inline(i.name)}${i.recid ? ` (institution recid ${i.recid})` : ''}`)
114
+ .join('; ')}`);
115
+ }
116
+ if (e.classification.length > 0) {
117
+ lines.push(`**Classification:** ${e.classification.map(inline).join('; ')}`);
118
+ }
119
+ if (e.projectTypes.length > 0) {
120
+ lines.push(`**Project types:** ${e.projectTypes.map(inline).join(', ')}`);
121
+ }
122
+ if (e.nameVariants.length > 0) {
123
+ lines.push(`**Name variants:** ${e.nameVariants.map(inline).join(', ')}`);
124
+ }
125
+ if (e.literatureQuery)
126
+ lines.push(`**Literature query:** ${inline(e.literatureQuery)}`);
127
+ if (e.urls.length > 0) {
128
+ lines.push('**URLs:**', ...e.urls.map((u) => `- ${atLineStart(printUrl(u.url))}${u.description ? ` — ${inline(u.description)}` : ''}`));
129
+ }
130
+ if (e.description)
131
+ lines.push('**Description:**', quote(e.description));
132
+ return lines;
133
+ }
134
+ export const searchExperimentsTool = tool('cern_inspire_search_experiments', {
135
+ title: 'Search INSPIRE experiments',
136
+ description: "Find experiments, collaborations, and facilities in INSPIRE-HEP (ATLAS, CMS, DUNE, Belle II, …) by name, accelerator, or INSPIRE legacy name (CERN-LHC-CMS); digits alone look up an experiment recid. Each record carries the accelerator, host institutions, collaboration and subgroups, classification, lifecycle dates (proposed, approved, started, completed, ongoing), INSPIRE's paper count, a description, and a literatureQuery to pass to cern_inspire_search_literature or cern_inspire_get_citation_summary for the experiment's papers.",
137
+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
138
+ input: z.object({
139
+ query: z
140
+ .string()
141
+ .trim()
142
+ .min(1)
143
+ .max(200)
144
+ .describe('Experiment, collaboration, accelerator, or facility name (ATLAS, LHCb, Tevatron), an INSPIRE legacy name (CERN-LHC-CMS), or an experiment recid (digits only).'),
145
+ limit: blankAsUnset(z.number().int().min(1).max(MAX_LIMIT).default(5)).describe(`Experiments to return (1–${MAX_LIMIT}, default 5).`),
146
+ }),
147
+ output: z.object({
148
+ experiments: z
149
+ .array(experimentSchema)
150
+ .describe('Matching experiment records, in INSPIRE relevance order.'),
151
+ }),
152
+ enrichment: {
153
+ totalCount: z.number().describe('Total experiment records the query matched.'),
154
+ truncated: z.boolean().describe('True when more records matched than were returned.'),
155
+ shown: z.number().describe('Number of records returned.'),
156
+ cap: z.number().describe('The limit applied.'),
157
+ notice: z.string().optional().describe('Guidance on an empty or capped result.'),
158
+ },
159
+ errors: [
160
+ {
161
+ reason: 'invalid_query',
162
+ code: JsonRpcErrorCode.ValidationError,
163
+ when: 'INSPIRE answered 400 to a parameter value it refuses.',
164
+ recovery: 'Retry cern_inspire_search_experiments with a plain experiment, collaboration, or accelerator name.',
165
+ severity: 'notice',
166
+ thrownBy: 'service',
167
+ },
168
+ {
169
+ reason: 'inspire_rate_limited',
170
+ code: JsonRpcErrorCode.RateLimited,
171
+ when: 'INSPIRE returned 429 after the pacer and retries.',
172
+ recovery: 'Wait the retry-after seconds this error states (at least 5), then retry this call; INSPIRE allows 15 requests per 5 seconds from one address.',
173
+ retryable: true,
174
+ thrownBy: 'service',
175
+ },
176
+ {
177
+ reason: 'pacer_shed',
178
+ code: JsonRpcErrorCode.RateLimited,
179
+ when: "The server's outbound INSPIRE queue could not start the request within the call's remaining budget.",
180
+ recovery: "This server's INSPIRE request queue is saturated; wait the seconds in this error's retryAfter field (about 5 when it is not shown), then retry this call with fewer cern_inspire calls running in parallel.",
181
+ retryable: true,
182
+ thrownBy: 'service',
183
+ },
184
+ {
185
+ reason: 'upstream_unreadable',
186
+ code: JsonRpcErrorCode.ServiceUnavailable,
187
+ when: 'The INSPIRE body exceeded the byte ceiling, was HTML where JSON was expected, or was invalid JSON.',
188
+ recovery: 'Retry this call in a few seconds; if it fails again, retry cern_inspire_search_experiments with a smaller limit.',
189
+ thrownBy: 'service',
190
+ },
191
+ ],
192
+ async handler(input, ctx) {
193
+ ctx.enrich({ truncated: false, shown: 0, cap: input.limit });
194
+ ctx.enrich.total(0);
195
+ const inspire = getInspireService();
196
+ const result = await inspire.searchExperiments(input.query, input.limit, inspire.beginCall(ctx));
197
+ const shown = result.experiments.length;
198
+ ctx.enrich({ shown });
199
+ ctx.enrich.total(result.total);
200
+ ctx.log.info('Experiment search completed', { total: result.total, shown });
201
+ if (shown === 0) {
202
+ ctx.enrich.notice(`No INSPIRE experiment matched "${inline(input.query)}". Try the collaboration's common name or the accelerator (LHC, Tevatron), or search papers with cern_inspire_search_literature using "collaboration:<name>".`);
203
+ }
204
+ else if (result.total > shown) {
205
+ ctx.enrich.truncated({
206
+ shown,
207
+ cap: input.limit,
208
+ guidance: input.limit < MAX_LIMIT
209
+ ? `More experiments matched; raise limit (max ${MAX_LIMIT}) or use a more specific name or legacy name.`
210
+ : 'More experiments matched than the 25 returned; use a more specific name or legacy name.',
211
+ });
212
+ }
213
+ return { experiments: result.experiments };
214
+ },
215
+ format: (result) => {
216
+ const lines = [`## INSPIRE experiments (${result.experiments.length})`];
217
+ result.experiments.forEach((experiment, i) => {
218
+ lines.push('', ...renderExperiment(experiment, i + 1));
219
+ });
220
+ return [{ type: 'text', text: lines.join('\n') }];
221
+ },
222
+ });
223
+ //# sourceMappingURL=search-experiments.tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-experiments.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/search-experiments.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,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEzE,MAAM,SAAS,GAAG,EAAE,CAAC;AAErB,MAAM,gBAAgB,GAAG,CAAC;KACvB,MAAM,CAAC;IACN,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;IAC3D,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,QAAQ,CAAC,0EAA0E,CAAC;IACvF,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC;IACpF,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;IAC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