@cyanheads/openalex-mcp-server 0.7.14 → 0.7.16
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 +8 -4
- package/CLAUDE.md +8 -4
- package/README.md +12 -9
- package/changelog/0.7.x/0.7.15.md +33 -0
- package/changelog/0.7.x/0.7.16.md +32 -0
- package/dist/mcp-server/prompts/definitions/literature-review.prompt.js +1 -1
- package/dist/mcp-server/prompts/definitions/literature-review.prompt.js.map +1 -1
- package/dist/mcp-server/tools/definitions/analyze-trends.tool.d.ts +22 -2
- package/dist/mcp-server/tools/definitions/analyze-trends.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/analyze-trends.tool.js +71 -17
- package/dist/mcp-server/tools/definitions/analyze-trends.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/citation-graph.tool.d.ts +12 -1
- package/dist/mcp-server/tools/definitions/citation-graph.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/citation-graph.tool.js +56 -39
- package/dist/mcp-server/tools/definitions/citation-graph.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/describe-fields.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/describe-fields.tool.js +82 -15
- package/dist/mcp-server/tools/definitions/describe-fields.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/resolve-name.tool.d.ts +18 -0
- package/dist/mcp-server/tools/definitions/resolve-name.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/resolve-name.tool.js +29 -7
- package/dist/mcp-server/tools/definitions/resolve-name.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-entities.tool.d.ts +50 -0
- package/dist/mcp-server/tools/definitions/search-entities.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-entities.tool.js +176 -41
- package/dist/mcp-server/tools/definitions/search-entities.tool.js.map +1 -1
- package/dist/mcp-server/tools/escape-markdown.d.ts +32 -0
- package/dist/mcp-server/tools/escape-markdown.d.ts.map +1 -0
- package/dist/mcp-server/tools/escape-markdown.js +389 -0
- package/dist/mcp-server/tools/escape-markdown.js.map +1 -0
- package/dist/mcp-server/tools/render-entity-record.d.ts +2 -1
- package/dist/mcp-server/tools/render-entity-record.d.ts.map +1 -1
- package/dist/mcp-server/tools/render-entity-record.js +24 -8
- package/dist/mcp-server/tools/render-entity-record.js.map +1 -1
- package/dist/services/openalex/html-entities.json +2237 -0
- package/dist/services/openalex/openalex-service.d.ts +17 -1
- package/dist/services/openalex/openalex-service.d.ts.map +1 -1
- package/dist/services/openalex/openalex-service.js +211 -101
- package/dist/services/openalex/openalex-service.js.map +1 -1
- package/dist/services/openalex/provider-text.d.ts +20 -0
- package/dist/services/openalex/provider-text.d.ts.map +1 -0
- package/dist/services/openalex/provider-text.js +276 -0
- package/dist/services/openalex/provider-text.js.map +1 -0
- package/dist/services/openalex/types.d.ts +16 -0
- package/dist/services/openalex/types.d.ts.map +1 -1
- package/dist/services/openalex/types.js +7 -0
- package/dist/services/openalex/types.js.map +1 -1
- package/package.json +6 -3
- package/server.json +3 -3
|
@@ -34,59 +34,77 @@ export declare const resolveNameTool: import("@cyanheads/mcp-ts-core").ToolDefin
|
|
|
34
34
|
readonly when: "OpenAlex throttled the autocomplete request for exceeding its per-second ceiling (HTTP 429).";
|
|
35
35
|
readonly retryable: true;
|
|
36
36
|
readonly recovery: "Wait several seconds and retry; consider lowering request frequency for this caller.";
|
|
37
|
+
readonly thrownBy: "service";
|
|
37
38
|
}, {
|
|
38
39
|
readonly reason: "upstream_budget_exhausted";
|
|
39
40
|
readonly code: JsonRpcErrorCode.RateLimited;
|
|
40
41
|
readonly when: "The OpenAlex daily usage budget is spent (HTTP 429).";
|
|
41
42
|
readonly retryable: false;
|
|
42
43
|
readonly recovery: "The daily budget refills at midnight UTC — retrying sooner will not succeed. Set OPENALEX_API_KEY to a free key (https://openalex.org/settings/api) for a larger daily budget than anonymous access, or wait for the reset.";
|
|
44
|
+
readonly thrownBy: "service";
|
|
43
45
|
}, {
|
|
44
46
|
readonly reason: "upstream_timeout";
|
|
45
47
|
readonly code: JsonRpcErrorCode.Timeout;
|
|
46
48
|
readonly when: "OpenAlex did not respond within the request deadline.";
|
|
47
49
|
readonly retryable: true;
|
|
48
50
|
readonly recovery: "Retry after a short delay; if timeouts persist, narrow the request with tighter filters to reduce upstream load.";
|
|
51
|
+
readonly thrownBy: "service";
|
|
49
52
|
}, {
|
|
50
53
|
readonly reason: "upstream_unavailable";
|
|
51
54
|
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
52
55
|
readonly when: "OpenAlex was unreachable or unusable — HTTP 503, a connection failure, or a body that was empty, HTML, or unparseable JSON.";
|
|
53
56
|
readonly retryable: true;
|
|
54
57
|
readonly recovery: "Wait and retry; check https://openalex.org for service status if the outage persists.";
|
|
58
|
+
readonly thrownBy: "service";
|
|
55
59
|
}, {
|
|
56
60
|
readonly reason: "upstream_unauthorized";
|
|
57
61
|
readonly code: JsonRpcErrorCode.Unauthorized;
|
|
58
62
|
readonly when: "OpenAlex rejected the API key (HTTP 401).";
|
|
59
63
|
readonly recovery: "Check that OPENALEX_API_KEY is set to a valid OpenAlex account API key (free from https://openalex.org/settings/api).";
|
|
64
|
+
readonly thrownBy: "service";
|
|
60
65
|
}, {
|
|
61
66
|
readonly reason: "upstream_forbidden";
|
|
62
67
|
readonly code: JsonRpcErrorCode.Forbidden;
|
|
63
68
|
readonly when: "OpenAlex denied access to autocomplete (HTTP 403).";
|
|
64
69
|
readonly recovery: "Confirm the API key has access to autocomplete, then retry the request.";
|
|
70
|
+
readonly thrownBy: "service";
|
|
65
71
|
}, {
|
|
66
72
|
readonly reason: "comma_in_filter_value";
|
|
67
73
|
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
68
74
|
readonly when: "A `filters` value contains a comma, which collides with the OpenAlex filter separator.";
|
|
69
75
|
readonly recovery: "Use `|` for OR within a filter value (e.g. \"2020|2021\"), or move a free-text phrase containing commas into the `query` parameter.";
|
|
76
|
+
readonly thrownBy: "service";
|
|
70
77
|
}, {
|
|
71
78
|
readonly reason: "upstream_invalid_params";
|
|
72
79
|
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
73
80
|
readonly when: "OpenAlex rejected an invalid filter field name on the autocomplete query (HTTP 400).";
|
|
74
81
|
readonly recovery: "The upstream message names the rejected field and suggests close matches. Use openalex_describe_fields(entity_type, \"filter\") to browse valid filter fields, or drop `filters` entirely.";
|
|
82
|
+
readonly thrownBy: "service";
|
|
75
83
|
}, {
|
|
76
84
|
readonly reason: "upstream_invalid_id_value";
|
|
77
85
|
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
78
86
|
readonly when: "A `filters` entry expecting an entity ID received a value that is not an OpenAlex ID — usually a name (HTTP 400).";
|
|
79
87
|
readonly recovery: "Resolve that name to an OpenAlex ID first — run this tool without the ID-valued filter, take the `id` from a match, then re-run with the ID.";
|
|
88
|
+
readonly thrownBy: "service";
|
|
89
|
+
}, {
|
|
90
|
+
readonly reason: "query_too_long";
|
|
91
|
+
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
92
|
+
readonly when: "OpenAlex autocomplete failed (HTTP 500) on a `query` longer than the 1,000 characters it accepts when entity_type is set.";
|
|
93
|
+
readonly retryable: false;
|
|
94
|
+
readonly recovery: "Shorten `query` to 1,000 characters or fewer — pass the name itself, not a citation or abstract — and call again with the shorter text.";
|
|
95
|
+
readonly thrownBy: "service";
|
|
80
96
|
}, {
|
|
81
97
|
readonly reason: "upstream_invalid_params_other";
|
|
82
98
|
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
83
99
|
readonly when: "OpenAlex rejected the autocomplete request (HTTP 400) for a reason other than an invalid field name.";
|
|
84
100
|
readonly recovery: "Read the upstream message in the error above and adjust the request — trim the query, check filter value formats, and ensure entity_type is a supported value.";
|
|
101
|
+
readonly thrownBy: "service";
|
|
85
102
|
}, {
|
|
86
103
|
readonly reason: "upstream_validation_failed";
|
|
87
104
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
88
105
|
readonly when: "OpenAlex rejected the autocomplete request as semantically invalid (HTTP 422).";
|
|
89
106
|
readonly recovery: "Read the upstream message for the specific field, then adjust the request to satisfy validation.";
|
|
107
|
+
readonly thrownBy: "service";
|
|
90
108
|
}], {
|
|
91
109
|
readonly notice: z.ZodOptional<z.ZodString>;
|
|
92
110
|
readonly budget: z.ZodOptional<z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-name.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/resolve-name.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"resolve-name.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/resolve-name.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAUjE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiS1B,CAAC"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
7
7
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
8
|
+
import { escapeMarkdown } from '../escape-markdown.js';
|
|
8
9
|
import { renderBudgetTrailer } from '../render-budget.js';
|
|
9
10
|
import { getOpenAlexService, inferIdentifier, PMCID_NOT_INDEXED_HINT, } from '../../../services/openalex/openalex-service.js';
|
|
10
11
|
import { ENTITY_TYPES } from '../../../services/openalex/types.js';
|
|
@@ -19,6 +20,7 @@ export const resolveNameTool = tool('openalex_resolve_name', {
|
|
|
19
20
|
when: 'OpenAlex throttled the autocomplete request for exceeding its per-second ceiling (HTTP 429).',
|
|
20
21
|
retryable: true,
|
|
21
22
|
recovery: 'Wait several seconds and retry; consider lowering request frequency for this caller.',
|
|
23
|
+
thrownBy: 'service',
|
|
22
24
|
},
|
|
23
25
|
{
|
|
24
26
|
reason: 'upstream_budget_exhausted',
|
|
@@ -26,6 +28,7 @@ export const resolveNameTool = tool('openalex_resolve_name', {
|
|
|
26
28
|
when: 'The OpenAlex daily usage budget is spent (HTTP 429).',
|
|
27
29
|
retryable: false,
|
|
28
30
|
recovery: 'The daily budget refills at midnight UTC — retrying sooner will not succeed. Set OPENALEX_API_KEY to a free key (https://openalex.org/settings/api) for a larger daily budget than anonymous access, or wait for the reset.',
|
|
31
|
+
thrownBy: 'service',
|
|
29
32
|
},
|
|
30
33
|
{
|
|
31
34
|
reason: 'upstream_timeout',
|
|
@@ -33,6 +36,7 @@ export const resolveNameTool = tool('openalex_resolve_name', {
|
|
|
33
36
|
when: 'OpenAlex did not respond within the request deadline.',
|
|
34
37
|
retryable: true,
|
|
35
38
|
recovery: 'Retry after a short delay; if timeouts persist, narrow the request with tighter filters to reduce upstream load.',
|
|
39
|
+
thrownBy: 'service',
|
|
36
40
|
},
|
|
37
41
|
{
|
|
38
42
|
reason: 'upstream_unavailable',
|
|
@@ -40,48 +44,64 @@ export const resolveNameTool = tool('openalex_resolve_name', {
|
|
|
40
44
|
when: 'OpenAlex was unreachable or unusable — HTTP 503, a connection failure, or a body that was empty, HTML, or unparseable JSON.',
|
|
41
45
|
retryable: true,
|
|
42
46
|
recovery: 'Wait and retry; check https://openalex.org for service status if the outage persists.',
|
|
47
|
+
thrownBy: 'service',
|
|
43
48
|
},
|
|
44
49
|
{
|
|
45
50
|
reason: 'upstream_unauthorized',
|
|
46
51
|
code: JsonRpcErrorCode.Unauthorized,
|
|
47
52
|
when: 'OpenAlex rejected the API key (HTTP 401).',
|
|
48
53
|
recovery: 'Check that OPENALEX_API_KEY is set to a valid OpenAlex account API key (free from https://openalex.org/settings/api).',
|
|
54
|
+
thrownBy: 'service',
|
|
49
55
|
},
|
|
50
56
|
{
|
|
51
57
|
reason: 'upstream_forbidden',
|
|
52
58
|
code: JsonRpcErrorCode.Forbidden,
|
|
53
59
|
when: 'OpenAlex denied access to autocomplete (HTTP 403).',
|
|
54
60
|
recovery: 'Confirm the API key has access to autocomplete, then retry the request.',
|
|
61
|
+
thrownBy: 'service',
|
|
55
62
|
},
|
|
56
63
|
{
|
|
57
64
|
reason: 'comma_in_filter_value',
|
|
58
65
|
code: JsonRpcErrorCode.InvalidParams,
|
|
59
66
|
when: 'A `filters` value contains a comma, which collides with the OpenAlex filter separator.',
|
|
60
67
|
recovery: 'Use `|` for OR within a filter value (e.g. "2020|2021"), or move a free-text phrase containing commas into the `query` parameter.',
|
|
68
|
+
thrownBy: 'service',
|
|
61
69
|
},
|
|
62
70
|
{
|
|
63
71
|
reason: 'upstream_invalid_params',
|
|
64
72
|
code: JsonRpcErrorCode.InvalidParams,
|
|
65
73
|
when: 'OpenAlex rejected an invalid filter field name on the autocomplete query (HTTP 400).',
|
|
66
74
|
recovery: 'The upstream message names the rejected field and suggests close matches. Use openalex_describe_fields(entity_type, "filter") to browse valid filter fields, or drop `filters` entirely.',
|
|
75
|
+
thrownBy: 'service',
|
|
67
76
|
},
|
|
68
77
|
{
|
|
69
78
|
reason: 'upstream_invalid_id_value',
|
|
70
79
|
code: JsonRpcErrorCode.InvalidParams,
|
|
71
80
|
when: 'A `filters` entry expecting an entity ID received a value that is not an OpenAlex ID — usually a name (HTTP 400).',
|
|
72
81
|
recovery: 'Resolve that name to an OpenAlex ID first — run this tool without the ID-valued filter, take the `id` from a match, then re-run with the ID.',
|
|
82
|
+
thrownBy: 'service',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
reason: 'query_too_long',
|
|
86
|
+
code: JsonRpcErrorCode.InvalidParams,
|
|
87
|
+
when: 'OpenAlex autocomplete failed (HTTP 500) on a `query` longer than the 1,000 characters it accepts when entity_type is set.',
|
|
88
|
+
retryable: false,
|
|
89
|
+
recovery: 'Shorten `query` to 1,000 characters or fewer — pass the name itself, not a citation or abstract — and call again with the shorter text.',
|
|
90
|
+
thrownBy: 'service',
|
|
73
91
|
},
|
|
74
92
|
{
|
|
75
93
|
reason: 'upstream_invalid_params_other',
|
|
76
94
|
code: JsonRpcErrorCode.InvalidParams,
|
|
77
95
|
when: 'OpenAlex rejected the autocomplete request (HTTP 400) for a reason other than an invalid field name.',
|
|
78
96
|
recovery: 'Read the upstream message in the error above and adjust the request — trim the query, check filter value formats, and ensure entity_type is a supported value.',
|
|
97
|
+
thrownBy: 'service',
|
|
79
98
|
},
|
|
80
99
|
{
|
|
81
100
|
reason: 'upstream_validation_failed',
|
|
82
101
|
code: JsonRpcErrorCode.ValidationError,
|
|
83
102
|
when: 'OpenAlex rejected the autocomplete request as semantically invalid (HTTP 422).',
|
|
84
103
|
recovery: 'Read the upstream message for the specific field, then adjust the request to satisfy validation.',
|
|
104
|
+
thrownBy: 'service',
|
|
85
105
|
},
|
|
86
106
|
],
|
|
87
107
|
inputAliases: { name: 'query', filter: 'filters' },
|
|
@@ -93,7 +113,7 @@ export const resolveNameTool = tool('openalex_resolve_name', {
|
|
|
93
113
|
query: z
|
|
94
114
|
.string()
|
|
95
115
|
.min(1)
|
|
96
|
-
.describe('Name or partial name to resolve. Also accepts an identifier, bare or in URL form — OpenAlex ID ("W2741809807", "F4320332161"), DOI ("10.1038/nature12373"), ORCID ("0000-0002-1825-0097"), ROR ("https://ror.org/00hx57361"), PMID ("12345678" or "https://pubmed.ncbi.nlm.nih.gov/12345678"), ISSN ("1234-5678") — which resolves straight to that one record instead of running a name search. A PMCID ("PMC1234567" or a PubMed Central URL) is recognized but OpenAlex indexes no PMCIDs, so it resolves nothing — pass the work\'s PMID or DOI instead.'),
|
|
116
|
+
.describe('Name or partial name to resolve. Also accepts an identifier, bare or in URL form — OpenAlex ID ("W2741809807", "F4320332161"), DOI ("10.1038/nature12373"), ORCID ("0000-0002-1825-0097"), ROR ("https://ror.org/00hx57361"), PMID ("12345678" or "https://pubmed.ncbi.nlm.nih.gov/12345678"), ISSN ("1234-5678") — which resolves straight to that one record instead of running a name search. A keyword URL ("https://openalex.org/keywords/groundwater") resolves the same way; a bare keyword slug reads as a name and runs a name search, which finds it too. A PMCID ("PMC1234567" or a PubMed Central URL) is recognized but OpenAlex indexes no PMCIDs, so it resolves nothing — pass the work\'s PMID or DOI instead.'),
|
|
97
117
|
filters: z
|
|
98
118
|
.record(z.string(), z.string())
|
|
99
119
|
.optional()
|
|
@@ -111,7 +131,7 @@ export const resolveNameTool = tool('openalex_resolve_name', {
|
|
|
111
131
|
display_name: z
|
|
112
132
|
.string()
|
|
113
133
|
.nullable()
|
|
114
|
-
.describe('Human-readable name. null only for an identifier lookup that landed on a record OpenAlex holds no title for (paratext works and other untitled entries) — use `id` to identify it.'),
|
|
134
|
+
.describe('Human-readable name as plain text, with HTML entities decoded and markup removed. null only for an identifier lookup that landed on a record OpenAlex holds no title for (paratext works and other untitled entries) — use `id` to identify it.'),
|
|
115
135
|
entity_type: z
|
|
116
136
|
.string()
|
|
117
137
|
.describe('Entity type — one of: work, author, source, institution, topic, keyword, publisher, funder.'),
|
|
@@ -125,7 +145,7 @@ export const resolveNameTool = tool('openalex_resolve_name', {
|
|
|
125
145
|
hint: z
|
|
126
146
|
.string()
|
|
127
147
|
.nullable()
|
|
128
|
-
.describe('Disambiguation context — last institution (authors), host organization (sources), place or country (institutions); author names (works) from a name search, publication year from an identifier lookup. null when the record carries none.'),
|
|
148
|
+
.describe('Disambiguation context as plain text — last institution (authors), host organization (sources), place or country (institutions); author names (works) from a name search, publication year from an identifier lookup. null when the record carries none.'),
|
|
129
149
|
})
|
|
130
150
|
.describe('A single autocomplete match with its ID, name, entity type, activity stats, and a disambiguation hint.'))
|
|
131
151
|
.describe('Autocomplete matches, up to 10.'),
|
|
@@ -213,14 +233,16 @@ export const resolveNameTool = tool('openalex_resolve_name', {
|
|
|
213
233
|
}
|
|
214
234
|
const lines = [];
|
|
215
235
|
for (const r of result.results) {
|
|
216
|
-
|
|
217
|
-
const
|
|
236
|
+
// Trimmed inside the bold wrapper: `**` next to a space no longer opens or closes it.
|
|
237
|
+
const name = r.display_name === null ? '(untitled)' : escapeMarkdown(r.display_name.trim());
|
|
238
|
+
lines.push(`**${name}** (${escapeMarkdown(r.entity_type)})`);
|
|
239
|
+
const details = [escapeMarkdown(r.id, 'line-start')];
|
|
218
240
|
if (r.external_id)
|
|
219
|
-
details.push(r.external_id);
|
|
241
|
+
details.push(escapeMarkdown(r.external_id));
|
|
220
242
|
details.push(`${r.cited_by_count} citations`);
|
|
221
243
|
details.push(r.works_count === null ? 'n/a works' : `${r.works_count} works`);
|
|
222
244
|
if (r.hint)
|
|
223
|
-
details.push(r.hint);
|
|
245
|
+
details.push(escapeMarkdown(r.hint));
|
|
224
246
|
lines.push(details.join(' | '));
|
|
225
247
|
lines.push('');
|
|
226
248
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-name.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/resolve-name.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,sBAAsB,GACvB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,uBAAuB,EAAE;IAC3D,WAAW,EACT,wgBAAwgB;IAC1gB,SAAS,EACP,kHAAkH;IACpH,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;IAC9E,MAAM,EAAE;QACN;YACE,MAAM,EAAE,cAAc;YACtB,IAAI,EAAE,gBAAgB,CAAC,WAAW;YAClC,IAAI,EAAE,8FAA8F;YACpG,SAAS,EAAE,IAAI;YACf,QAAQ,EACN,sFAAsF;
|
|
1
|
+
{"version":3,"file":"resolve-name.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/resolve-name.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,sBAAsB,GACvB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,uBAAuB,EAAE;IAC3D,WAAW,EACT,wgBAAwgB;IAC1gB,SAAS,EACP,kHAAkH;IACpH,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;IAC9E,MAAM,EAAE;QACN;YACE,MAAM,EAAE,cAAc;YACtB,IAAI,EAAE,gBAAgB,CAAC,WAAW;YAClC,IAAI,EAAE,8FAA8F;YACpG,SAAS,EAAE,IAAI;YACf,QAAQ,EACN,sFAAsF;YACxF,QAAQ,EAAE,SAAS;SACpB;QACD;YACE,MAAM,EAAE,2BAA2B;YACnC,IAAI,E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K,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;QACD,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC9D,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -27,6 +27,7 @@ export declare const searchEntitiesTool: import("@cyanheads/mcp-ts-core").ToolDe
|
|
|
27
27
|
select: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
28
28
|
per_page: z.ZodDefault<z.ZodNumber>;
|
|
29
29
|
cursor: z.ZodOptional<z.ZodString>;
|
|
30
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
30
31
|
sample: z.ZodOptional<z.ZodNumber>;
|
|
31
32
|
seed: z.ZodOptional<z.ZodString>;
|
|
32
33
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -44,11 +45,41 @@ export declare const searchEntitiesTool: import("@cyanheads/mcp-ts-core").ToolDe
|
|
|
44
45
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
45
46
|
readonly when: "A search (no `id`) set per_page above the semantic-search cap of 50.";
|
|
46
47
|
readonly recovery: "Reduce per_page to 50 or less, or switch search_mode to keyword.";
|
|
48
|
+
}, {
|
|
49
|
+
readonly reason: "semantic_without_query";
|
|
50
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
51
|
+
readonly when: "A search set search_mode to \"semantic\" without supplying the `query` it embeds.";
|
|
52
|
+
readonly recovery: "Pass the text to match in `query`, or switch search_mode to keyword for a filter-only listing.";
|
|
53
|
+
}, {
|
|
54
|
+
readonly reason: "semantic_with_cursor";
|
|
55
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
56
|
+
readonly when: "A search set search_mode to \"semantic\" and supplied `cursor`, which OpenAlex rejects on a semantic query.";
|
|
57
|
+
readonly recovery: "Drop `cursor` and walk semantic results with `page` (1-based), or switch search_mode to keyword or exact, which paginate by cursor.";
|
|
58
|
+
}, {
|
|
59
|
+
readonly reason: "page_without_semantic";
|
|
60
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
61
|
+
readonly when: "A search supplied `page` under a search_mode other than \"semantic\".";
|
|
62
|
+
readonly recovery: "Drop `page` and paginate with `cursor`, or set search_mode to \"semantic\" — the only mode `page` applies to.";
|
|
47
63
|
}, {
|
|
48
64
|
readonly reason: "sample_with_cursor";
|
|
49
65
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
50
66
|
readonly when: "A search (no `id`) provided both `sample` and `cursor`.";
|
|
51
67
|
readonly recovery: "Sampling returns a single page only; remove `cursor` or remove `sample`.";
|
|
68
|
+
}, {
|
|
69
|
+
readonly reason: "sample_with_page";
|
|
70
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
71
|
+
readonly when: "A search (no `id`) provided both `sample` and `page`.";
|
|
72
|
+
readonly recovery: "Sampling returns a single page only; remove `page` or remove `sample`.";
|
|
73
|
+
}, {
|
|
74
|
+
readonly reason: "sample_with_semantic";
|
|
75
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
76
|
+
readonly when: "A search (no `id`) provided `sample` with search_mode \"semantic\", which OpenAlex does not sample — it returns the same ranked candidates under every seed.";
|
|
77
|
+
readonly recovery: "Switch search_mode to keyword or exact to draw a random sample, or remove `sample` and walk the semantic candidates with `page`.";
|
|
78
|
+
}, {
|
|
79
|
+
readonly reason: "sample_with_sort";
|
|
80
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
81
|
+
readonly when: "A search (no `id`) provided both `sample` and `sort`, which OpenAlex refuses together.";
|
|
82
|
+
readonly recovery: "A random sample has no order to sort by; remove `sort` or remove `sample`.";
|
|
52
83
|
}, {
|
|
53
84
|
readonly reason: "seed_without_sample";
|
|
54
85
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
@@ -59,70 +90,89 @@ export declare const searchEntitiesTool: import("@cyanheads/mcp-ts-core").ToolDe
|
|
|
59
90
|
readonly code: JsonRpcErrorCode.NotFound;
|
|
60
91
|
readonly when: "Lookup by id matched no OpenAlex entity.";
|
|
61
92
|
readonly recovery: "Verify the ID format or call openalex_resolve_name to find the correct ID.";
|
|
93
|
+
readonly thrownBy: "service";
|
|
62
94
|
}, {
|
|
63
95
|
readonly reason: "rate_limited";
|
|
64
96
|
readonly code: JsonRpcErrorCode.RateLimited;
|
|
65
97
|
readonly when: "OpenAlex throttled the request for exceeding its per-second ceiling (HTTP 429).";
|
|
66
98
|
readonly retryable: true;
|
|
67
99
|
readonly recovery: "Wait several seconds and retry; consider lowering request frequency for this caller.";
|
|
100
|
+
readonly thrownBy: "service";
|
|
68
101
|
}, {
|
|
69
102
|
readonly reason: "upstream_budget_exhausted";
|
|
70
103
|
readonly code: JsonRpcErrorCode.RateLimited;
|
|
71
104
|
readonly when: "The OpenAlex daily usage budget is spent (HTTP 429).";
|
|
72
105
|
readonly retryable: false;
|
|
73
106
|
readonly recovery: "The daily budget refills at midnight UTC — retrying sooner will not succeed. Set OPENALEX_API_KEY to a free key (https://openalex.org/settings/api) for a larger daily budget than anonymous access, or wait for the reset.";
|
|
107
|
+
readonly thrownBy: "service";
|
|
74
108
|
}, {
|
|
75
109
|
readonly reason: "upstream_timeout";
|
|
76
110
|
readonly code: JsonRpcErrorCode.Timeout;
|
|
77
111
|
readonly when: "OpenAlex did not respond within the request deadline.";
|
|
78
112
|
readonly retryable: true;
|
|
79
113
|
readonly recovery: "Retry after a short delay; if timeouts persist, narrow the request with tighter filters to reduce upstream load.";
|
|
114
|
+
readonly thrownBy: "service";
|
|
80
115
|
}, {
|
|
81
116
|
readonly reason: "upstream_unavailable";
|
|
82
117
|
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
83
118
|
readonly when: "OpenAlex was unreachable or unusable — HTTP 503, a connection failure, or a body that was empty, HTML, or unparseable JSON.";
|
|
84
119
|
readonly retryable: true;
|
|
85
120
|
readonly recovery: "Wait and retry; check https://openalex.org for service status if the outage persists.";
|
|
121
|
+
readonly thrownBy: "service";
|
|
86
122
|
}, {
|
|
87
123
|
readonly reason: "upstream_unauthorized";
|
|
88
124
|
readonly code: JsonRpcErrorCode.Unauthorized;
|
|
89
125
|
readonly when: "OpenAlex rejected the API key (HTTP 401).";
|
|
90
126
|
readonly recovery: "Check that OPENALEX_API_KEY is set to a valid OpenAlex account API key (free from https://openalex.org/settings/api).";
|
|
127
|
+
readonly thrownBy: "service";
|
|
91
128
|
}, {
|
|
92
129
|
readonly reason: "upstream_forbidden";
|
|
93
130
|
readonly code: JsonRpcErrorCode.Forbidden;
|
|
94
131
|
readonly when: "OpenAlex denied access to the requested resource (HTTP 403).";
|
|
95
132
|
readonly recovery: "Confirm the API key has access to this entity type or endpoint, then retry the request.";
|
|
133
|
+
readonly thrownBy: "service";
|
|
96
134
|
}, {
|
|
97
135
|
readonly reason: "comma_in_filter_value";
|
|
98
136
|
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
99
137
|
readonly when: "A filter value contains a comma, which collides with the OpenAlex filter separator.";
|
|
100
138
|
readonly recovery: "Use `|` for OR within a filter value (e.g. \"2020|2021\"), or use a `.search` filter or the `query` parameter for free-text phrases that contain commas.";
|
|
139
|
+
readonly thrownBy: "service";
|
|
101
140
|
}, {
|
|
102
141
|
readonly reason: "upstream_invalid_params";
|
|
103
142
|
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
104
143
|
readonly when: "OpenAlex rejected an invalid filter, select, or sort field name (HTTP 400).";
|
|
105
144
|
readonly recovery: "The upstream message names the rejected field and suggests close matches. Use openalex_describe_fields(entity_type, context) to browse all valid fields for the given entity type and context.";
|
|
145
|
+
readonly thrownBy: "service";
|
|
106
146
|
}, {
|
|
107
147
|
readonly reason: "upstream_invalid_id_value";
|
|
108
148
|
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
109
149
|
readonly when: "An entity-ID filter received a value that is not an OpenAlex ID — usually a name (HTTP 400).";
|
|
110
150
|
readonly recovery: "Call openalex_resolve_name to turn the name into an OpenAlex ID, then filter by that ID. Entity filters such as authorships.author.id, primary_topic.id, and cites accept IDs only.";
|
|
151
|
+
readonly thrownBy: "service";
|
|
111
152
|
}, {
|
|
112
153
|
readonly reason: "upstream_sort_requires_search";
|
|
113
154
|
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
114
155
|
readonly when: "sort=-relevance_score was used without an active search (HTTP 400).";
|
|
115
156
|
readonly recovery: "Sorting by relevance_score requires an active search — add a `query` or a `*.search` filter (e.g. title.search), or choose a concrete sort field such as -cited_by_count or -publication_date.";
|
|
157
|
+
readonly thrownBy: "service";
|
|
158
|
+
}, {
|
|
159
|
+
readonly reason: "query_too_long";
|
|
160
|
+
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
161
|
+
readonly when: "OpenAlex rejected `query` as longer than the search length it accepts (HTTP 400).";
|
|
162
|
+
readonly recovery: "Shorten `query` to the character limit the upstream message names, or split the text into several shorter searches and merge their results.";
|
|
163
|
+
readonly thrownBy: "service";
|
|
116
164
|
}, {
|
|
117
165
|
readonly reason: "upstream_invalid_params_other";
|
|
118
166
|
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
119
167
|
readonly when: "OpenAlex rejected the request (HTTP 400) for a reason other than an invalid field name.";
|
|
120
168
|
readonly recovery: "Read the upstream message in the error above and adjust the request — check filter operators, value formats, and cursor/per_page bounds.";
|
|
169
|
+
readonly thrownBy: "service";
|
|
121
170
|
}, {
|
|
122
171
|
readonly reason: "upstream_validation_failed";
|
|
123
172
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
124
173
|
readonly when: "OpenAlex rejected the request as semantically invalid (HTTP 422).";
|
|
125
174
|
readonly recovery: "Read the upstream message for the specific field, then adjust the request to satisfy validation.";
|
|
175
|
+
readonly thrownBy: "service";
|
|
126
176
|
}], {
|
|
127
177
|
readonly echo: z.ZodString;
|
|
128
178
|
readonly totalCount: z.ZodNumber;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-entities.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/search-entities.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"search-entities.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/search-entities.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AA0EjE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyiB7B,CAAC"}
|