@cyanheads/openalex-mcp-server 0.7.3 → 0.7.5

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 (37) hide show
  1. package/AGENTS.md +2 -2
  2. package/CLAUDE.md +2 -2
  3. package/Dockerfile +1 -1
  4. package/LICENSE +1 -1
  5. package/README.md +7 -6
  6. package/dist/index.js +1 -1
  7. package/dist/index.js.map +1 -1
  8. package/dist/mcp-server/prompts/definitions/literature-review.prompt.d.ts +1 -1
  9. package/dist/mcp-server/prompts/definitions/research-landscape.prompt.js +1 -1
  10. package/dist/mcp-server/tools/definitions/analyze-trends.tool.d.ts +30 -9
  11. package/dist/mcp-server/tools/definitions/analyze-trends.tool.d.ts.map +1 -1
  12. package/dist/mcp-server/tools/definitions/analyze-trends.tool.js +30 -5
  13. package/dist/mcp-server/tools/definitions/analyze-trends.tool.js.map +1 -1
  14. package/dist/mcp-server/tools/definitions/citation-graph.tool.d.ts +27 -6
  15. package/dist/mcp-server/tools/definitions/citation-graph.tool.d.ts.map +1 -1
  16. package/dist/mcp-server/tools/definitions/citation-graph.tool.js +36 -8
  17. package/dist/mcp-server/tools/definitions/citation-graph.tool.js.map +1 -1
  18. package/dist/mcp-server/tools/definitions/describe-fields.tool.d.ts +5 -5
  19. package/dist/mcp-server/tools/definitions/describe-fields.tool.d.ts.map +1 -1
  20. package/dist/mcp-server/tools/definitions/describe-fields.tool.js +26 -3
  21. package/dist/mcp-server/tools/definitions/describe-fields.tool.js.map +1 -1
  22. package/dist/mcp-server/tools/definitions/resolve-name.tool.d.ts +30 -9
  23. package/dist/mcp-server/tools/definitions/resolve-name.tool.d.ts.map +1 -1
  24. package/dist/mcp-server/tools/definitions/resolve-name.tool.js +30 -5
  25. package/dist/mcp-server/tools/definitions/resolve-name.tool.js.map +1 -1
  26. package/dist/mcp-server/tools/definitions/search-entities.tool.d.ts +32 -11
  27. package/dist/mcp-server/tools/definitions/search-entities.tool.d.ts.map +1 -1
  28. package/dist/mcp-server/tools/definitions/search-entities.tool.js +36 -8
  29. package/dist/mcp-server/tools/definitions/search-entities.tool.js.map +1 -1
  30. package/dist/services/openalex/openalex-service.d.ts +3 -1
  31. package/dist/services/openalex/openalex-service.d.ts.map +1 -1
  32. package/dist/services/openalex/openalex-service.js +134 -12
  33. package/dist/services/openalex/openalex-service.js.map +1 -1
  34. package/dist/services/openalex/types.d.ts +7 -2
  35. package/dist/services/openalex/types.d.ts.map +1 -1
  36. package/package.json +9 -9
  37. package/server.json +3 -3
package/AGENTS.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Agent Protocol
2
2
 
3
3
  **Server:** openalex-mcp-server
4
- **Version:** 0.7.3
5
- **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.10.14`
4
+ **Version:** 0.7.5
5
+ **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.11.0`
6
6
  **Engines:** Bun ≥1.3.0, Node ≥24.0.0
7
7
 
8
8
  > **Read the framework docs first:** `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` contains the full API reference — builders, Context, error codes, exports, patterns. This file covers server-specific conventions only.
package/CLAUDE.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Agent Protocol
2
2
 
3
3
  **Server:** openalex-mcp-server
4
- **Version:** 0.7.3
5
- **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.10.14`
4
+ **Version:** 0.7.5
5
+ **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.11.0`
6
6
  **Engines:** Bun ≥1.3.0, Node ≥24.0.0
7
7
 
8
8
  > **Read the framework docs first:** `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` contains the full API reference — builders, Context, error codes, exports, patterns. This file covers server-specific conventions only.
package/Dockerfile CHANGED
@@ -58,7 +58,7 @@ RUN --mount=type=cache,target=/root/.bun/install/cache \
58
58
  ARG OTEL_ENABLED=true
59
59
  RUN --mount=type=cache,target=/root/.bun/install/cache \
60
60
  if [ "$OTEL_ENABLED" = "true" ]; then \
61
- bun add @hono/otel \
61
+ bun add --omit=dev --ignore-scripts @hono/otel \
62
62
  @opentelemetry/instrumentation-http \
