@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.
- package/AGENTS.md +504 -0
- package/CLAUDE.md +504 -0
- package/Dockerfile +177 -0
- package/LICENSE +201 -0
- package/README.md +311 -0
- package/changelog/0.1.x/0.1.0.md +9 -0
- package/changelog/0.1.x/0.1.1.md +22 -0
- package/changelog/template.md +151 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-server/resources/definitions/index.d.ts +106 -0
- package/dist/mcp-server/resources/definitions/index.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/index.js +7 -0
- package/dist/mcp-server/resources/definitions/index.js.map +1 -0
- package/dist/mcp-server/resources/definitions/inspire-literature.resource.d.ts +110 -0
- package/dist/mcp-server/resources/definitions/inspire-literature.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/inspire-literature.resource.js +69 -0
- package/dist/mcp-server/resources/definitions/inspire-literature.resource.js.map +1 -0
- package/dist/mcp-server/tools/definitions/export-citations.tool.d.ts +65 -0
- package/dist/mcp-server/tools/definitions/export-citations.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/export-citations.tool.js +120 -0
- package/dist/mcp-server/tools/definitions/export-citations.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-citation-summary.tool.d.ts +159 -0
- package/dist/mcp-server/tools/definitions/get-citation-summary.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-citation-summary.tool.js +262 -0
- package/dist/mcp-server/tools/definitions/get-citation-summary.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-paper.tool.d.ts +195 -0
- package/dist/mcp-server/tools/definitions/get-paper.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-paper.tool.js +356 -0
- package/dist/mcp-server/tools/definitions/get-paper.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/index.d.ts +675 -0
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/index.js +23 -0
- package/dist/mcp-server/tools/definitions/index.js.map +1 -0
- package/dist/mcp-server/tools/definitions/list-reference.tool.d.ts +33 -0
- package/dist/mcp-server/tools/definitions/list-reference.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/list-reference.tool.js +312 -0
- package/dist/mcp-server/tools/definitions/list-reference.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/search-authors.tool.d.ts +92 -0
- package/dist/mcp-server/tools/definitions/search-authors.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/search-authors.tool.js +298 -0
- package/dist/mcp-server/tools/definitions/search-authors.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/search-experiments.tool.d.ts +80 -0
- package/dist/mcp-server/tools/definitions/search-experiments.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/search-experiments.tool.js +223 -0
- package/dist/mcp-server/tools/definitions/search-experiments.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/search-hepdata.tool.d.ts +81 -0
- package/dist/mcp-server/tools/definitions/search-hepdata.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/search-hepdata.tool.js +225 -0
- package/dist/mcp-server/tools/definitions/search-hepdata.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/search-literature.tool.d.ts +127 -0
- package/dist/mcp-server/tools/definitions/search-literature.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/search-literature.tool.js +331 -0
- package/dist/mcp-server/tools/definitions/search-literature.tool.js.map +1 -0
- package/dist/mcp-server/tools/inputs.d.ts +80 -0
- package/dist/mcp-server/tools/inputs.d.ts.map +1 -0
- package/dist/mcp-server/tools/inputs.js +100 -0
- package/dist/mcp-server/tools/inputs.js.map +1 -0
- package/dist/services/http/fetch-bounded.d.ts +45 -0
- package/dist/services/http/fetch-bounded.d.ts.map +1 -0
- package/dist/services/http/fetch-bounded.js +79 -0
- package/dist/services/http/fetch-bounded.js.map +1 -0
- package/dist/services/inspire/identifiers.d.ts +55 -0
- package/dist/services/inspire/identifiers.d.ts.map +1 -0
- package/dist/services/inspire/identifiers.js +98 -0
- package/dist/services/inspire/identifiers.js.map +1 -0
- package/dist/services/inspire/inspire-service.d.ts +104 -0
- package/dist/services/inspire/inspire-service.d.ts.map +1 -0
- package/dist/services/inspire/inspire-service.js +525 -0
- package/dist/services/inspire/inspire-service.js.map +1 -0
- package/dist/services/inspire/normalize.d.ts +30 -0
- package/dist/services/inspire/normalize.d.ts.map +1 -0
- package/dist/services/inspire/normalize.js +438 -0
- package/dist/services/inspire/normalize.js.map +1 -0
- package/dist/services/inspire/types.d.ts +505 -0
- package/dist/services/inspire/types.d.ts.map +1 -0
- package/dist/services/inspire/types.js +8 -0
- package/dist/services/inspire/types.js.map +1 -0
- package/dist/services/inspire/vocabulary.d.ts +22 -0
- package/dist/services/inspire/vocabulary.d.ts.map +1 -0
- package/dist/services/inspire/vocabulary.js +68 -0
- package/dist/services/inspire/vocabulary.js.map +1 -0
- package/dist/utils/render.d.ts +40 -0
- package/dist/utils/render.d.ts.map +1 -0
- package/dist/utils/render.js +112 -0
- package/dist/utils/render.js.map +1 -0
- package/package.json +112 -0
- package/server.json +100 -0
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview cern_inspire_get_citation_summary — INSPIRE's citation summary
|
|
3
|
+
* (h-index, citation totals and averages, papers per citation bucket, for all
|
|
4
|
+
* citeable and for published papers) for one author identifier or any
|
|
5
|
+
* literature query, narrowed by document type, subject, and year.
|
|
6
|
+
* @module mcp-server/tools/definitions/get-citation-summary.tool
|
|
7
|
+
*/
|
|
8
|
+
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
9
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
10
|
+
import { authorIdInput, blankAsUnset, documentTypesInput, formatAppliedFilters, subjectsInput, yearFromInput, yearToInput, } from '../inputs.js';
|
|
11
|
+
import { containsOrcid, routeAuthorQuery } from '../../../services/inspire/identifiers.js';
|
|
12
|
+
import { getInspireService } from '../../../services/inspire/inspire-service.js';
|
|
13
|
+
import { CITATION_BUCKET_RANGES } from '../../../services/inspire/vocabulary.js';
|
|
14
|
+
import { cell, inline } from '../../../utils/render.js';
|
|
15
|
+
const totalsSchema = (scope) => z
|
|
16
|
+
.object({
|
|
17
|
+
papers: z.number().describe(`Number of ${scope} papers.`),
|
|
18
|
+
citations: z.number().describe(`Citations to the ${scope} papers.`),
|
|
19
|
+
averageCitations: z
|
|
20
|
+
.number()
|
|
21
|
+
.optional()
|
|
22
|
+
.describe(`Mean citations per ${scope} paper; omitted when there are no papers.`),
|
|
23
|
+
})
|
|
24
|
+
.describe(`Totals over ${scope} papers.`);
|
|
25
|
+
const bucketsSchema = (scope) => z
|
|
26
|
+
.array(z
|
|
27
|
+
.object({
|
|
28
|
+
range: z.enum(CITATION_BUCKET_RANGES).describe('Citation-count range of the bucket.'),
|
|
29
|
+
papers: z.number().describe('Papers whose citation count falls in the range.'),
|
|
30
|
+
})
|
|
31
|
+
.describe('One citation bucket.'))
|
|
32
|
+
.describe(`Papers per citation range, over ${scope} papers.`);
|
|
33
|
+
/** A float average shown to two decimals; integers print unchanged. */
|
|
34
|
+
const average = (value) => Number(value.toFixed(2));
|
|
35
|
+
function renderTotals(label, t) {
|
|
36
|
+
const avg = t.averageCitations === undefined
|
|
37
|
+
? 'Not available (no papers)'
|
|
38
|
+
: String(average(t.averageCitations));
|
|
39
|
+
return `| ${label} | ${t.papers} | ${t.citations} | ${avg} |`;
|
|
40
|
+
}
|
|
41
|
+
/** One table over both bucket sets, rows in range order (union of both sets' ranges). */
|
|
42
|
+
function renderBuckets(all, published) {
|
|
43
|
+
const ranges = [...new Set([...all, ...published].map((b) => b.range))];
|
|
44
|
+
return [
|
|
45
|
+
'| Citation range | All citeable papers | Published papers |',
|
|
46
|
+
'|:--|--:|--:|',
|
|
47
|
+
...ranges.map((range) => {
|
|
48
|
+
const a = all.find((b) => b.range === range)?.papers;
|
|
49
|
+
const p = published.find((b) => b.range === range)?.papers;
|
|
50
|
+
return `| ${cell(range)} | ${a ?? '—'} | ${p ?? '—'} |`;
|
|
51
|
+
}),
|
|
52
|
+
];
|
|
53
|
+
}
|
|
54
|
+
export const getCitationSummaryTool = tool('cern_inspire_get_citation_summary', {
|
|
55
|
+
title: 'Get INSPIRE citation summary',
|
|
56
|
+
description: 'Compute INSPIRE-HEP\'s citation summary for one author or for any literature query: h-index, citation totals, average citations per paper, and paper counts per citation bucket (0, 1–9, 10–49, 50–99, 100–249, 250–499, 500+), each for all citeable papers and for published papers. Pass exactly one of author (a BAI, ORCID, INSPIRE ID, or author recid — resolve a name with cern_inspire_search_authors first) or query (any INSPIRE literature query: a topic, collaboration, institution, or "a <BAI>"). Document type, subject, and year filters narrow every figure; exclude_self_citations recounts without self-citations.',
|
|
57
|
+
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
58
|
+
input: z.object({
|
|
59
|
+
author: authorIdInput,
|
|
60
|
+
query: blankAsUnset(z.string().trim().max(1000).optional()).describe('An INSPIRE literature query, e.g. "collaboration:atlas", "t neutrino oscillation", "a Edward.Witten.1". Literature queries do not match ORCIDs; pass an ORCID as author. Pass this or author, not both.'),
|
|
61
|
+
document_types: documentTypesInput,
|
|
62
|
+
subjects: subjectsInput,
|
|
63
|
+
year_from: yearFromInput,
|
|
64
|
+
year_to: yearToInput,
|
|
65
|
+
exclude_self_citations: blankAsUnset(z.boolean().default(false)).describe("Count citations without self-citations (INSPIRE's definition), default false."),
|
|
66
|
+
}),
|
|
67
|
+
output: z.object({
|
|
68
|
+
target: z
|
|
69
|
+
.object({
|
|
70
|
+
kind: z
|
|
71
|
+
.enum(['author', 'query'])
|
|
72
|
+
.describe('author when an author identifier was resolved; query for a literature query.'),
|
|
73
|
+
authorRecid: z
|
|
74
|
+
.string()
|
|
75
|
+
.optional()
|
|
76
|
+
.describe('INSPIRE author record ID the identifier resolved to (author target only).'),
|
|
77
|
+
authorName: z
|
|
78
|
+
.string()
|
|
79
|
+
.optional()
|
|
80
|
+
.describe('Name on the resolved author profile (author target only).'),
|
|
81
|
+
query: z
|
|
82
|
+
.string()
|
|
83
|
+
.describe('The literature query summarized ("authors.recid:N" for an author target).'),
|
|
84
|
+
})
|
|
85
|
+
.describe('What the summary covers.'),
|
|
86
|
+
matchedRecords: z.number().describe('Literature records the query matched, citeable or not.'),
|
|
87
|
+
citeablePapers: z.number().describe('Citeable papers among the matched records.'),
|
|
88
|
+
hIndex: z
|
|
89
|
+
.object({
|
|
90
|
+
all: z.number().describe('h-index over all citeable papers.'),
|
|
91
|
+
published: z.number().describe('h-index over published papers.'),
|
|
92
|
+
})
|
|
93
|
+
.describe('h-index for all citeable and for published papers.'),
|
|
94
|
+
all: totalsSchema('citeable'),
|
|
95
|
+
published: totalsSchema('published'),
|
|
96
|
+
buckets: z
|
|
97
|
+
.object({
|
|
98
|
+
all: bucketsSchema('citeable'),
|
|
99
|
+
published: bucketsSchema('published'),
|
|
100
|
+
})
|
|
101
|
+
.describe('Papers per citation range, for all citeable and for published papers.'),
|
|
102
|
+
}),
|
|
103
|
+
enrichment: {
|
|
104
|
+
effectiveQuery: z.string().describe('The literature query sent to INSPIRE.'),
|
|
105
|
+
appliedFilters: z
|
|
106
|
+
.string()
|
|
107
|
+
.describe('Filters applied, e.g. "document_types=published; years=2012–2015; exclude_self_citations=true", or "none".'),
|
|
108
|
+
notice: z.string().optional().describe('Guidance when no citeable paper matched.'),
|
|
109
|
+
},
|
|
110
|
+
enrichmentTrailer: {
|
|
111
|
+
// The caller's query reaches the content[] trailer; inline() keeps a newline in it from forging structure.
|
|
112
|
+
effectiveQuery: { render: (query) => `Query: ${inline(query)}` },
|
|
113
|
+
appliedFilters: { label: 'Applied filters' },
|
|
114
|
+
},
|
|
115
|
+
errors: [
|
|
116
|
+
{
|
|
117
|
+
reason: 'missing_target',
|
|
118
|
+
code: JsonRpcErrorCode.ValidationError,
|
|
119
|
+
when: 'Neither or both of author and query were given.',
|
|
120
|
+
recovery: 'Pass exactly one of author (a BAI, ORCID, INSPIRE ID, or author recid) or query (an INSPIRE literature query) to cern_inspire_get_citation_summary.',
|
|
121
|
+
severity: 'notice',
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
reason: 'author_not_identifier',
|
|
125
|
+
code: JsonRpcErrorCode.ValidationError,
|
|
126
|
+
when: 'author is not a BAI, ORCID, INSPIRE ID, or recid — usually a name.',
|
|
127
|
+
recovery: 'Resolve the name with cern_inspire_search_authors, then pass the returned bai or recid as author.',
|
|
128
|
+
severity: 'notice',
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
reason: 'author_not_found',
|
|
132
|
+
code: JsonRpcErrorCode.NotFound,
|
|
133
|
+
when: 'The author identifier matches no INSPIRE profile.',
|
|
134
|
+
recovery: 'Resolve the person with cern_inspire_search_authors, then pass the returned bai or recid as author.',
|
|
135
|
+
severity: 'notice',
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
reason: 'invalid_year_range',
|
|
139
|
+
code: JsonRpcErrorCode.ValidationError,
|
|
140
|
+
when: 'year_from is later than year_to.',
|
|
141
|
+
recovery: 'Swap year_from and year_to so the range runs forward, or drop one bound for an open range, then retry this call.',
|
|
142
|
+
severity: 'notice',
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
reason: 'invalid_query',
|
|
146
|
+
code: JsonRpcErrorCode.ValidationError,
|
|
147
|
+
when: 'INSPIRE answered 400 to a parameter value it refuses.',
|
|
148
|
+
recovery: 'Check the query and filters against cern_inspire_list_reference topic search_syntax, then retry cern_inspire_get_citation_summary.',
|
|
149
|
+
severity: 'notice',
|
|
150
|
+
thrownBy: 'service',
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
reason: 'inspire_rate_limited',
|
|
154
|
+
code: JsonRpcErrorCode.RateLimited,
|
|
155
|
+
when: 'INSPIRE returned 429 after the pacer and retries.',
|
|
156
|
+
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.',
|
|
157
|
+
retryable: true,
|
|
158
|
+
thrownBy: 'service',
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
reason: 'pacer_shed',
|
|
162
|
+
code: JsonRpcErrorCode.RateLimited,
|
|
163
|
+
when: "The server's outbound INSPIRE queue could not start the request within the call's remaining budget.",
|
|
164
|
+
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.",
|
|
165
|
+
retryable: true,
|
|
166
|
+
thrownBy: 'service',
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
reason: 'upstream_unreadable',
|
|
170
|
+
code: JsonRpcErrorCode.ServiceUnavailable,
|
|
171
|
+
when: 'The INSPIRE body exceeded the byte ceiling, was HTML where JSON was expected, or was invalid JSON.',
|
|
172
|
+
recovery: 'Retry this call in a few seconds; if it fails again, INSPIRE is likely serving an error page, so wait a minute before retrying cern_inspire_get_citation_summary.',
|
|
173
|
+
thrownBy: 'service',
|
|
174
|
+
},
|
|
175
|
+
],
|
|
176
|
+
async handler(input, ctx) {
|
|
177
|
+
const filters = {
|
|
178
|
+
documentTypes: input.document_types,
|
|
179
|
+
subjects: input.subjects,
|
|
180
|
+
yearFrom: input.year_from,
|
|
181
|
+
yearTo: input.year_to,
|
|
182
|
+
};
|
|
183
|
+
ctx.enrich({
|
|
184
|
+
appliedFilters: formatAppliedFilters({
|
|
185
|
+
...filters,
|
|
186
|
+
excludeSelfCitations: input.exclude_self_citations,
|
|
187
|
+
}),
|
|
188
|
+
});
|
|
189
|
+
ctx.enrich.echo(input.query || input.author || '');
|
|
190
|
+
if (input.year_from !== undefined &&
|
|
191
|
+
input.year_to !== undefined &&
|
|
192
|
+
input.year_from > input.year_to) {
|
|
193
|
+
throw ctx.fail('invalid_year_range', `year_from (${input.year_from}) is later than year_to (${input.year_to}).`);
|
|
194
|
+
}
|
|
195
|
+
if (Boolean(input.author) === Boolean(input.query)) {
|
|
196
|
+
throw ctx.fail('missing_target', input.author
|
|
197
|
+
? 'Both author and query were given; pass exactly one.'
|
|
198
|
+
: 'Neither author nor query was given; pass exactly one.');
|
|
199
|
+
}
|
|
200
|
+
const inspire = getInspireService();
|
|
201
|
+
const call = inspire.beginCall(ctx);
|
|
202
|
+
let target;
|
|
203
|
+
if (input.author) {
|
|
204
|
+
const route = routeAuthorQuery(input.author);
|
|
205
|
+
if (route.matchedAs === 'name') {
|
|
206
|
+
throw ctx.fail('author_not_identifier', `author "${inline(input.author)}" is not a BAI, ORCID, INSPIRE ID, or author recid.`, { author: input.author });
|
|
207
|
+
}
|
|
208
|
+
const resolved = await inspire.resolveAuthor(route, call);
|
|
209
|
+
if (!resolved) {
|
|
210
|
+
throw ctx.fail('author_not_found', `No INSPIRE author profile matched "${inline(input.author)}" as ${route.matchedAs}.`, { author: input.author, matchedAs: route.matchedAs });
|
|
211
|
+
}
|
|
212
|
+
target = {
|
|
213
|
+
kind: 'author',
|
|
214
|
+
authorRecid: resolved.recid,
|
|
215
|
+
...(resolved.name ? { authorName: resolved.name } : {}),
|
|
216
|
+
query: `authors.recid:${resolved.recid}`,
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
target = { kind: 'query', query: input.query ?? '' };
|
|
221
|
+
}
|
|
222
|
+
ctx.enrich.echo(target.query);
|
|
223
|
+
const summary = await inspire.getCitationSummary({ query: target.query, excludeSelfCitations: input.exclude_self_citations, ...filters }, call);
|
|
224
|
+
ctx.log.info('Citation summary computed', {
|
|
225
|
+
kind: target.kind,
|
|
226
|
+
matchedRecords: summary.matchedRecords,
|
|
227
|
+
citeablePapers: summary.citeablePapers,
|
|
228
|
+
});
|
|
229
|
+
if (summary.citeablePapers === 0) {
|
|
230
|
+
const notices = [
|
|
231
|
+
'No citeable papers matched; the summary is all zeros. Check the query with cern_inspire_search_literature first.',
|
|
232
|
+
];
|
|
233
|
+
if (input.query && containsOrcid(input.query)) {
|
|
234
|
+
notices.push('Literature queries do not match ORCIDs; pass the ORCID as author instead.');
|
|
235
|
+
}
|
|
236
|
+
ctx.enrich.notice(notices.join(' '));
|
|
237
|
+
}
|
|
238
|
+
return { target, ...summary };
|
|
239
|
+
},
|
|
240
|
+
format: (result) => {
|
|
241
|
+
const t = result.target;
|
|
242
|
+
const subject = t.authorRecid !== undefined || t.authorName !== undefined
|
|
243
|
+
? `${t.authorName ? inline(t.authorName) : '(unnamed)'}${t.authorRecid ? ` (author recid ${t.authorRecid})` : ''}`
|
|
244
|
+
: undefined;
|
|
245
|
+
const lines = [
|
|
246
|
+
`## INSPIRE citation summary${subject ? ` — ${subject}` : ''}`,
|
|
247
|
+
`**Target kind:** ${t.kind} · **Query:** ${inline(t.query)}`,
|
|
248
|
+
`**Matched records:** ${result.matchedRecords} · **Citeable papers:** ${result.citeablePapers}`,
|
|
249
|
+
`**h-index:** ${result.hIndex.all} (all citeable) · ${result.hIndex.published} (published)`,
|
|
250
|
+
'',
|
|
251
|
+
'| Scope | Papers | Citations | Average citations |',
|
|
252
|
+
'|:--|--:|--:|--:|',
|
|
253
|
+
renderTotals('All citeable', result.all),
|
|
254
|
+
renderTotals('Published', result.published),
|
|
255
|
+
];
|
|
256
|
+
if (result.buckets.all.length > 0 || result.buckets.published.length > 0) {
|
|
257
|
+
lines.push('', ...renderBuckets(result.buckets.all, result.buckets.published));
|
|
258
|
+
}
|
|
259
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
260
|
+
},
|
|
261
|
+
});
|
|
262
|
+
//# sourceMappingURL=get-citation-summary.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-citation-summary.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-citation-summary.tool.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AAC,CAAC,KAAK,CAAC,EAAE;YAC5D,wBAAwB,MAAM,CAAC,cAAc,2BAA2B,MAAM,CAAC,cAAc,EAAE;YAC/F,gBAAgB,MAAM,CAAC,MAAM,CAAC,GAAG,qBAAqB,MAAM,CAAC,MAAM,CAAC,SAAS,cAAc;YAC3F,EAAE;YACF,oDAAoD;YACpD,mBAAmB;YACnB,YAAY,CAAC,cAAc,EAAE,MAAM,CAAC,GAAG,CAAC;YACxC,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,SAAS,CAAC;SAC5C,CAAC;QACF,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACzE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;QACjF,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,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview cern_inspire_get_paper — one INSPIRE-HEP paper's full record by
|
|
3
|
+
* recid, arXiv ID, or DOI: authors with affiliations, abstract, publication,
|
|
4
|
+
* identifiers, citation counts, linked experiments, and whether HEPData holds
|
|
5
|
+
* its numerical tables. Also exports the dossier schema the
|
|
6
|
+
* `inspire://literature/{recid}` resource validates against.
|
|
7
|
+
* @module mcp-server/tools/definitions/get-paper.tool
|
|
8
|
+
*/
|
|
9
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
10
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
11
|
+
/** The `get_paper` dossier — the tool's output and the literature resource's body. */
|
|
12
|
+
export declare const paperDossierSchema: z.ZodObject<{
|
|
13
|
+
recid: z.ZodString;
|
|
14
|
+
resolvedAs: z.ZodEnum<{
|
|
15
|
+
arxiv: "arxiv";
|
|
16
|
+
doi: "doi";
|
|
17
|
+
recid: "recid";
|
|
18
|
+
}>;
|
|
19
|
+
title: z.ZodString;
|
|
20
|
+
alternateTitles: z.ZodArray<z.ZodString>;
|
|
21
|
+
abstract: z.ZodOptional<z.ZodString>;
|
|
22
|
+
abstractSource: z.ZodOptional<z.ZodString>;
|
|
23
|
+
authorCount: z.ZodNumber;
|
|
24
|
+
authors: z.ZodArray<z.ZodObject<{
|
|
25
|
+
name: z.ZodString;
|
|
26
|
+
recid: z.ZodOptional<z.ZodString>;
|
|
27
|
+
bai: z.ZodOptional<z.ZodString>;
|
|
28
|
+
orcid: z.ZodOptional<z.ZodString>;
|
|
29
|
+
affiliations: z.ZodArray<z.ZodString>;
|
|
30
|
+
}, z.core.$strip>>;
|
|
31
|
+
collaborations: z.ZodArray<z.ZodString>;
|
|
32
|
+
experiments: z.ZodArray<z.ZodObject<{
|
|
33
|
+
name: z.ZodString;
|
|
34
|
+
recid: z.ZodOptional<z.ZodString>;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
date: z.ZodOptional<z.ZodString>;
|
|
37
|
+
preprintDate: z.ZodOptional<z.ZodString>;
|
|
38
|
+
publicationDate: z.ZodOptional<z.ZodString>;
|
|
39
|
+
publications: z.ZodArray<z.ZodObject<{
|
|
40
|
+
journal: z.ZodOptional<z.ZodString>;
|
|
41
|
+
volume: z.ZodOptional<z.ZodString>;
|
|
42
|
+
year: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
pages: z.ZodOptional<z.ZodString>;
|
|
44
|
+
articleId: z.ZodOptional<z.ZodString>;
|
|
45
|
+
freetext: z.ZodOptional<z.ZodString>;
|
|
46
|
+
}, z.core.$strip>>;
|
|
47
|
+
arxivId: z.ZodOptional<z.ZodString>;
|
|
48
|
+
arxivCategories: z.ZodArray<z.ZodString>;
|
|
49
|
+
dois: z.ZodArray<z.ZodString>;
|
|
50
|
+
reportNumbers: z.ZodArray<z.ZodString>;
|
|
51
|
+
keywords: z.ZodArray<z.ZodString>;
|
|
52
|
+
subjects: z.ZodArray<z.ZodString>;
|
|
53
|
+
documentTypes: z.ZodArray<z.ZodString>;
|
|
54
|
+
refereed: z.ZodOptional<z.ZodBoolean>;
|
|
55
|
+
citeable: z.ZodOptional<z.ZodBoolean>;
|
|
56
|
+
core: z.ZodOptional<z.ZodBoolean>;
|
|
57
|
+
numberOfPages: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
citationCount: z.ZodNumber;
|
|
59
|
+
citationCountWithoutSelf: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
texkeys: z.ZodArray<z.ZodString>;
|
|
61
|
+
urls: z.ZodArray<z.ZodObject<{
|
|
62
|
+
url: z.ZodString;
|
|
63
|
+
description: z.ZodOptional<z.ZodString>;
|
|
64
|
+
}, z.core.$strip>>;
|
|
65
|
+
licenses: z.ZodArray<z.ZodObject<{
|
|
66
|
+
url: z.ZodString;
|
|
67
|
+
material: z.ZodOptional<z.ZodString>;
|
|
68
|
+
imposing: z.ZodOptional<z.ZodString>;
|
|
69
|
+
}, z.core.$strip>>;
|
|
70
|
+
inspireUrl: z.ZodString;
|
|
71
|
+
citingQuery: z.ZodString;
|
|
72
|
+
referencesQuery: z.ZodString;
|
|
73
|
+
hepdata: z.ZodObject<{
|
|
74
|
+
status: z.ZodEnum<{
|
|
75
|
+
available: "available";
|
|
76
|
+
lookup_failed: "lookup_failed";
|
|
77
|
+
none: "none";
|
|
78
|
+
}>;
|
|
79
|
+
inspireDataRecid: z.ZodOptional<z.ZodString>;
|
|
80
|
+
recordDoi: z.ZodOptional<z.ZodString>;
|
|
81
|
+
latestVersion: z.ZodOptional<z.ZodNumber>;
|
|
82
|
+
tableCount: z.ZodOptional<z.ZodNumber>;
|
|
83
|
+
hepdataUrl: z.ZodOptional<z.ZodString>;
|
|
84
|
+
}, z.core.$strip>;
|
|
85
|
+
}, z.core.$strip>;
|
|
86
|
+
export type PaperDossierOutput = z.infer<typeof paperDossierSchema>;
|
|
87
|
+
export declare const getPaperTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
88
|
+
paper: z.ZodPreprocess<z.ZodString, unknown>;
|
|
89
|
+
max_authors: z.ZodPreprocess<z.ZodDefault<z.ZodNumber>, unknown>;
|
|
90
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
91
|
+
recid: z.ZodString;
|
|
92
|
+
resolvedAs: z.ZodEnum<{
|
|
93
|
+
arxiv: "arxiv";
|
|
94
|
+
doi: "doi";
|
|
95
|
+
recid: "recid";
|
|
96
|
+
}>;
|
|
97
|
+
title: z.ZodString;
|
|
98
|
+
alternateTitles: z.ZodArray<z.ZodString>;
|
|
99
|
+
abstract: z.ZodOptional<z.ZodString>;
|
|
100
|
+
abstractSource: z.ZodOptional<z.ZodString>;
|
|
101
|
+
authorCount: z.ZodNumber;
|
|
102
|
+
authors: z.ZodArray<z.ZodObject<{
|
|
103
|
+
name: z.ZodString;
|
|
104
|
+
recid: z.ZodOptional<z.ZodString>;
|
|
105
|
+
bai: z.ZodOptional<z.ZodString>;
|
|
106
|
+
orcid: z.ZodOptional<z.ZodString>;
|
|
107
|
+
affiliations: z.ZodArray<z.ZodString>;
|
|
108
|
+
}, z.core.$strip>>;
|
|
109
|
+
collaborations: z.ZodArray<z.ZodString>;
|
|
110
|
+
experiments: z.ZodArray<z.ZodObject<{
|
|
111
|
+
name: z.ZodString;
|
|
112
|
+
recid: z.ZodOptional<z.ZodString>;
|
|
113
|
+
}, z.core.$strip>>;
|
|
114
|
+
date: z.ZodOptional<z.ZodString>;
|
|
115
|
+
preprintDate: z.ZodOptional<z.ZodString>;
|
|
116
|
+
publicationDate: z.ZodOptional<z.ZodString>;
|
|
117
|
+
publications: z.ZodArray<z.ZodObject<{
|
|
118
|
+
journal: z.ZodOptional<z.ZodString>;
|
|
119
|
+
volume: z.ZodOptional<z.ZodString>;
|
|
120
|
+
year: z.ZodOptional<z.ZodNumber>;
|
|
121
|
+
pages: z.ZodOptional<z.ZodString>;
|
|
122
|
+
articleId: z.ZodOptional<z.ZodString>;
|
|
123
|
+
freetext: z.ZodOptional<z.ZodString>;
|
|
124
|
+
}, z.core.$strip>>;
|
|
125
|
+
arxivId: z.ZodOptional<z.ZodString>;
|
|
126
|
+
arxivCategories: z.ZodArray<z.ZodString>;
|
|
127
|
+
dois: z.ZodArray<z.ZodString>;
|
|
128
|
+
reportNumbers: z.ZodArray<z.ZodString>;
|
|
129
|
+
keywords: z.ZodArray<z.ZodString>;
|
|
130
|
+
subjects: z.ZodArray<z.ZodString>;
|
|
131
|
+
documentTypes: z.ZodArray<z.ZodString>;
|
|
132
|
+
refereed: z.ZodOptional<z.ZodBoolean>;
|
|
133
|
+
citeable: z.ZodOptional<z.ZodBoolean>;
|
|
134
|
+
core: z.ZodOptional<z.ZodBoolean>;
|
|
135
|
+
numberOfPages: z.ZodOptional<z.ZodNumber>;
|
|
136
|
+
citationCount: z.ZodNumber;
|
|
137
|
+
citationCountWithoutSelf: z.ZodOptional<z.ZodNumber>;
|
|
138
|
+
texkeys: z.ZodArray<z.ZodString>;
|
|
139
|
+
urls: z.ZodArray<z.ZodObject<{
|
|
140
|
+
url: z.ZodString;
|
|
141
|
+
description: z.ZodOptional<z.ZodString>;
|
|
142
|
+
}, z.core.$strip>>;
|
|
143
|
+
licenses: z.ZodArray<z.ZodObject<{
|
|
144
|
+
url: z.ZodString;
|
|
145
|
+
material: z.ZodOptional<z.ZodString>;
|
|
146
|
+
imposing: z.ZodOptional<z.ZodString>;
|
|
147
|
+
}, z.core.$strip>>;
|
|
148
|
+
inspireUrl: z.ZodString;
|
|
149
|
+
citingQuery: z.ZodString;
|
|
150
|
+
referencesQuery: z.ZodString;
|
|
151
|
+
hepdata: z.ZodObject<{
|
|
152
|
+
status: z.ZodEnum<{
|
|
153
|
+
available: "available";
|
|
154
|
+
lookup_failed: "lookup_failed";
|
|
155
|
+
none: "none";
|
|
156
|
+
}>;
|
|
157
|
+
inspireDataRecid: z.ZodOptional<z.ZodString>;
|
|
158
|
+
recordDoi: z.ZodOptional<z.ZodString>;
|
|
159
|
+
latestVersion: z.ZodOptional<z.ZodNumber>;
|
|
160
|
+
tableCount: z.ZodOptional<z.ZodNumber>;
|
|
161
|
+
hepdataUrl: z.ZodOptional<z.ZodString>;
|
|
162
|
+
}, z.core.$strip>;
|
|
163
|
+
}, z.core.$strip>, readonly [{
|
|
164
|
+
readonly reason: "paper_not_found";
|
|
165
|
+
readonly code: JsonRpcErrorCode.NotFound;
|
|
166
|
+
readonly when: "The recid, arXiv ID, or DOI matches no INSPIRE literature record.";
|
|
167
|
+
readonly recovery: "Find the record with cern_inspire_search_literature using title words, an author, or the arXiv number, then call cern_inspire_get_paper with its recid.";
|
|
168
|
+
readonly severity: "notice";
|
|
169
|
+
}, {
|
|
170
|
+
readonly reason: "inspire_rate_limited";
|
|
171
|
+
readonly code: JsonRpcErrorCode.RateLimited;
|
|
172
|
+
readonly when: "INSPIRE returned 429 after the pacer and retries.";
|
|
173
|
+
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.";
|
|
174
|
+
readonly retryable: true;
|
|
175
|
+
readonly thrownBy: "service";
|
|
176
|
+
}, {
|
|
177
|
+
readonly reason: "pacer_shed";
|
|
178
|
+
readonly code: JsonRpcErrorCode.RateLimited;
|
|
179
|
+
readonly when: "The server's outbound INSPIRE queue could not start the request within the call's remaining budget.";
|
|
180
|
+
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.";
|
|
181
|
+
readonly retryable: true;
|
|
182
|
+
readonly thrownBy: "service";
|
|
183
|
+
}, {
|
|
184
|
+
readonly reason: "upstream_unreadable";
|
|
185
|
+
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
186
|
+
readonly when: "The INSPIRE body exceeded the byte ceiling, was HTML where JSON was expected, or was invalid JSON.";
|
|
187
|
+
readonly recovery: "Retry this call in a few seconds; if it fails again, read the paper's summary record with cern_inspire_search_literature (query \"recid:N\", \"arxiv:ID\", or \"doi:DOI\").";
|
|
188
|
+
readonly thrownBy: "service";
|
|
189
|
+
}], {
|
|
190
|
+
readonly truncated: z.ZodBoolean;
|
|
191
|
+
readonly shown: z.ZodNumber;
|
|
192
|
+
readonly cap: z.ZodNumber;
|
|
193
|
+
readonly notice: z.ZodOptional<z.ZodString>;
|
|
194
|
+
}>;
|
|
195
|
+
//# sourceMappingURL=get-paper.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-paper.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-paper.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAQjE,sFAAsF;AACtF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuK7B,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AA4JpE,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgGvB,CAAC"}
|