@cyanheads/openalex-mcp-server 0.7.16 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +32 -30
- package/CLAUDE.md +32 -30
- package/Dockerfile +88 -32
- package/README.md +6 -2
- package/changelog/0.8.x/0.8.0.md +38 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/prompts/definitions/literature-review.prompt.js +1 -1
- package/dist/mcp-server/tools/definitions/analyze-trends.tool.d.ts +1 -1
- package/dist/mcp-server/tools/definitions/analyze-trends.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/analyze-trends.tool.js +23 -6
- package/dist/mcp-server/tools/definitions/analyze-trends.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/citation-graph.tool.d.ts +21 -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 +42 -42
- package/dist/mcp-server/tools/definitions/citation-graph.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/resolve-name.tool.d.ts +1 -1
- package/dist/mcp-server/tools/definitions/resolve-name.tool.js +1 -1
- package/dist/mcp-server/tools/definitions/resolve-name.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-entities.tool.d.ts +35 -1
- package/dist/mcp-server/tools/definitions/search-entities.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-entities.tool.js +110 -62
- package/dist/mcp-server/tools/definitions/search-entities.tool.js.map +1 -1
- package/dist/mcp-server/tools/render-entity-record.d.ts +12 -1
- package/dist/mcp-server/tools/render-entity-record.d.ts.map +1 -1
- package/dist/mcp-server/tools/render-entity-record.js +23 -8
- package/dist/mcp-server/tools/render-entity-record.js.map +1 -1
- package/dist/mcp-server/tools/response-budget.d.ts +159 -0
- package/dist/mcp-server/tools/response-budget.d.ts.map +1 -0
- package/dist/mcp-server/tools/response-budget.js +480 -0
- package/dist/mcp-server/tools/response-budget.js.map +1 -0
- package/dist/services/openalex/openalex-service.d.ts +13 -0
- package/dist/services/openalex/openalex-service.d.ts.map +1 -1
- package/dist/services/openalex/openalex-service.js +46 -34
- package/dist/services/openalex/openalex-service.js.map +1 -1
- package/dist/services/openalex/provider-text.d.ts +12 -5
- package/dist/services/openalex/provider-text.d.ts.map +1 -1
- package/dist/services/openalex/provider-text.js +357 -33
- package/dist/services/openalex/provider-text.js.map +1 -1
- package/dist/services/openalex/types.d.ts +1 -1
- package/dist/services/openalex/types.js +1 -1
- package/package.json +8 -7
- package/server.json +3 -3
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Search and citation-graph responses hold to a 64,000-byte budget, with continuations for cut records and a new slice input for windowed arrays, alongside provider-text and identifier fixes."
|
|
3
|
+
breaking: false
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.8.0 — 2026-09-30
|
|
8
|
+
|
|
9
|
+
## Added
|
|
10
|
+
|
|
11
|
+
- **`slice: {field, offset}`** on `openalex_search_entities` `id` lookups — pages one top-level array of the record from `offset`, as many elements as fit the budget (at least one), with the window and its `next` call in `windows`; it replaces `select`. `slice_without_id` and `slice_field_not_array` reject a `slice` with no `id`, or one naming `*` or a field that is not an array. ([#72](https://github.com/cyanheads/openalex-mcp-server/issues/72))
|
|
12
|
+
|
|
13
|
+
## Changed
|
|
14
|
+
|
|
15
|
+
- **Response budget on `openalex_search_entities` and `openalex_get_citation_graph`** — `structuredContent` and `content[]` each hold to 64,000 bytes. An oversized page returns fewer records and names the rest in a new `omitted` field, whose `next` is the `openalex_search_entities` call that returns them (an `openalex` ID filter, `id` for keywords); `next_cursor` is unchanged. ([#72](https://github.com/cyanheads/openalex-mcp-server/issues/72))
|
|
16
|
+
- **Array windows** — a record too large on its own keeps its non-array fields and returns its largest arrays in part, each listed in a new `windows` field with an `id` + `slice` `next` call; `over_budget: true` marks a response whose smallest form still exceeds the budget. ([#72](https://github.com/cyanheads/openalex-mcp-server/issues/72))
|
|
17
|
+
- **`openalex_literature_review`** step 3 names the `slice` call that pages a windowed `authorships` array. ([#72](https://github.com/cyanheads/openalex-mcp-server/issues/72))
|
|
18
|
+
- **Error envelopes** carry `data.requestId`, and a tool error's `content[]` closes with the request ID (mcp-ts-core 0.13.10).
|
|
19
|
+
- **Docker image** — production dependencies and the OTel peers install in a `$BUILDPLATFORM` `deps` stage that cross-targets the image platform; the image gains a `HEALTHCHECK` on `/healthz` and an `org.opencontainers.image.version` label, and no longer sets `MCP_FORCE_CONSOLE_LOGGING`.
|
|
20
|
+
- **Packaging** — the npm package no longer ships `dist/*.mcpb`, the Docker build context excludes the MCP Registry token files and `.env.bak-*` backups, and the `.mcpb` bundle excludes `docs/idea.md` and `logs/`.
|
|
21
|
+
|
|
22
|
+
## Fixed
|
|
23
|
+
|
|
24
|
+
- **Provider-text delimiters** — CDATA sections, including unterminated ones and ones closed by a bare `]]`, and IOP's `<?CDATA …?>` are unwrapped with their TeX kept, the `<?MML …?>` restating them is removed, an unclosed `<!--inline-formula>` opener is removed as a tag, and a literal `\n` becomes a space; TeX such as `\nu` is kept. ([#89](https://github.com/cyanheads/openalex-mcp-server/issues/89))
|
|
25
|
+
- **Identifier and URL fields** (such as `id`, `doi`, `ids`, `orcid`, `ror`, `issn_l`, and every `*_url`) are returned exactly as OpenAlex stores them rather than entity-decoded, so a returned DOI resolves when passed back. ([#94](https://github.com/cyanheads/openalex-mcp-server/issues/94))
|
|
26
|
+
- **Possibly capped authorships** — a search or citation-graph work carrying exactly 100 `authorships`, the most OpenAlex returns on a list record, gets a `windows` entry with `possibly_capped: true` whose `next` is the `id` + `slice` call for the rest. ([#73](https://github.com/cyanheads/openalex-mcp-server/issues/73))
|
|
27
|
+
- **`openalex_analyze_trends` on `authorships.countries`** — a works group_by on it notes that OpenAlex counts only each work's first 100 authorships and names `authorships.institutions.country_code`, which counts every one. ([#91](https://github.com/cyanheads/openalex-mcp-server/issues/91))
|
|
28
|
+
- **`upstream_budget_exhausted` recovery** on all four tools says only that the server's daily budget refills at midnight UTC; the `OPENALEX_API_KEY` advice is added only when the server sends no key. ([#90](https://github.com/cyanheads/openalex-mcp-server/issues/90))
|
|
29
|
+
- **`Object.prototype` names** — `select` fields and works `filter` keys such as `constructor` or `__proto__` pass through unchanged instead of resolving to the inherited member, `openalex_resolve_name` sends a `constructor:`-prefixed query to autocomplete, and a record key named `__proto__` survives normalization. ([#93](https://github.com/cyanheads/openalex-mcp-server/issues/93))
|
|
30
|
+
|
|
31
|
+
## Dependencies
|
|
32
|
+
|
|
33
|
+
- `@cyanheads/mcp-ts-core` ^0.13.6 → ^0.13.10 (framework skills and scripts resynced)
|
|
34
|
+
- `@socketsecurity/bun-security-scanner` ^1.1.2 → ^1.1.3 (dev)
|
|
35
|
+
- `@types/node` ^26.6.2 → ^26.6.3 (dev)
|
|
36
|
+
- `ignore` ^7.0.9 → ^7.0.10 (dev)
|
|
37
|
+
- `vitest` ^5.0.1 → ^5.0.2 (dev)
|
|
38
|
+
- `packageManager` and Docker base images bun 1.4.0 → 1.4.2
|
package/dist/index.js
CHANGED
|
@@ -25,7 +25,7 @@ await createApp({
|
|
|
25
25
|
describeFieldsTool,
|
|
26
26
|
],
|
|
27
27
|
prompts: [literatureReviewPrompt, researchLandscapePrompt],
|
|
28
|
-
instructions:
|
|
28
|
+
instructions: "Use the openalex_* tools to query the OpenAlex scholarly catalog (works, authors, sources, institutions, topics, keywords, publishers, funders): resolve names to IDs, search/filter/sort or fetch by ID, and group_by for trends. Names are ambiguous and IDs are not — call openalex_resolve_name before filtering by entity. Record responses hold to 64,000 bytes per surface: a cut page names its `omitted` IDs and the call that returns them (in OpenAlex's order), and an array too long to fit comes back as a window that an `id` lookup pages with `slice`.",
|
|
29
29
|
landing: {
|
|
30
30
|
tagline: 'Search the OpenAlex catalog — 270M+ works, 90M+ authors, 100K+ sources.',
|
|
31
31
|
requireAuth: false,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,8DAA8D,CAAC;AACtG,OAAO,EAAE,uBAAuB,EAAE,MAAM,+DAA+D,CAAC;AACxG,OAAO,EAAE,iBAAiB,EAAE,MAAM,uDAAuD,CAAC;AAC1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,uDAAuD,CAAC;AAC7F,OAAO,EAAE,kBAAkB,EAAE,MAAM,wDAAwD,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAE,MAAM,qDAAqD,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wDAAwD,CAAC;AAC5F,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAE9E,MAAM,SAAS,CAAC;IACd,IAAI,EAAE,qBAAqB;IAC3B,KAAK,EAAE,qBAAqB;IAC5B,qFAAqF;IACrF,WAAW,EAAE,WAAW;IACxB,KAAK,EAAE;QACL,eAAe;QACf,kBAAkB;QAClB,iBAAiB;QACjB,oBAAoB;QACpB,kBAAkB;KACnB;IACD,OAAO,EAAE,CAAC,sBAAsB,EAAE,uBAAuB,CAAC;IAC1D,YAAY,EACV,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,8DAA8D,CAAC;AACtG,OAAO,EAAE,uBAAuB,EAAE,MAAM,+DAA+D,CAAC;AACxG,OAAO,EAAE,iBAAiB,EAAE,MAAM,uDAAuD,CAAC;AAC1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,uDAAuD,CAAC;AAC7F,OAAO,EAAE,kBAAkB,EAAE,MAAM,wDAAwD,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAE,MAAM,qDAAqD,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wDAAwD,CAAC;AAC5F,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAE9E,MAAM,SAAS,CAAC;IACd,IAAI,EAAE,qBAAqB;IAC3B,KAAK,EAAE,qBAAqB;IAC5B,qFAAqF;IACrF,WAAW,EAAE,WAAW;IACxB,KAAK,EAAE;QACL,eAAe;QACf,kBAAkB;QAClB,iBAAiB;QACjB,oBAAoB;QACpB,kBAAkB;KACnB;IACD,OAAO,EAAE,CAAC,sBAAsB,EAAE,uBAAuB,CAAC;IAC1D,YAAY,EACV,yiBAAyiB;IAC3iB,OAAO,EAAE;QACP,OAAO,EAAE,yEAAyE;QAClF,WAAW,EAAE,KAAK;QAClB,QAAQ,EAAE,kDAAkD;QAC5D,UAAU,EAAE;YACV,gBAAgB,EAAE,uBAAuB;SAC1C;QACD,KAAK,EAAE;YACL,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,sBAAsB,EAAE;YACnD,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,iCAAiC,EAAE;SAC/D;KACF;IACD,KAAK;QACH,mBAAmB,EAAE,CAAC;IACxB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -41,7 +41,7 @@ Follow this workflow using the OpenAlex tools:
|
|
|
41
41
|
- Search with multiple related topic IDs to capture adjacent areas`}
|
|
42
42
|
Use select to keep payloads manageable.
|
|
43
43
|
|
|
44
|
-
3. **Identify key papers** — Re-run the step 2 search with sort: "-cited_by_count" to surface landmark works, keeping the topical filters in place: an explicit sort replaces relevance ranking, so without them you get the most-cited works in the catalog rather than in "${args.topic}". Then call openalex_search_entities with id and a select naming the fields you need (e.g. ["abstract", "authorships", "primary_location"]) for the most important ones — an id lookup on its own returns the curated default projection.
|
|
44
|
+
3. **Identify key papers** — Re-run the step 2 search with sort: "-cited_by_count" to surface landmark works, keeping the topical filters in place: an explicit sort replaces relevance ranking, so without them you get the most-cited works in the catalog rather than in "${args.topic}". Then call openalex_search_entities with id and a select naming the fields you need (e.g. ["abstract", "authorships", "primary_location"]) for the most important ones — an id lookup on its own returns the curated default projection. A long array such as authorships on a large collaboration comes back as a window listed in the response's windows; page the rest with slice: {"field": "authorships", "offset": <the next offset it names>} on the same id.
|
|
45
45
|
|
|
46
46
|
4. **Trace citations** — For each key paper, use openalex_get_citation_graph with direction "cites" to find subsequent work that cites it, and direction "cited_by" to find foundational work it references.
|
|
47
47
|
|
|
@@ -48,7 +48,7 @@ export declare const analyzeTrendsTool: import("@cyanheads/mcp-ts-core").ToolDef
|
|
|
48
48
|
readonly code: JsonRpcErrorCode.RateLimited;
|
|
49
49
|
readonly when: "The OpenAlex daily usage budget is spent (HTTP 429).";
|
|
50
50
|
readonly retryable: false;
|
|
51
|
-
readonly recovery: "
|
|
51
|
+
readonly recovery: "This server's daily OpenAlex budget is spent and refills at midnight UTC — retrying before then will not succeed.";
|
|
52
52
|
readonly thrownBy: "service";
|
|
53
53
|
}, {
|
|
54
54
|
readonly reason: "upstream_timeout";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyze-trends.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/analyze-trends.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"analyze-trends.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/analyze-trends.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAWjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0W5B,CAAC"}
|
|
@@ -6,8 +6,11 @@ import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
|
6
6
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
import { escapeMarkdown } from '../escape-markdown.js';
|
|
8
8
|
import { renderBudgetTrailer } from '../render-budget.js';
|
|
9
|
+
import { joinNotices } from '../response-budget.js';
|
|
9
10
|
import { getOpenAlexService } from '../../../services/openalex/openalex-service.js';
|
|
10
11
|
import { ENTITY_TYPES } from '../../../services/openalex/types.js';
|
|
12
|
+
/** Disclosure for a works group_by over `authorships.countries` (see the handler). */
|
|
13
|
+
const COUNTRIES_CAP_NOTICE = 'OpenAlex builds authorships.countries groups from only the first 100 authorships of each work, so a country that appears only past position 100 on a large collaboration is not counted. Group by authorships.institutions.country_code to count every authorship.';
|
|
11
14
|
export const analyzeTrendsTool = tool('openalex_analyze_trends', {
|
|
12
15
|
description: 'Aggregate OpenAlex entities into groups and count them. Use for trend analysis (group works by publication_year), distribution analysis (group by oa_status, type, country), and comparative analysis (group by institution or topic). Combine with filters to scope the analysis. Returns up to 200 groups per page — use cursor pagination for fields with many distinct values.',
|
|
13
16
|
sourceUrl: 'https://github.com/cyanheads/openalex-mcp-server/blob/main/src/mcp-server/tools/definitions/analyze-trends.tool.ts',
|
|
@@ -26,7 +29,7 @@ export const analyzeTrendsTool = tool('openalex_analyze_trends', {
|
|
|
26
29
|
code: JsonRpcErrorCode.RateLimited,
|
|
27
30
|
when: 'The OpenAlex daily usage budget is spent (HTTP 429).',
|
|
28
31
|
retryable: false,
|
|
29
|
-
recovery: '
|
|
32
|
+
recovery: "This server's daily OpenAlex budget is spent and refills at midnight UTC — retrying before then will not succeed.",
|
|
30
33
|
thrownBy: 'service',
|
|
31
34
|
},
|
|
32
35
|
{
|
|
@@ -116,7 +119,7 @@ export const analyzeTrendsTool = tool('openalex_analyze_trends', {
|
|
|
116
119
|
group_by: z
|
|
117
120
|
.string()
|
|
118
121
|
.min(1)
|
|
119
|
-
.describe('Field to group by. Works examples: "publication_year", "type", "oa_status", "primary_topic.field.id", "authorships.institutions.country_code", "is_retracted". Authors: "last_known_institutions.country_code", "has_orcid". Sources: "type", "is_oa", "country_code". Not all fields support group_by — call openalex_describe_fields(entity_type, "group_by") for the groupable set.'),
|
|
122
|
+
.describe('Field to group by. Works examples: "publication_year", "type", "oa_status", "primary_topic.field.id", "authorships.institutions.country_code", "is_retracted". OpenAlex builds authorships.countries groups from only the first 100 authorships of each work; authorships.institutions.country_code counts every authorship. Authors: "last_known_institutions.country_code", "has_orcid". Sources: "type", "is_oa", "country_code". Not all fields support group_by — call openalex_describe_fields(entity_type, "group_by") for the groupable set.'),
|
|
120
123
|
filters: z
|
|
121
124
|
.record(z.string(), z.string())
|
|
122
125
|
.optional()
|
|
@@ -184,7 +187,7 @@ export const analyzeTrendsTool = tool('openalex_analyze_trends', {
|
|
|
184
187
|
notice: z
|
|
185
188
|
.string()
|
|
186
189
|
.optional()
|
|
187
|
-
.describe('Guidance notice. Set when a first call returns no groups (recovery suggestions), when a `cursor` continuation returns none because the traversal is already finished,
|
|
190
|
+
.describe('Guidance notice. Set when a first call returns no groups (recovery suggestions), when a `cursor` continuation returns none because the traversal is already finished, when the page is full and more groups likely exist (truncation signal with narrowing advice), or when works are grouped by authorships.countries, which OpenAlex counts from only the first 100 authorships of each work. Absent otherwise.'),
|
|
188
191
|
budget: z
|
|
189
192
|
.object({
|
|
190
193
|
costUsd: z
|
|
@@ -226,12 +229,14 @@ export const analyzeTrendsTool = tool('openalex_analyze_trends', {
|
|
|
226
229
|
});
|
|
227
230
|
const echo = buildAnalyzeEcho(input);
|
|
228
231
|
ctx.enrich({ echo, totalCount: result.meta.count });
|
|
232
|
+
// `notice` is last-wins, so every sentence is collected and set once.
|
|
233
|
+
const notices = [];
|
|
229
234
|
// An empty page on a `cursor` continuation means the key-ascending traversal already
|
|
230
235
|
// enumerated every group, so there is nothing left to remove or regroup. On a first call
|
|
231
236
|
// the same shape can still be an honest zero — including the all-values-unknown case,
|
|
232
237
|
// where `count` is nonzero but every matched entity is null for the grouped field.
|
|
233
238
|
if (result.groups.length === 0) {
|
|
234
|
-
|
|
239
|
+
notices.push(input.cursor === undefined
|
|
235
240
|
? `No groups returned for ${echo}. Try removing filters or grouping by a different field.`
|
|
236
241
|
: `Pagination exhausted for ${echo} — the previous page held the last group, so this one came back empty. Stop paging rather than removing filters or regrouping.`);
|
|
237
242
|
}
|
|
@@ -241,7 +246,7 @@ export const analyzeTrendsTool = tool('openalex_analyze_trends', {
|
|
|
241
246
|
// "top by count"). The honest signal is whether OpenAlex returned a next_cursor; page-fill
|
|
242
247
|
// is irrelevant in this mode.
|
|
243
248
|
if (result.meta.next_cursor) {
|
|
244
|
-
|
|
249
|
+
notices.push(`Showing ${result.groups.length} groups in key-ascending order. Pass the returned \`next_cursor\` to continue the traversal.`);
|
|
245
250
|
}
|
|
246
251
|
}
|
|
247
252
|
else if (result.groups.length === input.per_page) {
|
|
@@ -249,8 +254,20 @@ export const analyzeTrendsTool = tool('openalex_analyze_trends', {
|
|
|
249
254
|
// exist. The omitted groups all have counts ≤ the smallest group shown, so we can bound the
|
|
250
255
|
// gap even though OpenAlex exposes no total group count.
|
|
251
256
|
const smallestCount = result.groups[result.groups.length - 1]?.count ?? 0;
|
|
252
|
-
|
|
257
|
+
notices.push(`Showing the top ${result.groups.length} groups by count. Smallest shown has count = ${smallestCount}; any omitted group has count ≤ ${smallestCount}. Narrow with \`filters\`, raise \`per_page\` (max 200), or enumerate all with \`order: "key"\`.`);
|
|
253
258
|
}
|
|
259
|
+
// OpenAlex aggregates authorships.countries from the first-100 window its list records carry,
|
|
260
|
+
// so the counts undercount large collaborations with nothing upstream saying so; every other
|
|
261
|
+
// authorships.* group_by counts all authorships. An empty page is included: a work whose first
|
|
262
|
+
// 100 authorships carry no country contributes no group. The service also accepts OpenAlex's
|
|
263
|
+
// own `:include_unknown` suffix in group_by.
|
|
264
|
+
if (input.entity_type === 'works' &&
|
|
265
|
+
input.group_by.replace(/:include_unknown$/, '') === 'authorships.countries') {
|
|
266
|
+
notices.push(COUNTRIES_CAP_NOTICE);
|
|
267
|
+
}
|
|
268
|
+
const notice = joinNotices(notices);
|
|
269
|
+
if (notice)
|
|
270
|
+
ctx.enrich.notice(notice);
|
|
254
271
|
return {
|
|
255
272
|
meta: {
|
|
256
273
|
count: result.meta.count,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyze-trends.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/analyze-trends.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;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,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,yBAAyB,EAAE;IAC/D,WAAW,EACT,oXAAoX;IACtX,SAAS,EACP,oHAAoH;IACtH,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,iFAAiF;YACvF,SAAS,EAAE,IAAI;YACf,QAAQ,EACN,sFAAsF;YACxF,QAAQ,EAAE,SAAS;SACpB;QACD;YACE,MAAM,EAAE,2BAA2B;YACnC,IAAI,EAAE,gBAAgB,CAAC,WAAW;YAClC,IAAI,EAAE,sDAAsD;YAC5D,SAAS,EAAE,KAAK;YAChB,QAAQ,EACN,
|
|
1
|
+
{"version":3,"file":"analyze-trends.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/analyze-trends.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;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,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,sFAAsF;AACtF,MAAM,oBAAoB,GACxB,oQAAoQ,CAAC;AAEvQ,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,yBAAyB,EAAE;IAC/D,WAAW,EACT,oXAAoX;IACtX,SAAS,EACP,oHAAoH;IACtH,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,iFAAiF;YACvF,SAAS,EAAE,IAAI;YACf,QAAQ,EACN,sFAAsF;YACxF,QAAQ,EAAE,SAAS;SACpB;QACD;YACE,MAAM,EAAE,2BAA2B;YACnC,IAAI,EAAE,gBAAgB,CAAC,WAAW;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AW,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACzD,CAAC;IACD,IAAI,KAAK,CAAC,eAAe;QAAE,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;IAC9D,IAAI,KAAK,CAAC,KAAK;QAAE,KAAK,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;IACpD,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -26,6 +26,26 @@ export declare const getCitationGraphTool: import("@cyanheads/mcp-ts-core").Tool
|
|
|
26
26
|
id: z.ZodString;
|
|
27
27
|
display_name: z.ZodNullable<z.ZodString>;
|
|
28
28
|
}, z.core.$loose>>;
|
|
29
|
+
omitted: z.ZodOptional<z.ZodObject<{
|
|
30
|
+
ids: z.ZodArray<z.ZodString>;
|
|
31
|
+
next: z.ZodObject<{
|
|
32
|
+
tool: z.ZodLiteral<"openalex_search_entities">;
|
|
33
|
+
arguments: z.ZodObject<{}, z.core.$loose>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
windows: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
37
|
+
id: z.ZodString;
|
|
38
|
+
field: z.ZodString;
|
|
39
|
+
offset: z.ZodNumber;
|
|
40
|
+
shown: z.ZodNumber;
|
|
41
|
+
total: z.ZodNumber;
|
|
42
|
+
possibly_capped: z.ZodBoolean;
|
|
43
|
+
next: z.ZodNullable<z.ZodObject<{
|
|
44
|
+
tool: z.ZodLiteral<"openalex_search_entities">;
|
|
45
|
+
arguments: z.ZodObject<{}, z.core.$loose>;
|
|
46
|
+
}, z.core.$strip>>;
|
|
47
|
+
}, z.core.$strip>>>;
|
|
48
|
+
over_budget: z.ZodOptional<z.ZodBoolean>;
|
|
29
49
|
}, z.core.$strip>, readonly [{
|
|
30
50
|
readonly reason: "rate_limited";
|
|
31
51
|
readonly code: JsonRpcErrorCode.RateLimited;
|
|
@@ -38,7 +58,7 @@ export declare const getCitationGraphTool: import("@cyanheads/mcp-ts-core").Tool
|
|
|
38
58
|
readonly code: JsonRpcErrorCode.RateLimited;
|
|
39
59
|
readonly when: "The OpenAlex daily usage budget is spent (HTTP 429).";
|
|
40
60
|
readonly retryable: false;
|
|
41
|
-
readonly recovery: "
|
|
61
|
+
readonly recovery: "This server's daily OpenAlex budget is spent and refills at midnight UTC — retrying before then will not succeed.";
|
|
42
62
|
readonly thrownBy: "service";
|
|
43
63
|
}, {
|
|
44
64
|
readonly reason: "upstream_timeout";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"citation-graph.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/citation-graph.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"citation-graph.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/citation-graph.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAoCjE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqW/B,CAAC"}
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
import { renderBudgetTrailer } from '../render-budget.js';
|
|
8
|
-
import {
|
|
8
|
+
import { fitRecordsToBudget, formatRecordPage, joinNotices, measurePageFrame, omittedOutputSchema, overBudgetOutputSchema, windowsOutputSchema, } from '../response-budget.js';
|
|
9
9
|
import { getOpenAlexService, translateFilterKey } from '../../../services/openalex/openalex-service.js';
|
|
10
10
|
const OPENALEX_URL_PREFIX = 'https://openalex.org/';
|
|
11
|
+
/** What `meta.count` counts, in the rendered header. */
|
|
12
|
+
const EDGE_NOUN = 'edge(s)';
|
|
11
13
|
const DIRECTIONS = ['cites', 'cited_by', 'related_to'];
|
|
12
14
|
const RESERVED_FILTER_KEYS = new Set(DIRECTIONS);
|
|
13
15
|
function buildCitationEcho(input) {
|
|
@@ -20,7 +22,7 @@ function buildCitationEcho(input) {
|
|
|
20
22
|
return parts.join(' | ');
|
|
21
23
|
}
|
|
22
24
|
export const getCitationGraphTool = tool('openalex_get_citation_graph', {
|
|
23
|
-
description: "Walk the citation graph one hop from a seed work. Direction picks the edge: incoming citations (`cites`), the seed's own references (`cited_by`), or OpenAlex's algorithmically-related works (`related_to`). Note: `direction` follows OpenAlex's filter convention, which inverts the common English reading — `cites` returns works that cite the seed; `cited_by` returns works the seed cites. Results use the works schema; combine with filters/sort to narrow further.",
|
|
25
|
+
description: "Walk the citation graph one hop from a seed work. Direction picks the edge: incoming citations (`cites`), the seed's own references (`cited_by`), or OpenAlex's algorithmically-related works (`related_to`). Note: `direction` follows OpenAlex's filter convention, which inverts the common English reading — `cites` returns works that cite the seed; `cited_by` returns works the seed cites. Results use the works schema; combine with filters/sort to narrow further. Responses cap at 64,000 bytes per surface unless the least a call can return is larger (`over_budget`); `omitted` and `windows` give the openalex_search_entities calls that continue a cut.",
|
|
24
26
|
sourceUrl: 'https://github.com/cyanheads/openalex-mcp-server/blob/main/src/mcp-server/tools/definitions/citation-graph.tool.ts',
|
|
25
27
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
26
28
|
errors: [
|
|
@@ -37,7 +39,7 @@ export const getCitationGraphTool = tool('openalex_get_citation_graph', {
|
|
|
37
39
|
code: JsonRpcErrorCode.RateLimited,
|
|
38
40
|
when: 'The OpenAlex daily usage budget is spent (HTTP 429).',
|
|
39
41
|
retryable: false,
|
|
40
|
-
recovery: '
|
|
42
|
+
recovery: "This server's daily OpenAlex budget is spent and refills at midnight UTC — retrying before then will not succeed.",
|
|
41
43
|
thrownBy: 'service',
|
|
42
44
|
},
|
|
43
45
|
{
|
|
@@ -138,14 +140,14 @@ export const getCitationGraphTool = tool('openalex_get_citation_graph', {
|
|
|
138
140
|
select: z
|
|
139
141
|
.array(z.string())
|
|
140
142
|
.optional()
|
|
141
|
-
.describe('OpenAlex work field names to return. Always returned: id, display_name. Defaults to the curated works select if omitted.'),
|
|
143
|
+
.describe('OpenAlex work field names to return. Always returned: id, display_name. Defaults to the curated works select if omitted. Large projections may be cut to fit the response budget (`omitted`, `windows`).'),
|
|
142
144
|
per_page: z
|
|
143
145
|
.number()
|
|
144
146
|
.int()
|
|
145
147
|
.min(1)
|
|
146
148
|
.max(100)
|
|
147
149
|
.default(25)
|
|
148
|
-
.describe('Results per page (1-100). Default 25.'),
|
|
150
|
+
.describe('Results per page (1-100). Default 25. A budget-cut page returns fewer (`omitted`).'),
|
|
149
151
|
cursor: z
|
|
150
152
|
.string()
|
|
151
153
|
.min(1)
|
|
@@ -160,11 +162,11 @@ export const getCitationGraphTool = tool('openalex_get_citation_graph', {
|
|
|
160
162
|
.describe('Total edges from seed_id in this direction (across all pages).'),
|
|
161
163
|
per_page: z
|
|
162
164
|
.number()
|
|
163
|
-
.describe('Page size OpenAlex echoed for this request — the requested per_page, not the number of records returned. A short or exhausted page carries fewer records than this.'),
|
|
165
|
+
.describe('Page size OpenAlex echoed for this request — the requested per_page, not the number of records returned. A short or exhausted page carries fewer records than this, as does a page the response budget cut (`omitted`).'),
|
|
164
166
|
next_cursor: z
|
|
165
167
|
.string()
|
|
166
168
|
.nullable()
|
|
167
|
-
.describe('Cursor for next page. null if no more results.'),
|
|
169
|
+
.describe('Cursor for next page. null if no more results. Continues after the full upstream page, `omitted` works included.'),
|
|
168
170
|
})
|
|
169
171
|
.describe('Result metadata including pagination.'),
|
|
170
172
|
results: z
|
|
@@ -176,9 +178,12 @@ export const getCitationGraphTool = tool('openalex_get_citation_graph', {
|
|
|
176
178
|
.nullable()
|
|
177
179
|
.describe('Work title. null when OpenAlex holds no title for the record (paratext works and other untitled entries) — use `id` to identify it.'),
|
|
178
180
|
})
|
|
179
|
-
.
|
|
181
|
+
.loose()
|
|
180
182
|
.describe('A single OpenAlex work record on the citation graph. Additional fields vary by `select`.'))
|
|
181
|
-
.describe('Works on the citation graph in this direction. Text values are plain text — HTML entities decoded, HTML/JATS/MathML markup removed.'),
|
|
183
|
+
.describe('Works on the citation graph in this direction. Text values are plain text — HTML entities decoded, HTML/JATS/MathML markup removed — except identifier and URL fields such as `id`, `doi`, `ids`, and `*_url`, returned exactly as OpenAlex stores them. Works cut by the response budget are in `omitted`; partial or possibly capped arrays are in `windows`.'),
|
|
184
|
+
omitted: omittedOutputSchema,
|
|
185
|
+
windows: windowsOutputSchema,
|
|
186
|
+
over_budget: overBudgetOutputSchema,
|
|
182
187
|
}),
|
|
183
188
|
// Agent-facing context for the success path — the query as parsed (seed + direction),
|
|
184
189
|
// the total edge count, and recovery guidance for empty traversals. Populated via
|
|
@@ -191,7 +196,7 @@ export const getCitationGraphTool = tool('openalex_get_citation_graph', {
|
|
|
191
196
|
notice: z
|
|
192
197
|
.string()
|
|
193
198
|
.optional()
|
|
194
|
-
.describe('Guidance when no edges are returned
|
|
199
|
+
.describe('Guidance notice. Set when no edges are returned — a first call suggests verifying the seed_id, broadening filters, or trying a different direction; a `cursor` continuation says the walk is already past its last edge instead — when the response budget cut works, windowed an array, or ran over, and when a work carries exactly 100 authorships (possibly capped). Absent otherwise.'),
|
|
195
200
|
budget: z
|
|
196
201
|
.object({
|
|
197
202
|
costUsd: z
|
|
@@ -225,11 +230,7 @@ export const getCitationGraphTool = tool('openalex_get_citation_graph', {
|
|
|
225
230
|
if (reserved !== undefined) {
|
|
226
231
|
const upstreamKey = translateFilterKey('works', reserved);
|
|
227
232
|
const resolution = upstreamKey === reserved ? '' : ` — it resolves to \`${upstreamKey}\``;
|
|
228
|
-
throw ctx.fail('reserved_filter_key', `${reserved} cannot be passed in filters${resolution}, and direction reserves cites/cited_by/related_to.`, {
|
|
229
|
-
...ctx.recoveryFor('reserved_filter_key'),
|
|
230
|
-
reservedKey: reserved,
|
|
231
|
-
direction: input.direction,
|
|
232
|
-
});
|
|
233
|
+
throw ctx.fail('reserved_filter_key', `${reserved} cannot be passed in filters${resolution}, and direction reserves cites/cited_by/related_to.`, { reservedKey: reserved, direction: input.direction });
|
|
233
234
|
}
|
|
234
235
|
const service = getOpenAlexService();
|
|
235
236
|
/**
|
|
@@ -243,7 +244,7 @@ export const getCitationGraphTool = tool('openalex_get_citation_graph', {
|
|
|
243
244
|
const seedLookup = await service.search({ entityType: 'works', id: input.seed_id, select: ['id'] }, ctx);
|
|
244
245
|
const seedRecord = seedLookup.results[0];
|
|
245
246
|
if (!seedRecord?.id) {
|
|
246
|
-
throw ctx.fail('entity_not_found', `Could not resolve seed_id "${input.seed_id}" to an OpenAlex work ID.`, {
|
|
247
|
+
throw ctx.fail('entity_not_found', `Could not resolve seed_id "${input.seed_id}" to an OpenAlex work ID.`, { seedId: input.seed_id });
|
|
247
248
|
}
|
|
248
249
|
const workId = seedRecord.id.replace(OPENALEX_URL_PREFIX, '');
|
|
249
250
|
const mergedFilters = {
|
|
@@ -268,34 +269,33 @@ export const getCitationGraphTool = tool('openalex_get_citation_graph', {
|
|
|
268
269
|
ctx.enrich({ echo, totalCount: result.meta.count });
|
|
269
270
|
// An empty page on a `cursor` continuation means the walk already returned every edge it
|
|
270
271
|
// had, so the verify-the-seed advice would send the caller after a seed that is fine.
|
|
271
|
-
|
|
272
|
-
|
|
272
|
+
const emptyNotice = result.results.length > 0
|
|
273
|
+
? undefined
|
|
274
|
+
: input.cursor === undefined
|
|
273
275
|
? `No edges for ${echo}. Verify the seed_id with openalex_resolve_name, broaden filters, or try a different direction.`
|
|
274
|
-
: `Pagination exhausted for ${echo} — the previous page held the last edge, so this one came back empty. Stop paging rather than broadening filters or changing direction
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
per_page: result.meta.per_page,
|
|
280
|
-
next_cursor: result.meta.next_cursor,
|
|
281
|
-
},
|
|
282
|
-
results: result.results,
|
|
276
|
+
: `Pagination exhausted for ${echo} — the previous page held the last edge, so this one came back empty. Stop paging rather than broadening filters or changing direction.`;
|
|
277
|
+
const meta = {
|
|
278
|
+
count: result.meta.count,
|
|
279
|
+
per_page: result.meta.per_page,
|
|
280
|
+
next_cursor: result.meta.next_cursor,
|
|
283
281
|
};
|
|
282
|
+
const page = fitRecordsToBudget({
|
|
283
|
+
records: result.results,
|
|
284
|
+
entityType: 'works',
|
|
285
|
+
path: 'list',
|
|
286
|
+
select: input.select,
|
|
287
|
+
measureFrame: (disclosure, budgetNotice) => measurePageFrame({ meta, results: [], ...disclosure }, EDGE_NOUN, {
|
|
288
|
+
echo,
|
|
289
|
+
totalCount: result.meta.count,
|
|
290
|
+
totalLabel: 'Total Edges',
|
|
291
|
+
notice: joinNotices([emptyNotice, budgetNotice]),
|
|
292
|
+
}),
|
|
293
|
+
});
|
|
294
|
+
const notice = joinNotices([emptyNotice, page.notice]);
|
|
295
|
+
if (notice)
|
|
296
|
+
ctx.enrich.notice(notice);
|
|
297
|
+
return { meta, results: page.results, ...page.disclosure };
|
|
284
298
|
},
|
|
285
|
-
format: (result) =>
|
|
286
|
-
const lines = [];
|
|
287
|
-
const countLabel = `${result.meta.count} edge(s) — ${result.meta.per_page} per page`;
|
|
288
|
-
const header = result.meta.next_cursor
|
|
289
|
-
? `**${countLabel}** — next cursor: \`${result.meta.next_cursor}\``
|
|
290
|
-
: `**${countLabel}**`;
|
|
291
|
-
lines.push(header);
|
|
292
|
-
if (result.results.length === 0) {
|
|
293
|
-
return [{ type: 'text', text: lines.join('\n') }];
|
|
294
|
-
}
|
|
295
|
-
for (const record of result.results) {
|
|
296
|
-
lines.push(...renderEntityRecord(record));
|
|
297
|
-
}
|
|
298
|
-
return [{ type: 'text', text: lines.join('\n') }];
|
|
299
|
-
},
|
|
299
|
+
format: (result) => formatRecordPage(result, EDGE_NOUN),
|
|
300
300
|
});
|
|
301
301
|
//# sourceMappingURL=citation-graph.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"citation-graph.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/citation-graph.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;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,
|
|
1
|
+
{"version":3,"file":"citation-graph.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/citation-graph.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;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,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAEjG,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AACpD,wDAAwD;AACxD,MAAM,SAAS,GAAG,SAAS,CAAC;AAE5B,MAAM,UAAU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AAE,YAAY,CAAC,CAAC;aACjD,CAAC;SACL,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,WAAW,CAAC,CAAC,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QACvD,IAAI,MAAM;YAAE,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAEtC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;IAC7D,CAAC;IAED,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC;CACxD,CAAC,CAAC"}
|
|
@@ -40,7 +40,7 @@ export declare const resolveNameTool: import("@cyanheads/mcp-ts-core").ToolDefin
|
|
|
40
40
|
readonly code: JsonRpcErrorCode.RateLimited;
|
|
41
41
|
readonly when: "The OpenAlex daily usage budget is spent (HTTP 429).";
|
|
42
42
|
readonly retryable: false;
|
|
43
|
-
readonly recovery: "
|
|
43
|
+
readonly recovery: "This server's daily OpenAlex budget is spent and refills at midnight UTC — retrying before then will not succeed.";
|
|
44
44
|
readonly thrownBy: "service";
|
|
45
45
|
}, {
|
|
46
46
|
readonly reason: "upstream_timeout";
|
|
@@ -27,7 +27,7 @@ export const resolveNameTool = tool('openalex_resolve_name', {
|
|
|
27
27
|
code: JsonRpcErrorCode.RateLimited,
|
|
28
28
|
when: 'The OpenAlex daily usage budget is spent (HTTP 429).',
|
|
29
29
|
retryable: false,
|
|
30
|
-
recovery: '
|
|
30
|
+
recovery: "This server's daily OpenAlex budget is spent and refills at midnight UTC — retrying before then will not succeed.",
|
|
31
31
|
thrownBy: 'service',
|
|
32
32
|
},
|
|
33
33
|
{
|
|
@@ -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,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,EAAE,gBAAgB,CAAC,WAAW;YAClC,IAAI,EAAE,sDAAsD;YAC5D,SAAS,EAAE,KAAK;YAChB,QAAQ,EACN,
|
|
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,q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AC,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC,CAAC;YAC/D,IAAI,CAAC,CAAC,WAAW;gBAAE,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;YAC/D,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,cAAc,YAAY,CAAC,CAAC;YAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,WAAW,QAAQ,CAAC,CAAC;YAC9E,IAAI,CAAC,CAAC,IAAI;gBAAE,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;YACjD,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;YAChC,KAAK,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"}
|
|
@@ -30,6 +30,10 @@ export declare const searchEntitiesTool: import("@cyanheads/mcp-ts-core").ToolDe
|
|
|
30
30
|
page: z.ZodOptional<z.ZodNumber>;
|
|
31
31
|
sample: z.ZodOptional<z.ZodNumber>;
|
|
32
32
|
seed: z.ZodOptional<z.ZodString>;
|
|
33
|
+
slice: z.ZodOptional<z.ZodObject<{
|
|
34
|
+
field: z.ZodString;
|
|
35
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
36
|
+
}, z.core.$strip>>;
|
|
33
37
|
}, z.core.$strip>, z.ZodObject<{
|
|
34
38
|
meta: z.ZodObject<{
|
|
35
39
|
count: z.ZodNumber;
|
|
@@ -40,6 +44,26 @@ export declare const searchEntitiesTool: import("@cyanheads/mcp-ts-core").ToolDe
|
|
|
40
44
|
id: z.ZodString;
|
|
41
45
|
display_name: z.ZodNullable<z.ZodString>;
|
|
42
46
|
}, z.core.$loose>>;
|
|
47
|
+
omitted: z.ZodOptional<z.ZodObject<{
|
|
48
|
+
ids: z.ZodArray<z.ZodString>;
|
|
49
|
+
next: z.ZodObject<{
|
|
50
|
+
tool: z.ZodLiteral<"openalex_search_entities">;
|
|
51
|
+
arguments: z.ZodObject<{}, z.core.$loose>;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
}, z.core.$strip>>;
|
|
54
|
+
windows: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
55
|
+
id: z.ZodString;
|
|
56
|
+
field: z.ZodString;
|
|
57
|
+
offset: z.ZodNumber;
|
|
58
|
+
shown: z.ZodNumber;
|
|
59
|
+
total: z.ZodNumber;
|
|
60
|
+
possibly_capped: z.ZodBoolean;
|
|
61
|
+
next: z.ZodNullable<z.ZodObject<{
|
|
62
|
+
tool: z.ZodLiteral<"openalex_search_entities">;
|
|
63
|
+
arguments: z.ZodObject<{}, z.core.$loose>;
|
|
64
|
+
}, z.core.$strip>>;
|
|
65
|
+
}, z.core.$strip>>>;
|
|
66
|
+
over_budget: z.ZodOptional<z.ZodBoolean>;
|
|
43
67
|
}, z.core.$strip>, readonly [{
|
|
44
68
|
readonly reason: "semantic_per_page_cap";
|
|
45
69
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
@@ -85,6 +109,16 @@ export declare const searchEntitiesTool: import("@cyanheads/mcp-ts-core").ToolDe
|
|
|
85
109
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
86
110
|
readonly when: "A search (no `id`) provided `seed` without `sample`.";
|
|
87
111
|
readonly recovery: "Pass `sample` to enable random sampling, or remove `seed`.";
|
|
112
|
+
}, {
|
|
113
|
+
readonly reason: "slice_without_id";
|
|
114
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
115
|
+
readonly when: "A search passed `slice` without `id` — slice pages one array of one record.";
|
|
116
|
+
readonly recovery: "Pass the record's `id` alongside `slice`, or drop `slice` to run the search; a `windows` entry's `next` call carries both.";
|
|
117
|
+
}, {
|
|
118
|
+
readonly reason: "slice_field_not_array";
|
|
119
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
120
|
+
readonly when: "The `slice` field is `*`, or is not an array on the record at `id` — absent, null, a scalar, or an object.";
|
|
121
|
+
readonly recovery: "Name a top-level array field of that record, such as authorships, referenced_works, or locations; openalex_describe_fields(entity_type, \"select\") lists the field names.";
|
|
88
122
|
}, {
|
|
89
123
|
readonly reason: "entity_not_found";
|
|
90
124
|
readonly code: JsonRpcErrorCode.NotFound;
|
|
@@ -103,7 +137,7 @@ export declare const searchEntitiesTool: import("@cyanheads/mcp-ts-core").ToolDe
|
|
|
103
137
|
readonly code: JsonRpcErrorCode.RateLimited;
|
|
104
138
|
readonly when: "The OpenAlex daily usage budget is spent (HTTP 429).";
|
|
105
139
|
readonly retryable: false;
|
|
106
|
-
readonly recovery: "
|
|
140
|
+
readonly recovery: "This server's daily OpenAlex budget is spent and refills at midnight UTC — retrying before then will not succeed.";
|
|
107
141
|
readonly thrownBy: "service";
|
|
108
142
|
}, {
|
|
109
143
|
readonly reason: "upstream_timeout";
|