63
63
  @opentelemetry/exporter-metrics-otlp-http \
64
64
  @opentelemetry/exporter-trace-otlp-http \
package/LICENSE CHANGED
@@ -175,7 +175,7 @@
175
175
 
176
176
  END OF TERMS AND CONDITIONS
177
177
 
178
- Copyright 2026 cyanheads
178
+ Copyright 2026 Casey Hand @cyanheads
179
179
 
180
180
  Licensed under the Apache License, Version 2.0 (the "License");
181
181
  you may not use this file except in compliance with the License.
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  <div align="center">
9
9
 
10
- [![Version](https://img.shields.io/badge/Version-0.7.3-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/openalex-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/openalex-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/openalex-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^6.0.3-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.0-blueviolet.svg?style=flat-square)](https://bun.sh/)
10
+ [![Version](https://img.shields.io/badge/Version-0.7.5-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/openalex-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/openalex-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/openalex-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.0-blueviolet.svg?style=flat-square)](https://bun.sh/)
11
11
 
12
12
  </div>
13
13
 
@@ -50,7 +50,8 @@ Primary discovery and lookup tool. Covers all OpenAlex entity types (works, auth
50
50
  - Sensible default field selection per entity type, applied to both searches and ID lookups — prevents oversized responses; pass `select` to choose fields, or `["*"]` for the full record
51
51
  - Invalid `select` field names produce an error listing the valid fields for that entity type
52
52
  - Formatted MCP output is a generic markdown renderer — every returned field is surfaced without per-entity-type hard-coding
53
- - Cursor pagination, sorting, up to 100 results per page
53
+ - Cursor pagination and up to 100 results per page; `sort` takes a single key or a comma-separated list, with the `-` descending prefix applied per key
54
+ - `display_name` is nullable — OpenAlex holds no title for paratext and other untitled records, which pass through instead of failing the whole page
54
55
 
55
56
  ---
56
57
 
@@ -93,7 +94,7 @@ One-hop citation graph traversal from a seed work. Wraps the OpenAlex `cites`/`c
93
94
  Discover valid field names before constructing a query — avoids invalid-field 400 errors. Backed by a catalog generated from OpenAlex's own field validation.
94
95
 
95
96
  - List valid fields for any entity type and context (`filter`, `group_by`, or `select`)
96
- - `group_by` resolves to the same valid-field set as `filter`
97
+ - `group_by` returns the subset of the `filter` set OpenAlex can aggregate — raw date fields, `*.search` operators, and `from_*`/`to_*` range modifiers are excluded
97
98
  - Pass `query` (a partial or guessed name) to rank results by name similarity — surfaces the right field when you only know roughly what you want
98
99
  - Complements the ranked "did you mean" suggestions now appended to invalid-field errors on the search, trends, and citation-graph tools
99
100
 
@@ -119,7 +120,7 @@ OpenAlex-specific:
119
120
 
120
121
  - Typed API client with automatic ID normalization (DOI, ORCID, ROR, PMID, PMCID, ISSN, OpenAlex URLs)
121
122
  - Abstract reconstruction from inverted indices — plaintext instead of OpenAlex's position-keyed encoding
122
- - HTTP status codes mapped to specific MCP error classes (400/422 → InvalidParams, 429 → RateLimited, etc.) with upstream messages surfaced
123
+ - HTTP status codes mapped to specific MCP error classes (400 → InvalidParams, 422 → ValidationError, 429 → RateLimited, etc.) with upstream messages surfaced
123
124
  - Timeout-aware request retries and cancellation support via `AbortSignal`
124
125
 
125
126
  ## Getting Started
@@ -158,7 +159,7 @@ Add to your MCP client config (e.g., `claude_desktop_config.json`):
158
159
  }
159
160
  ```
160
161
 
161
- `OPENALEX_API_KEY` is optional — set it to a free [OpenAlex account key](https://openalex.org/settings/api) for keyed rate limits and budget under OpenAlex's usage-based pricing, or omit it for anonymous access. Set `OPENALEX_MAILTO` to an email if you want to identify yourself to OpenAlex (the [polite pool](https://docs.openalex.org/how-to-use-the-api/rate-limits-and-authentication#the-polite-pool)).
162
+ `OPENALEX_API_KEY` is optional — set it to a free [OpenAlex account key](https://openalex.org/settings/api) for keyed rate limits and budget under OpenAlex's usage-based pricing, or omit it for anonymous access. Set `OPENALEX_MAILTO` to an email if you want to identify yourself to OpenAlex (the [polite pool](https://developers.openalex.org/guides/authentication)).
162
163
 
163
164
  ### Prerequisites
164
165
 
@@ -186,7 +187,7 @@ bun install
186
187
  | Variable | Description | Default |
187
188
  |:---------|:------------|:--------|
188
189
  | `OPENALEX_API_KEY` | **Optional.** OpenAlex account API key, sent upstream as `api_key=` (free from [openalex.org/settings/api](https://openalex.org/settings/api)). Without it, anonymous rate limits apply. | — |
189
- | `OPENALEX_MAILTO` | **Optional.** Email sent upstream as `mailto=` to identify yourself to OpenAlex (the [polite pool](https://docs.openalex.org/how-to-use-the-api/rate-limits-and-authentication#the-polite-pool)). A courtesy identifier, separate from the API key. | — |
190
+ | `OPENALEX_MAILTO` | **Optional.** Email sent upstream as `mailto=` to identify yourself to OpenAlex (the [polite pool](https://developers.openalex.org/guides/authentication)). A courtesy identifier, separate from the API key. | — |
190
191
  | `OPENALEX_BASE_URL` | OpenAlex API base URL. | `https://api.openalex.org` |
191
192
  | `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http`. | `stdio` |
192
193
  | `MCP_HTTP_PORT` | Port for HTTP server. | `3010` |
package/dist/index.js CHANGED
@@ -33,7 +33,7 @@ await createApp({
33
33
  },
34
34
  links: [
35
35
  { label: 'OpenAlex', href: 'https://openalex.org' },
36
- { label: 'API Docs', href: 'https://docs.openalex.org' },
36
+ { label: 'API Docs', href: 'https://developers.openalex.org' },
37
37
  ],
38
38
  },
39
39
  setup() {
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,KAAK,EAAE;QACL,eAAe;QACf,kBAAkB;QAClB,iBAAiB;QACjB,oBAAoB;QAC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CAAC;IAC1D,YAAY,EACV,iUAAiU;IACnU,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"}
@@ -6,8 +6,8 @@ import { z } from '@cyanheads/mcp-ts-core';
6
6
  export declare const literatureReviewPrompt: import("@cyanheads/mcp-ts-core").PromptDefinition<z.ZodObject<{
7
7
  topic: z.ZodString;
8
8
  scope: z.ZodOptional<z.ZodEnum<{
9
- narrow: "narrow";
10
9
  broad: "broad";
10
+ narrow: "narrow";
11
11
  }>>;
12
12
  }, z.core.$strip>>;
13
13
  //# sourceMappingURL=literature-review.prompt.d.ts.map
@@ -29,7 +29,7 @@ Use the OpenAlex tools to build a quantitative profile:
29
29
 
30
30
  4. **Open access** — Group by oa_status. What fraction is freely available?
31
31
 
32
- 5. **Funding** — Group by awards.funder_id to identify major funders. The group keys are OpenAlex IDs — resolve the top funder IDs with openalex_resolve_name to get human-readable names.
32
+ 5. **Funding** — Group by awards.funder_id to identify major funders. The group keys are OpenAlex funder IDs, not names: resolve the top ones with openalex_search_entities (entity_type: "funders", id: <funder_id>) to get human-readable names — openalex_resolve_name searches names and will not resolve an ID. When readable labels suffice and exact counts are not critical, group by awards.funder_display_name instead to get names in a single hop.
33
33
 
34
34
  6. **Impact** — Search for the most-cited works (sort by -cited_by_count). Get details on the top 5.
35
35
 
@@ -6,14 +6,14 @@ import { z } from '@cyanheads/mcp-ts-core';
6
6
  import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
7
7
  export declare const analyzeTrendsTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
8
8
  entity_type: z.ZodEnum<{
9
- works: "works";
10
9
  authors: "authors";
11
- sources: "sources";
10
+ funders: "funders";
12
11
  institutions: "institutions";
13
- topics: "topics";
14
12
  keywords: "keywords";
15
13
  publishers: "publishers";
16
- funders: "funders";
14
+ sources: "sources";
15
+ topics: "topics";
16
+ works: "works";
17
17
  }>;
18
18
  group_by: z.ZodString;
19
19
  filters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -38,9 +38,15 @@ export declare const analyzeTrendsTool: import("@cyanheads/mcp-ts-core").ToolDef
38
38
  }, z.core.$strip>, readonly [{
39
39
  readonly reason: "rate_limited";
40
40
  readonly code: JsonRpcErrorCode.RateLimited;
41
- readonly when: "OpenAlex throttled the request (HTTP 429).";
41
+ readonly when: "OpenAlex throttled the request for exceeding its per-second ceiling (HTTP 429).";
42
42
  readonly retryable: true;
43
43
  readonly recovery: "Wait several seconds and retry; consider lowering request frequency for this caller.";
44
+ }, {
45
+ readonly reason: "upstream_budget_exhausted";
46
+ readonly code: JsonRpcErrorCode.RateLimited;
47
+ readonly when: "The OpenAlex daily usage budget is spent (HTTP 429).";
48
+ readonly retryable: false;
49
+ 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
50
  }, {
45
51
  readonly reason: "upstream_timeout";
46
52
  readonly code: JsonRpcErrorCode.Timeout;
@@ -50,7 +56,7 @@ export declare const analyzeTrendsTool: import("@cyanheads/mcp-ts-core").ToolDef
50
56
  }, {
51
57
  readonly reason: "upstream_unavailable";
52
58
  readonly code: JsonRpcErrorCode.ServiceUnavailable;
53
- readonly when: "OpenAlex returned HTTP 503 (service unavailable).";
59
+ readonly when: "OpenAlex was unreachable or unusable — HTTP 503, a connection failure, or a body that was empty, HTML, or unparseable JSON.";
54
60
  readonly retryable: true;
55
61
  readonly recovery: "Wait and retry; check https://openalex.org for service status if the outage persists.";
56
62
  }, {
@@ -65,14 +71,29 @@ export declare const analyzeTrendsTool: import("@cyanheads/mcp-ts-core").ToolDef
65
71
  readonly recovery: "Confirm the API key has access to this entity type or endpoint, then retry the request.";
66
72
  }, {
67
73
  readonly reason: "comma_in_filter_value";
68
- readonly code: JsonRpcErrorCode.ValidationError;
74
+ readonly code: JsonRpcErrorCode.InvalidParams;
69
75
  readonly when: "A filter value contains a comma, which collides with the OpenAlex filter separator.";
70
76
  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.";
71
77
  }, {
72
78
  readonly reason: "upstream_invalid_params";
73
- readonly code: JsonRpcErrorCode.ValidationError;
74
- readonly when: "OpenAlex rejected the group_by or filter as malformed (HTTP 400).";
79
+ readonly code: JsonRpcErrorCode.InvalidParams;
80
+ readonly when: "OpenAlex rejected an invalid group_by or filter field name (HTTP 400).";
75
81
  readonly recovery: "The upstream message names the rejected key and suggests close matches. Use openalex_describe_fields(entity_type, \"group_by\") to browse valid group_by fields, or openalex_describe_fields(entity_type, \"filter\") for filter fields.";
82
+ }, {
83
+ readonly reason: "upstream_invalid_id_value";
84
+ readonly code: JsonRpcErrorCode.InvalidParams;
85
+ readonly when: "An entity-ID filter received a value that is not an OpenAlex ID — usually a name (HTTP 400).";
86
+ 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 and primary_topic.id accept IDs only.";
87
+ }, {
88
+ readonly reason: "upstream_ungroupable_group_by";
89
+ readonly code: JsonRpcErrorCode.InvalidParams;
90
+ readonly when: "group_by targets a raw date, float, or *.search field OpenAlex cannot aggregate (HTTP 400).";
91
+ readonly recovery: "Group by a categorical or year field (e.g. publication_year, type, oa_status, or an integer count field) — raw date fields and *.search operators cannot be grouped. Call openalex_describe_fields(entity_type, \"group_by\") for the groupable set.";
92
+ }, {
93
+ readonly reason: "upstream_invalid_params_other";
94
+ readonly code: JsonRpcErrorCode.InvalidParams;
95
+ readonly when: "OpenAlex rejected the request (HTTP 400) for a reason other than an invalid field name.";
96
+ readonly recovery: "Read the upstream message in the error above and adjust the request — check filter operators, value formats, and the group_by field.";
76
97
  }, {
77
98
  readonly reason: "upstream_validation_failed";
78
99
  readonly code: JsonRpcErrorCode.ValidationError;
@@ -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;AAIjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0P5B,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;AAIjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuR5B,CAAC"}
@@ -14,10 +14,17 @@ export const analyzeTrendsTool = tool('openalex_analyze_trends', {
14
14
  {
15
15
  reason: 'rate_limited',
16
16
  code: JsonRpcErrorCode.RateLimited,
17
- when: 'OpenAlex throttled the request (HTTP 429).',
17
+ when: 'OpenAlex throttled the request for exceeding its per-second ceiling (HTTP 429).',
18
18
  retryable: true,
19
19
  recovery: 'Wait several seconds and retry; consider lowering request frequency for this caller.',
20
20
  },
21
+ {
22
+ reason: 'upstream_budget_exhausted',
23
+ code: JsonRpcErrorCode.RateLimited,
24
+ when: 'The OpenAlex daily usage budget is spent (HTTP 429).',
25
+ retryable: false,
26
+ 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.',
27
+ },
21
28
  {
22
29
  reason: 'upstream_timeout',
23
30
  code: JsonRpcErrorCode.Timeout,
@@ -28,7 +35,7 @@ export const analyzeTrendsTool = tool('openalex_analyze_trends', {
28
35
  {
29
36
  reason: 'upstream_unavailable',
30
37
  code: JsonRpcErrorCode.ServiceUnavailable,
31
- when: 'OpenAlex returned HTTP 503 (service unavailable).',
38
+ when: 'OpenAlex was unreachable or unusable — HTTP 503, a connection failure, or a body that was empty, HTML, or unparseable JSON.',
32
39
  retryable: true,
33
40
  recovery: 'Wait and retry; check https://openalex.org for service status if the outage persists.',
34
41
  },
@@ -46,16 +53,34 @@ export const analyzeTrendsTool = tool('openalex_analyze_trends', {
46
53
  },
47
54
  {
48
55
  reason: 'comma_in_filter_value',
49
- code: JsonRpcErrorCode.ValidationError,
56
+ code: JsonRpcErrorCode.InvalidParams,
50
57
  when: 'A filter value contains a comma, which collides with the OpenAlex filter separator.',
51
58
  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.',
52
59
  },
53
60
  {
54
61
  reason: 'upstream_invalid_params',
55
- code: JsonRpcErrorCode.ValidationError,
56
- when: 'OpenAlex rejected the group_by or filter as malformed (HTTP 400).',
62
+ code: JsonRpcErrorCode.InvalidParams,
63
+ when: 'OpenAlex rejected an invalid group_by or filter field name (HTTP 400).',
57
64
  recovery: 'The upstream message names the rejected key and suggests close matches. Use openalex_describe_fields(entity_type, "group_by") to browse valid group_by fields, or openalex_describe_fields(entity_type, "filter") for filter fields.',
58
65
  },
66
+ {
67
+ reason: 'upstream_invalid_id_value',
68
+ code: JsonRpcErrorCode.InvalidParams,
69
+ when: 'An entity-ID filter received a value that is not an OpenAlex ID — usually a name (HTTP 400).',
70
+ 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 and primary_topic.id accept IDs only.',
71
+ },
72
+ {
73
+ reason: 'upstream_ungroupable_group_by',
74
+ code: JsonRpcErrorCode.InvalidParams,
75
+ when: 'group_by targets a raw date, float, or *.search field OpenAlex cannot aggregate (HTTP 400).',
76
+ recovery: 'Group by a categorical or year field (e.g. publication_year, type, oa_status, or an integer count field) — raw date fields and *.search operators cannot be grouped. Call openalex_describe_fields(entity_type, "group_by") for the groupable set.',
77
+ },
78
+ {
79
+ reason: 'upstream_invalid_params_other',
80
+ code: JsonRpcErrorCode.InvalidParams,
81
+ when: 'OpenAlex rejected the request (HTTP 400) for a reason other than an invalid field name.',
82
+ recovery: 'Read the upstream message in the error above and adjust the request — check filter operators, value formats, and the group_by field.',
83
+ },
59
84
  {
60
85
  reason: 'upstream_validation_failed',
61
86
  code: JsonRpcErrorCode.ValidationError,
@@ -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,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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C,KAAK,EAAE,CAAC,CAAC;IACpD,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC"}
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,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;SACzF;QACD;YACE,MAAM,EAAE,2BAA2B;YACnC,IAAI,EAAE,gBAAgB,CAAC,WAAW;YAClC,IAAI,EAAE,sDAAsD;YAC5D,SAAS,EAAE,KAAK;YAChB,QAAQ,EACN,6NAA6N;SAChO;QACD;YACE,MAAM,EAAE,kBAAkB;YAC1B,IAAI,EAAE,gBAAgB,CAAC,OAAO;YAC9B,IAAI,EAAE,uDAAuD;YAC7D,SAAS,EAAE,IAAI;YACf,QAAQ,EACN,kHAAkH;SACrH;QACD;YACE,MAAM,EAAE,sBAAsB;YAC9B,IAAI,EAAE,gBAAgB,CAAC,kBAAkB;YACzC,IAAI,EAAE,6HAA6H;YACnI,SAAS,EA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 -24,14 +24,20 @@ export declare const getCitationGraphTool: import("@cyanheads/mcp-ts-core").Tool
24
24
  }, z.core.$strip>;
25
25
  results: z.ZodArray<z.ZodObject<{
26
26
  id: z.ZodString;
27
- display_name: z.ZodString;
27
+ display_name: z.ZodNullable<z.ZodString>;
28
28
  }, z.core.$loose>>;
29
29
  }, z.core.$strip>, readonly [{
30
30
  readonly reason: "rate_limited";
31
31
  readonly code: JsonRpcErrorCode.RateLimited;
32
- readonly when: "OpenAlex throttled the request (HTTP 429).";
32
+ readonly when: "OpenAlex throttled the request for exceeding its per-second ceiling (HTTP 429).";
33
33
  readonly retryable: true;
34
34
  readonly recovery: "Wait several seconds and retry; consider lowering request frequency for this caller.";
35
+ }, {
36
+ readonly reason: "upstream_budget_exhausted";
37
+ readonly code: JsonRpcErrorCode.RateLimited;
38
+ readonly when: "The OpenAlex daily usage budget is spent (HTTP 429).";
39
+ readonly retryable: false;
40
+ 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.";
35
41
  }, {
36
42
  readonly reason: "upstream_timeout";
37
43
  readonly code: JsonRpcErrorCode.Timeout;
@@ -41,7 +47,7 @@ export declare const getCitationGraphTool: import("@cyanheads/mcp-ts-core").Tool
41
47
  }, {
42
48
  readonly reason: "upstream_unavailable";
43
49
  readonly code: JsonRpcErrorCode.ServiceUnavailable;
44
- readonly when: "OpenAlex returned HTTP 503 (service unavailable).";
50
+ readonly when: "OpenAlex was unreachable or unusable — HTTP 503, a connection failure, or a body that was empty, HTML, or unparseable JSON.";
45
51
  readonly retryable: true;
46
52
  readonly recovery: "Wait and retry; check https://openalex.org for service status if the outage persists.";
47
53
  }, {
@@ -56,14 +62,29 @@ export declare const getCitationGraphTool: import("@cyanheads/mcp-ts-core").Tool
56
62
  readonly recovery: "Confirm the API key has access to this entity type or endpoint, then retry the request.";
57
63
  }, {
58
64
  readonly reason: "comma_in_filter_value";
59
- readonly code: JsonRpcErrorCode.ValidationError;
65
+ readonly code: JsonRpcErrorCode.InvalidParams;
60
66
  readonly when: "A filter value contains a comma, which collides with the OpenAlex filter separator.";
61
67
  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.";
62
68
  }, {
63
69
  readonly reason: "upstream_invalid_params";
64
- readonly code: JsonRpcErrorCode.ValidationError;
65
- readonly when: "OpenAlex rejected the seed_id, filter, or sort as malformed (HTTP 400).";
70
+ readonly code: JsonRpcErrorCode.InvalidParams;
71
+ readonly when: "OpenAlex rejected an invalid filter or sort field name (HTTP 400).";
66
72
  readonly recovery: "The upstream message names the rejected token and suggests close matches. Pass a valid OpenAlex work ID (W…), DOI, or PMID for seed_id, or use openalex_describe_fields(entity_type, \"filter\") to browse valid filter fields.";
73
+ }, {
74
+ readonly reason: "upstream_invalid_id_value";
75
+ readonly code: JsonRpcErrorCode.InvalidParams;
76
+ readonly when: "An entity-ID filter received a value that is not an OpenAlex ID — usually a name (HTTP 400).";
77
+ 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 and primary_topic.id accept IDs only.";
78
+ }, {
79
+ readonly reason: "upstream_sort_requires_search";
80
+ readonly code: JsonRpcErrorCode.InvalidParams;
81
+ readonly when: "sort=-relevance_score was used but the citation-graph query has no active search (HTTP 400).";
82
+ readonly recovery: "Sorting by relevance_score requires an active search, which a citation-graph walk lacks — choose a concrete sort field such as -cited_by_count or -publication_date, or add a `*.search` filter.";
83
+ }, {
84
+ readonly reason: "upstream_invalid_params_other";
85
+ readonly code: JsonRpcErrorCode.InvalidParams;
86
+ readonly when: "OpenAlex rejected the request (HTTP 400) for a reason other than an invalid field name.";
87
+ readonly recovery: "Read the upstream message in the error above and adjust the request — check filter operators, value formats, and cursor/per_page bounds.";
67
88
  }, {
68
89
  readonly reason: "reserved_filter_key";
69
90
  readonly code: JsonRpcErrorCode.ValidationError;
@@ -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;AAGH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AA+CjE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsP/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;AAGH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAmDjE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwR/B,CAAC"}
@@ -19,7 +19,7 @@ async function resolveSeedToWorkId(service, seedId, ctx) {
19
19
  const lookup = await service.search({ entityType: 'works', id: seedId, select: ['id'] }, ctx);
20
20
  const record = lookup.results[0];
21
21
  if (!record?.id) {
22
- throw new Error(`Could not resolve seed_id "${seedId}" to an OpenAlex work ID.`);
22
+ throw ctx.fail('entity_not_found', `Could not resolve seed_id "${seedId}" to an OpenAlex work ID.`, { ...ctx.recoveryFor('entity_not_found'), seedId });
23
23
  }
24
24
  return record.id.replace(OPENALEX_URL_PREFIX, '');
25
25
  }
@@ -42,10 +42,17 @@ export const getCitationGraphTool = tool('openalex_get_citation_graph', {
42
42
  {
43
43
  reason: 'rate_limited',
44
44
  code: JsonRpcErrorCode.RateLimited,
45
- when: 'OpenAlex throttled the request (HTTP 429).',
45
+ when: 'OpenAlex throttled the request for exceeding its per-second ceiling (HTTP 429).',
46
46
  retryable: true,
47
47
  recovery: 'Wait several seconds and retry; consider lowering request frequency for this caller.',
48
48
  },
49
+ {
50
+ reason: 'upstream_budget_exhausted',
51
+ code: JsonRpcErrorCode.RateLimited,
52
+ when: 'The OpenAlex daily usage budget is spent (HTTP 429).',
53
+ retryable: false,
54
+ 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.',
55
+ },
49
56
  {
50
57
  reason: 'upstream_timeout',
51
58
  code: JsonRpcErrorCode.Timeout,
@@ -56,7 +63,7 @@ export const getCitationGraphTool = tool('openalex_get_citation_graph', {
56
63
  {
57
64
  reason: 'upstream_unavailable',
58
65
  code: JsonRpcErrorCode.ServiceUnavailable,
59
- when: 'OpenAlex returned HTTP 503 (service unavailable).',
66
+ when: 'OpenAlex was unreachable or unusable — HTTP 503, a connection failure, or a body that was empty, HTML, or unparseable JSON.',
60
67
  retryable: true,
61
68
  recovery: 'Wait and retry; check https://openalex.org for service status if the outage persists.',
62
69
  },
@@ -74,16 +81,34 @@ export const getCitationGraphTool = tool('openalex_get_citation_graph', {
74
81
  },
75
82
  {
76
83
  reason: 'comma_in_filter_value',
77
- code: JsonRpcErrorCode.ValidationError,
84
+ code: JsonRpcErrorCode.InvalidParams,
78
85
  when: 'A filter value contains a comma, which collides with the OpenAlex filter separator.',
79
86
  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.',
80
87
  },
81
88
  {
82
89
  reason: 'upstream_invalid_params',
83
- code: JsonRpcErrorCode.ValidationError,
84
- when: 'OpenAlex rejected the seed_id, filter, or sort as malformed (HTTP 400).',
90
+ code: JsonRpcErrorCode.InvalidParams,
91
+ when: 'OpenAlex rejected an invalid filter or sort field name (HTTP 400).',
85
92
  recovery: 'The upstream message names the rejected token and suggests close matches. Pass a valid OpenAlex work ID (W…), DOI, or PMID for seed_id, or use openalex_describe_fields(entity_type, "filter") to browse valid filter fields.',
86
93
  },
94
+ {
95
+ reason: 'upstream_invalid_id_value',
96
+ code: JsonRpcErrorCode.InvalidParams,
97
+ when: 'An entity-ID filter received a value that is not an OpenAlex ID — usually a name (HTTP 400).',
98
+ 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 and primary_topic.id accept IDs only.',
99
+ },
100
+ {
101
+ reason: 'upstream_sort_requires_search',
102
+ code: JsonRpcErrorCode.InvalidParams,
103
+ when: 'sort=-relevance_score was used but the citation-graph query has no active search (HTTP 400).',
104
+ recovery: 'Sorting by relevance_score requires an active search, which a citation-graph walk lacks — choose a concrete sort field such as -cited_by_count or -publication_date, or add a `*.search` filter.',
105
+ },
106
+ {
107
+ reason: 'upstream_invalid_params_other',
108
+ code: JsonRpcErrorCode.InvalidParams,
109
+ when: 'OpenAlex rejected the request (HTTP 400) for a reason other than an invalid field name.',
110
+ recovery: 'Read the upstream message in the error above and adjust the request — check filter operators, value formats, and cursor/per_page bounds.',
111
+ },
87
112
  {
88
113
  reason: 'reserved_filter_key',
89
114
  code: JsonRpcErrorCode.ValidationError,
@@ -112,7 +137,7 @@ export const getCitationGraphTool = tool('openalex_get_citation_graph', {
112
137
  sort: z
113
138
  .string()
114
139
  .optional()
115
- .describe('Sort field. Prefix with "-" for descending. Common: "cited_by_count", "-publication_date". Default is OpenAlex relevance.'),
140
+ .describe('Sort field. Prefix with "-" for descending. Comma-separate for a multi-key sort, applied left to right, with the "-" prefix set per key ("-publication_year,cited_by_count" sorts by year descending, then citations ascending). Common: "cited_by_count", "-publication_date". Default is OpenAlex relevance.'),
116
141
  select: z
117
142
  .array(z.string())
118
143
  .optional()
@@ -146,7 +171,10 @@ export const getCitationGraphTool = tool('openalex_get_citation_graph', {
146
171
  .array(z
147
172
  .object({
148
173
  id: z.string().describe('OpenAlex work ID.'),
149
- display_name: z.string().describe('Work title.'),
174
+ display_name: z
175
+ .string()
176
+ .nullable()
177
+ .describe('Work title. null when OpenAlex holds no title for the record (paratext works and other untitled entries) — use `id` to identify it.'),
150
178
  })
151
179
  .passthrough()
152
180
  .describe('A single OpenAlex work record on the citation graph. Additional fields vary by `select`.'))
@@ -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;AAGH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAG7E,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AAEpD;;;;;;;GAOG;AACH,KAAK,UAAU,mBAAmB,CAChC,OAA8C,EAC9C,MAAc,EACd,GAAY;IAEZ,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAC9F,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACjC,IAAI,CAAC,MAAM,EAAE,EAAE,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,8BAA8B,MAAM,2BAA2B,CAAC,CAAC;IACnF,CAAC;IACD,OAAO,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,YAAY,CAAU,CAAC;AAGhE,MAAM,oBAAoB,GAAwB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rF,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW;YACpC,CAAC,CAAC,KAAK,UAAU,uBAAuB,MAAM,CAAC,IAAI,CAAC,WAAW,IAAI;YACnE,CAAC,CAAC,KAAK,UAAU,IAAI,CAAC;QACxB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAEnB,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAChC,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACpD,CAAC;QAED,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACpC,KAAK,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,MAAsB,CAAC,CAAC,CAAC;QAC5D,CAAC;QAED,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"citation-graph.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/citation-graph.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAG7E,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AAEpD;;;;;;;GAOG;AACH,KAAK,UAAU,mBAAmB,CAChC,OAA8C,EAC9C,MAAc,EACd,GAAuC;IAEvC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,EAAE,UAAU,EA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,CAAC,IAAI,CAAC,WAAW,IAAI;YACnE,CAAC,CAAC,KAAK,UAAU,IAAI,CAAC;QACxB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAEnB,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAChC,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACpD,CAAC;QAED,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACpC,KAAK,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,MAAsB,CAAC,CAAC,CAAC;QAC5D,CAAC;QAED,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
@@ -5,19 +5,19 @@
5
5
  import { z } from '@cyanheads/mcp-ts-core';
6
6
  export declare const describeFieldsTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
7
7
  entity_type: z.ZodEnum<{
8
- works: "works";
9
8
  authors: "authors";
10
- sources: "sources";
9
+ funders: "funders";
11
10
  institutions: "institutions";
12
- topics: "topics";
13
11
  keywords: "keywords";
14
12
  publishers: "publishers";
15
- funders: "funders";
13
+ sources: "sources";
14
+ topics: "topics";
15
+ works: "works";
16
16
  }>;
17
17
  context: z.ZodEnum<{
18
18
  filter: "filter";
19
- select: "select";
20
19
  group_by: "group_by";
20
+ select: "select";
21
21
  }>;
22
22
  query: z.ZodOptional<z.ZodString>;
23
23
  }, z.core.$strip>, z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"describe-fields.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/describe-fields.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAcjD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;wCAgE7B,CAAC"}
1
+ {"version":3,"file":"describe-fields.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/describe-fields.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAiCjD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;wCAoE7B,CAAC"}