@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,7 @@
1
+ /**
2
+ * @fileoverview Every resource definition this server registers, collected for `createApp()`.
3
+ * @module mcp-server/resources/definitions
4
+ */
5
+ import { inspireLiteratureResource } from './inspire-literature.resource.js';
6
+ export const allResourceDefinitions = [inspireLiteratureResource];
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAE7E,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,yBAAyB,CAAC,CAAC"}
@@ -0,0 +1,110 @@
1
+ /**
2
+ * @fileoverview `inspire://literature/{recid}` — the cern_inspire_get_paper
3
+ * dossier for one INSPIRE-HEP literature record, as JSON, with the default
4
+ * author cap.
5
+ * @module mcp-server/resources/definitions/inspire-literature.resource
6
+ */
7
+ import { z } from '@cyanheads/mcp-ts-core';
8
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
9
+ export declare const inspireLiteratureResource: import("@cyanheads/mcp-ts-core").ResourceDefinition<z.ZodObject<{
10
+ recid: z.ZodString;
11
+ }, z.core.$strip>, z.ZodObject<{
12
+ recid: z.ZodString;
13
+ resolvedAs: z.ZodEnum<{
14
+ arxiv: "arxiv";
15
+ doi: "doi";
16
+ recid: "recid";
17
+ }>;
18
+ title: z.ZodString;
19
+ alternateTitles: z.ZodArray<z.ZodString>;
20
+ abstract: z.ZodOptional<z.ZodString>;
21
+ abstractSource: z.ZodOptional<z.ZodString>;
22
+ authorCount: z.ZodNumber;
23
+ authors: z.ZodArray<z.ZodObject<{
24
+ name: z.ZodString;
25
+ recid: z.ZodOptional<z.ZodString>;
26
+ bai: z.ZodOptional<z.ZodString>;
27
+ orcid: z.ZodOptional<z.ZodString>;
28
+ affiliations: z.ZodArray<z.ZodString>;
29
+ }, z.core.$strip>>;
30
+ collaborations: z.ZodArray<z.ZodString>;
31
+ experiments: z.ZodArray<z.ZodObject<{
32
+ name: z.ZodString;
33
+ recid: z.ZodOptional<z.ZodString>;
34
+ }, z.core.$strip>>;
35
+ date: z.ZodOptional<z.ZodString>;
36
+ preprintDate: z.ZodOptional<z.ZodString>;
37
+ publicationDate: z.ZodOptional<z.ZodString>;
38
+ publications: z.ZodArray<z.ZodObject<{
39
+ journal: z.ZodOptional<z.ZodString>;
40
+ volume: z.ZodOptional<z.ZodString>;
41
+ year: z.ZodOptional<z.ZodNumber>;
42
+ pages: z.ZodOptional<z.ZodString>;
43
+ articleId: z.ZodOptional<z.ZodString>;
44
+ freetext: z.ZodOptional<z.ZodString>;
45
+ }, z.core.$strip>>;
46
+ arxivId: z.ZodOptional<z.ZodString>;
47
+ arxivCategories: z.ZodArray<z.ZodString>;
48
+ dois: z.ZodArray<z.ZodString>;
49
+ reportNumbers: z.ZodArray<z.ZodString>;
50
+ keywords: z.ZodArray<z.ZodString>;
51
+ subjects: z.ZodArray<z.ZodString>;
52
+ documentTypes: z.ZodArray<z.ZodString>;
53
+ refereed: z.ZodOptional<z.ZodBoolean>;
54
+ citeable: z.ZodOptional<z.ZodBoolean>;
55
+ core: z.ZodOptional<z.ZodBoolean>;
56
+ numberOfPages: z.ZodOptional<z.ZodNumber>;
57
+ citationCount: z.ZodNumber;
58
+ citationCountWithoutSelf: z.ZodOptional<z.ZodNumber>;
59
+ texkeys: z.ZodArray<z.ZodString>;
60
+ urls: z.ZodArray<z.ZodObject<{
61
+ url: z.ZodString;
62
+ description: z.ZodOptional<z.ZodString>;
63
+ }, z.core.$strip>>;
64
+ licenses: z.ZodArray<z.ZodObject<{
65
+ url: z.ZodString;
66
+ material: z.ZodOptional<z.ZodString>;
67
+ imposing: z.ZodOptional<z.ZodString>;
68
+ }, z.core.$strip>>;
69
+ inspireUrl: z.ZodString;
70
+ citingQuery: z.ZodString;
71
+ referencesQuery: z.ZodString;
72
+ hepdata: z.ZodObject<{
73
+ status: z.ZodEnum<{
74
+ available: "available";
75
+ lookup_failed: "lookup_failed";
76
+ none: "none";
77
+ }>;
78
+ inspireDataRecid: z.ZodOptional<z.ZodString>;
79
+ recordDoi: z.ZodOptional<z.ZodString>;
80
+ latestVersion: z.ZodOptional<z.ZodNumber>;
81
+ tableCount: z.ZodOptional<z.ZodNumber>;
82
+ hepdataUrl: z.ZodOptional<z.ZodString>;
83
+ }, z.core.$strip>;
84
+ }, z.core.$strip>, readonly [{
85
+ readonly reason: "paper_not_found";
86
+ readonly code: JsonRpcErrorCode.NotFound;
87
+ readonly when: "The recid matches no INSPIRE literature record.";
88
+ 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.";
89
+ }, {
90
+ readonly reason: "inspire_rate_limited";
91
+ readonly code: JsonRpcErrorCode.RateLimited;
92
+ readonly when: "INSPIRE returned 429 after the pacer and retries.";
93
+ readonly recovery: "Wait the retry-after seconds this error states (at least 5), then read the resource again; INSPIRE allows 15 requests per 5 seconds from one address.";
94
+ readonly retryable: true;
95
+ readonly thrownBy: "service";
96
+ }, {
97
+ readonly reason: "pacer_shed";
98
+ readonly code: JsonRpcErrorCode.RateLimited;
99
+ readonly when: "The server's outbound INSPIRE queue could not start the request within the read's remaining budget.";
100
+ 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 read the resource again with fewer cern_inspire calls running in parallel.";
101
+ readonly retryable: true;
102
+ readonly thrownBy: "service";
103
+ }, {
104
+ readonly reason: "upstream_unreadable";
105
+ readonly code: JsonRpcErrorCode.ServiceUnavailable;
106
+ readonly when: "The INSPIRE body exceeded the byte ceiling, was HTML where JSON was expected, or was invalid JSON.";
107
+ readonly recovery: "Read the resource again in a few seconds; if it fails again, read the summary record with cern_inspire_search_literature using query \"recid:N\".";
108
+ readonly thrownBy: "service";
109
+ }]>;
110
+ //# sourceMappingURL=inspire-literature.resource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspire-literature.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/inspire-literature.resource.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAOjE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEpC,CAAC"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * @fileoverview `inspire://literature/{recid}` — the cern_inspire_get_paper
3
+ * dossier for one INSPIRE-HEP literature record, as JSON, with the default
4
+ * author cap.
5
+ * @module mcp-server/resources/definitions/inspire-literature.resource
6
+ */
7
+ import { resource, z } from '@cyanheads/mcp-ts-core';
8
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
9
+ import { paperDossierSchema } from '../../tools/definitions/get-paper.tool.js';
10
+ import { getInspireService } from '../../../services/inspire/inspire-service.js';
11
+ /** The author cap the resource applies: cern_inspire_get_paper's default. */
12
+ const RESOURCE_MAX_AUTHORS = 25;
13
+ export const inspireLiteratureResource = resource('inspire://literature/{recid}', {
14
+ name: 'inspire_literature',
15
+ title: 'INSPIRE literature record',
16
+ description: 'One INSPIRE-HEP literature record by recid, as the cern_inspire_get_paper dossier in JSON: title, abstract, authors with affiliations (first 25; authorCount gives the total), publication, identifiers, citation counts, linked experiments, texkeys, and HEPData availability. Use cern_inspire_get_paper to raise the author cap or to look a paper up by arXiv ID or DOI.',
17
+ mimeType: 'application/json',
18
+ params: z.object({
19
+ recid: z
20
+ .string()
21
+ .regex(/^\d{1,9}$/)
22
+ .describe('INSPIRE literature record ID (recid), e.g. 451647.'),
23
+ }),
24
+ output: paperDossierSchema,
25
+ cacheHint: { ttlMs: 3_600_000, cacheScope: 'public' },
26
+ errors: [
27
+ {
28
+ reason: 'paper_not_found',
29
+ code: JsonRpcErrorCode.NotFound,
30
+ when: 'The recid matches no INSPIRE literature record.',
31
+ 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.',
32
+ },
33
+ {
34
+ reason: 'inspire_rate_limited',
35
+ code: JsonRpcErrorCode.RateLimited,
36
+ when: 'INSPIRE returned 429 after the pacer and retries.',
37
+ recovery: 'Wait the retry-after seconds this error states (at least 5), then read the resource again; INSPIRE allows 15 requests per 5 seconds from one address.',
38
+ retryable: true,
39
+ thrownBy: 'service',
40
+ },
41
+ {
42
+ reason: 'pacer_shed',
43
+ code: JsonRpcErrorCode.RateLimited,
44
+ when: "The server's outbound INSPIRE queue could not start the request within the read's remaining budget.",
45
+ 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 read the resource again with fewer cern_inspire calls running in parallel.",
46
+ retryable: true,
47
+ thrownBy: 'service',
48
+ },
49
+ {
50
+ reason: 'upstream_unreadable',
51
+ code: JsonRpcErrorCode.ServiceUnavailable,
52
+ when: 'The INSPIRE body exceeded the byte ceiling, was HTML where JSON was expected, or was invalid JSON.',
53
+ recovery: 'Read the resource again in a few seconds; if it fails again, read the summary record with cern_inspire_search_literature using query "recid:N".',
54
+ thrownBy: 'service',
55
+ },
56
+ ],
57
+ async handler(params, ctx) {
58
+ const inspire = getInspireService();
59
+ // A body is cached publicly for an hour, so a failed HEPData lookup fails the read instead.
60
+ const lookup = await inspire.getPaper(params.recid, RESOURCE_MAX_AUTHORS, inspire.beginCall(ctx), { requireHepdata: true });
61
+ if (!lookup) {
62
+ throw ctx.fail('paper_not_found', `No INSPIRE literature record has recid ${params.recid}.`, {
63
+ recid: params.recid,
64
+ });
65
+ }
66
+ return lookup.paper;
67
+ },
68
+ });
69
+ //# sourceMappingURL=inspire-literature.resource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspire-literature.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/inspire-literature.resource.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,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C,IAAI,EAAE,oGAAoG;YAC1G,QAAQ,EACN,iJAAiJ;YACnJ,QAAQ,EAAE,SAAS;SACpB;KACF;IAED,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG;QACvB,MAAM,OAAO,GAAG,iBAAiB,EAAE,CAAC;QACpC,4FAA4F;QAC5F,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,QAAQ,CACnC,MAAM,CAAC,KAAK,EACZ,oBAAoB,EACpB,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,EACtB,EAAE,cAAc,EAAE,IAAI,EAAE,CACzB,CAAC;QACF,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,GAAG,CAAC,IAAI,CAAC,iBAAiB,EAAE,0CAA0C,MAAM,CAAC,KAAK,GAAG,EAAE;gBAC3F,KAAK,EAAE,MAAM,CAAC,KAAK;aACpB,CAAC,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC,KAAK,CAAC;IACtB,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * @fileoverview cern_inspire_export_citations — INSPIRE-HEP's own BibTeX or
3
+ * LaTeX (`\bibitem`, EU or US style) citation entries for the papers a
4
+ * literature query selects, verbatim and keyed by INSPIRE texkeys.
5
+ * @module mcp-server/tools/definitions/export-citations.tool
6
+ */
7
+ import { z } from '@cyanheads/mcp-ts-core';
8
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
9
+ export declare const exportCitationsTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
10
+ query: z.ZodString;
11
+ format: z.ZodPreprocess<z.ZodDefault<z.ZodEnum<{
12
+ bibtex: "bibtex";
13
+ "latex-eu": "latex-eu";
14
+ "latex-us": "latex-us";
15
+ }>>, unknown>;
16
+ sort: z.ZodPreprocess<z.ZodDefault<z.ZodEnum<{
17
+ mostcited: "mostcited";
18
+ mostrecent: "mostrecent";
19
+ relevance: "relevance";
20
+ }>>, unknown>;
21
+ size: z.ZodPreprocess<z.ZodDefault<z.ZodNumber>, unknown>;
22
+ }, z.core.$strip>, z.ZodObject<{
23
+ format: z.ZodEnum<{
24
+ bibtex: "bibtex";
25
+ "latex-eu": "latex-eu";
26
+ "latex-us": "latex-us";
27
+ }>;
28
+ entries: z.ZodArray<z.ZodObject<{
29
+ texkey: z.ZodString;
30
+ text: z.ZodString;
31
+ }, z.core.$strip>>;
32
+ }, z.core.$strip>, readonly [{
33
+ readonly reason: "invalid_query";
34
+ readonly code: JsonRpcErrorCode.ValidationError;
35
+ readonly when: "INSPIRE answered 400 to a parameter value it refuses.";
36
+ readonly recovery: "Check the query against cern_inspire_list_reference topic search_syntax, then retry cern_inspire_export_citations with the corrected query.";
37
+ readonly severity: "notice";
38
+ readonly thrownBy: "service";
39
+ }, {
40
+ readonly reason: "inspire_rate_limited";
41
+ readonly code: JsonRpcErrorCode.RateLimited;
42
+ readonly when: "INSPIRE returned 429 after the pacer and retries.";
43
+ 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.";
44
+ readonly retryable: true;
45
+ readonly thrownBy: "service";
46
+ }, {
47
+ readonly reason: "pacer_shed";
48
+ readonly code: JsonRpcErrorCode.RateLimited;
49
+ readonly when: "The server's outbound INSPIRE queue could not start the request within the call's remaining budget.";
50
+ 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.";
51
+ readonly retryable: true;
52
+ readonly thrownBy: "service";
53
+ }, {
54
+ readonly reason: "upstream_unreadable";
55
+ readonly code: JsonRpcErrorCode.ServiceUnavailable;
56
+ readonly when: "The INSPIRE body exceeded the byte ceiling, or was JSON or HTML where citation text was expected.";
57
+ readonly recovery: "Retry this call in a few seconds; if it fails again, retry cern_inspire_export_citations with a smaller size.";
58
+ readonly thrownBy: "service";
59
+ }], {
60
+ readonly truncated: z.ZodBoolean;
61
+ readonly shown: z.ZodNumber;
62
+ readonly cap: z.ZodNumber;
63
+ readonly notice: z.ZodOptional<z.ZodString>;
64
+ }>;
65
+ //# sourceMappingURL=export-citations.tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export-citations.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/export-citations.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAWjE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuI9B,CAAC"}
@@ -0,0 +1,120 @@
1
+ /**
2
+ * @fileoverview cern_inspire_export_citations — INSPIRE-HEP's own BibTeX or
3
+ * LaTeX (`\bibitem`, EU or US style) citation entries for the papers a
4
+ * literature query selects, verbatim and keyed by INSPIRE texkeys.
5
+ * @module mcp-server/tools/definitions/export-citations.tool
6
+ */
7
+ import { tool, z } from '@cyanheads/mcp-ts-core';
8
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
9
+ import { blankAsUnset } from '../inputs.js';
10
+ import { getInspireService } from '../../../services/inspire/inspire-service.js';
11
+ import { fenced, inline } from '../../../utils/render.js';
12
+ const FORMATS = ['bibtex', 'latex-eu', 'latex-us'];
13
+ const SORTS = ['relevance', 'mostrecent', 'mostcited'];
14
+ /** Upper bound on `size`. */
15
+ const MAX_ENTRIES = 50;
16
+ export const exportCitationsTool = tool('cern_inspire_export_citations', {
17
+ title: 'Export INSPIRE citations',
18
+ description: 'Export INSPIRE-HEP\'s citation entries for the papers a literature query selects, as BibTeX or LaTeX \\bibitem entries (EU or US style), keyed by INSPIRE texkeys and ready to paste into a bibliography. Name specific papers with "recid:451647 or arxiv:1207.7214 or doi:10.1016/…", or export a topic, author, or citing set with any query cern_inspire_search_literature accepts. Entries are INSPIRE\'s verbatim text (long author lists arrive abbreviated as "First, Name and others").',
19
+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
20
+ input: z.object({
21
+ query: z
22
+ .string()
23
+ .trim()
24
+ .min(1)
25
+ .max(1000)
26
+ .describe('Literature query selecting the papers to cite. Named papers: "recid:451647 or arxiv:1207.7214 or doi:10.1016/j.physletb.2012.08.020". Or any INSPIRE query: a topic ("t higgs and topcite 500+"), an author ("a Edward.Witten.1"), or the papers citing a record ("refersto:recid:451647"). See cern_inspire_list_reference topic search_syntax.'),
27
+ format: blankAsUnset(z.enum(FORMATS).default('bibtex')).describe('Entry format: bibtex (default), latex-eu, or latex-us (\\bibitem entries in European or US style).'),
28
+ sort: blankAsUnset(z.enum(SORTS).default('relevance')).describe('Entry order: relevance (default), mostrecent, or mostcited.'),
29
+ size: blankAsUnset(z.number().int().min(1).max(MAX_ENTRIES).default(10)).describe('Most entries to return (1–50, default 10).'),
30
+ }),
31
+ // The sibling top-N tools (search_authors, search_experiments) call their cap `limit`.
32
+ inputAliases: { limit: 'size' },
33
+ output: z.object({
34
+ format: z.enum(FORMATS).describe('The entry format returned.'),
35
+ entries: z
36
+ .array(z
37
+ .object({
38
+ texkey: z
39
+ .string()
40
+ .describe('INSPIRE texkey (the \\cite key), e.g. Maldacena:1997re; empty when INSPIRE gives none.'),
41
+ text: z.string().describe('The entry, verbatim as INSPIRE serves it.'),
42
+ })
43
+ .describe('One citation entry.'))
44
+ .describe('Citation entries, in the requested order.'),
45
+ }),
46
+ enrichment: {
47
+ truncated: z.boolean().describe('True when more papers matched than size.'),
48
+ shown: z.number().describe('Number of entries returned.'),
49
+ cap: z.number().describe('The size cap applied.'),
50
+ notice: z
51
+ .string()
52
+ .optional()
53
+ .describe('Guidance when nothing matched or the export was capped.'),
54
+ },
55
+ errors: [
56
+ {
57
+ reason: 'invalid_query',
58
+ code: JsonRpcErrorCode.ValidationError,
59
+ when: 'INSPIRE answered 400 to a parameter value it refuses.',
60
+ recovery: 'Check the query against cern_inspire_list_reference topic search_syntax, then retry cern_inspire_export_citations with the corrected query.',
61
+ severity: 'notice',
62
+ thrownBy: 'service',
63
+ },
64
+ {
65
+ reason: 'inspire_rate_limited',
66
+ code: JsonRpcErrorCode.RateLimited,
67
+ when: 'INSPIRE returned 429 after the pacer and retries.',
68
+ 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.',
69
+ retryable: true,
70
+ thrownBy: 'service',
71
+ },
72
+ {
73
+ reason: 'pacer_shed',
74
+ code: JsonRpcErrorCode.RateLimited,
75
+ when: "The server's outbound INSPIRE queue could not start the request within the call's remaining budget.",
76
+ 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.",
77
+ retryable: true,
78
+ thrownBy: 'service',
79
+ },
80
+ {
81
+ reason: 'upstream_unreadable',
82
+ code: JsonRpcErrorCode.ServiceUnavailable,
83
+ when: 'The INSPIRE body exceeded the byte ceiling, or was JSON or HTML where citation text was expected.',
84
+ recovery: 'Retry this call in a few seconds; if it fails again, retry cern_inspire_export_citations with a smaller size.',
85
+ thrownBy: 'service',
86
+ },
87
+ ],
88
+ async handler(input, ctx) {
89
+ ctx.enrich({ truncated: false, shown: 0, cap: input.size });
90
+ const inspire = getInspireService();
91
+ const result = await inspire.exportCitations({ query: input.query, format: input.format, sort: input.sort, size: input.size }, inspire.beginCall(ctx));
92
+ const shown = result.entries.length;
93
+ ctx.enrich({ shown });
94
+ ctx.log.info('Citation export completed', {
95
+ format: input.format,
96
+ shown,
97
+ truncated: result.truncated,
98
+ });
99
+ if (shown === 0) {
100
+ ctx.enrich.notice(`No INSPIRE literature matched "${inline(input.query)}"; find the papers with cern_inspire_search_literature, then export by recid ("recid:N or recid:M").`);
101
+ }
102
+ else if (result.truncated) {
103
+ ctx.enrich.truncated({
104
+ shown,
105
+ cap: input.size,
106
+ guidance: `More papers matched than size; raise size (max ${MAX_ENTRIES}), narrow the query, or export by recid.`,
107
+ });
108
+ }
109
+ return { format: input.format, entries: result.entries };
110
+ },
111
+ format: (result) => {
112
+ const lines = [`## INSPIRE citations (${result.format}, ${result.entries.length} entries)`];
113
+ if (result.entries.length > 0) {
114
+ const keys = result.entries.map((e) => (e.texkey ? inline(e.texkey) : '(no texkey)'));
115
+ lines.push(`**Texkeys:** ${keys.join(', ')}`, '', fenced(result.entries.map((e) => e.text).join('\n\n'), result.format === 'bibtex' ? 'bibtex' : 'latex'));
116
+ }
117
+ return [{ type: 'text', text: lines.join('\n') }];
118
+ },
119
+ });
120
+ //# sourceMappingURL=export-citations.tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export-citations.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/export-citations.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;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,MAAM,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,OAAO,GAAG,CAAC,QAAQ,EAAE,UAAU,EAAE,UAAU,CAAU,CAAC;AAC5D,MAAM,KAAK,GAAG,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,CAAU,CAAC;AAEhE,6BAA6B;AAC7B,MAAM,WAAW,GAAG,EAAE,CAAC;AAEvB,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC,+BAA+B,EAAE;IACvE,KAAK,EAAE,0BAA0B;IACjC,WAAW,EACT,keAAke;IACpe,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,I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;YAC9B,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;YACtF,KAAK,CAAC,IAAI,CACR,gBAAgB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EACjC,EAAE,EACF,MAAM,CACJ,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAC9C,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAChD,CACF,CAAC;QACJ,CAAC;QACD,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,159 @@
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 { z } from '@cyanheads/mcp-ts-core';
9
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
10
+ export declare const getCitationSummaryTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
11
+ author: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
12
+ query: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
13
+ document_types: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodEnum<{
14
+ "activity report": "activity report";
15
+ article: "article";
16
+ book: "book";
17
+ "book chapter": "book chapter";
18
+ "conference paper": "conference paper";
19
+ introductory: "introductory";
20
+ lectures: "lectures";
21
+ note: "note";
22
+ proceedings: "proceedings";
23
+ published: "published";
24
+ report: "report";
25
+ review: "review";
26
+ thesis: "thesis";
27
+ }>>>, unknown>;
28
+ subjects: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodEnum<{
29
+ Accelerators: "Accelerators";
30
+ Astrophysics: "Astrophysics";
31
+ Computing: "Computing";
32
+ "Condensed Matter": "Condensed Matter";
33
+ "Data Analysis and Statistics": "Data Analysis and Statistics";
34
+ "Experiment-HEP": "Experiment-HEP";
35
+ "Experiment-Nucl": "Experiment-Nucl";
36
+ "General Physics": "General Physics";
37
+ "Gravitation and Cosmology": "Gravitation and Cosmology";
38
+ Instrumentation: "Instrumentation";
39
+ Lattice: "Lattice";
40
+ "Math and Math Physics": "Math and Math Physics";
41
+ Other: "Other";
42
+ "Phenomenology-HEP": "Phenomenology-HEP";
43
+ "Quantum Physics": "Quantum Physics";
44
+ "Theory-HEP": "Theory-HEP";
45
+ "Theory-Nucl": "Theory-Nucl";
46
+ Unknown: "Unknown";
47
+ }>>>, unknown>;
48
+ year_from: z.ZodPreprocess<z.ZodOptional<z.ZodNumber>, unknown>;
49
+ year_to: z.ZodPreprocess<z.ZodOptional<z.ZodNumber>, unknown>;
50
+ exclude_self_citations: z.ZodPreprocess<z.ZodDefault<z.ZodBoolean>, unknown>;
51
+ }, z.core.$strip>, z.ZodObject<{
52
+ target: z.ZodObject<{
53
+ kind: z.ZodEnum<{
54
+ author: "author";
55
+ query: "query";
56
+ }>;
57
+ authorRecid: z.ZodOptional<z.ZodString>;
58
+ authorName: z.ZodOptional<z.ZodString>;
59
+ query: z.ZodString;
60
+ }, z.core.$strip>;
61
+ matchedRecords: z.ZodNumber;
62
+ citeablePapers: z.ZodNumber;
63
+ hIndex: z.ZodObject<{
64
+ all: z.ZodNumber;
65
+ published: z.ZodNumber;
66
+ }, z.core.$strip>;
67
+ all: z.ZodObject<{
68
+ papers: z.ZodNumber;
69
+ citations: z.ZodNumber;
70
+ averageCitations: z.ZodOptional<z.ZodNumber>;
71
+ }, z.core.$strip>;
72
+ published: z.ZodObject<{
73
+ papers: z.ZodNumber;
74
+ citations: z.ZodNumber;
75
+ averageCitations: z.ZodOptional<z.ZodNumber>;
76
+ }, z.core.$strip>;
77
+ buckets: z.ZodObject<{
78
+ all: z.ZodArray<z.ZodObject<{
79
+ range: z.ZodEnum<{
80
+ 0: "0";
81
+ "100\u2013249": "100–249";
82
+ "10\u201349": "10–49";
83
+ "1\u20139": "1–9";
84
+ "250\u2013499": "250–499";
85
+ "500+": "500+";
86
+ "50\u201399": "50–99";
87
+ }>;
88
+ papers: z.ZodNumber;
89
+ }, z.core.$strip>>;
90
+ published: z.ZodArray<z.ZodObject<{
91
+ range: z.ZodEnum<{
92
+ 0: "0";
93
+ "100\u2013249": "100–249";
94
+ "10\u201349": "10–49";
95
+ "1\u20139": "1–9";
96
+ "250\u2013499": "250–499";
97
+ "500+": "500+";
98
+ "50\u201399": "50–99";
99
+ }>;
100
+ papers: z.ZodNumber;
101
+ }, z.core.$strip>>;
102
+ }, z.core.$strip>;
103
+ }, z.core.$strip>, readonly [{
104
+ readonly reason: "missing_target";
105
+ readonly code: JsonRpcErrorCode.ValidationError;
106
+ readonly when: "Neither or both of author and query were given.";
107
+ readonly 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.";
108
+ readonly severity: "notice";
109
+ }, {
110
+ readonly reason: "author_not_identifier";
111
+ readonly code: JsonRpcErrorCode.ValidationError;
112
+ readonly when: "author is not a BAI, ORCID, INSPIRE ID, or recid — usually a name.";
113
+ readonly recovery: "Resolve the name with cern_inspire_search_authors, then pass the returned bai or recid as author.";
114
+ readonly severity: "notice";
115
+ }, {
116
+ readonly reason: "author_not_found";
117
+ readonly code: JsonRpcErrorCode.NotFound;
118
+ readonly when: "The author identifier matches no INSPIRE profile.";
119
+ readonly recovery: "Resolve the person with cern_inspire_search_authors, then pass the returned bai or recid as author.";
120
+ readonly severity: "notice";
121
+ }, {
122
+ readonly reason: "invalid_year_range";
123
+ readonly code: JsonRpcErrorCode.ValidationError;
124
+ readonly when: "year_from is later than year_to.";
125
+ readonly recovery: "Swap year_from and year_to so the range runs forward, or drop one bound for an open range, then retry this call.";
126
+ readonly severity: "notice";
127
+ }, {
128
+ readonly reason: "invalid_query";
129
+ readonly code: JsonRpcErrorCode.ValidationError;
130
+ readonly when: "INSPIRE answered 400 to a parameter value it refuses.";
131
+ readonly recovery: "Check the query and filters against cern_inspire_list_reference topic search_syntax, then retry cern_inspire_get_citation_summary.";
132
+ readonly severity: "notice";
133
+ readonly thrownBy: "service";
134
+ }, {
135
+ readonly reason: "inspire_rate_limited";
136
+ readonly code: JsonRpcErrorCode.RateLimited;
137
+ readonly when: "INSPIRE returned 429 after the pacer and retries.";
138
+ 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.";
139
+ readonly retryable: true;
140
+ readonly thrownBy: "service";
141
+ }, {
142
+ readonly reason: "pacer_shed";
143
+ readonly code: JsonRpcErrorCode.RateLimited;
144
+ readonly when: "The server's outbound INSPIRE queue could not start the request within the call's remaining budget.";
145
+ 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.";
146
+ readonly retryable: true;
147
+ readonly thrownBy: "service";
148
+ }, {
149
+ readonly reason: "upstream_unreadable";
150
+ readonly code: JsonRpcErrorCode.ServiceUnavailable;
151
+ readonly when: "The INSPIRE body exceeded the byte ceiling, was HTML where JSON was expected, or was invalid JSON.";
152
+ readonly 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.";
153
+ readonly thrownBy: "service";
154
+ }], {
155
+ readonly effectiveQuery: z.ZodString;
156
+ readonly appliedFilters: z.ZodString;
157
+ readonly notice: z.ZodOptional<z.ZodString>;
158
+ }>;
159
+ //# sourceMappingURL=get-citation-summary.tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-citation-summary.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-citation-summary.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAoEjE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8PjC,CAAC"}