@cyanheads/openalex-mcp-server 0.10.0 → 0.11.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.
Files changed (64) hide show
  1. package/AGENTS.md +30 -15
  2. package/CLAUDE.md +30 -15
  3. package/Dockerfile +6 -0
  4. package/README.md +55 -116
  5. package/changelog/0.10.x/0.10.1.md +28 -0
  6. package/changelog/0.11.x/0.11.0.md +41 -0
  7. package/dist/config/server-config.d.ts.map +1 -1
  8. package/dist/config/server-config.js +1 -1
  9. package/dist/config/server-config.js.map +1 -1
  10. package/dist/index.js +2 -1
  11. package/dist/index.js.map +1 -1
  12. package/dist/mcp-server/prompts/definitions/literature-review.prompt.js +1 -1
  13. package/dist/mcp-server/prompts/definitions/research-landscape.prompt.js +1 -1
  14. package/dist/mcp-server/tools/definitions/analyze-trends.tool.d.ts +1 -0
  15. package/dist/mcp-server/tools/definitions/analyze-trends.tool.d.ts.map +1 -1
  16. package/dist/mcp-server/tools/definitions/analyze-trends.tool.js +10 -5
  17. package/dist/mcp-server/tools/definitions/analyze-trends.tool.js.map +1 -1
  18. package/dist/mcp-server/tools/definitions/citation-graph.tool.d.ts +6 -9
  19. package/dist/mcp-server/tools/definitions/citation-graph.tool.d.ts.map +1 -1
  20. package/dist/mcp-server/tools/definitions/citation-graph.tool.js +43 -33
  21. package/dist/mcp-server/tools/definitions/citation-graph.tool.js.map +1 -1
  22. package/dist/mcp-server/tools/definitions/describe-fields.tool.d.ts +1 -0
  23. package/dist/mcp-server/tools/definitions/describe-fields.tool.d.ts.map +1 -1
  24. package/dist/mcp-server/tools/definitions/describe-fields.tool.js +25 -1
  25. package/dist/mcp-server/tools/definitions/describe-fields.tool.js.map +1 -1
  26. package/dist/mcp-server/tools/definitions/resolve-name.tool.d.ts.map +1 -1
  27. package/dist/mcp-server/tools/definitions/resolve-name.tool.js +44 -16
  28. package/dist/mcp-server/tools/definitions/resolve-name.tool.js.map +1 -1
  29. package/dist/mcp-server/tools/definitions/search-entities.tool.d.ts +22 -18
  30. package/dist/mcp-server/tools/definitions/search-entities.tool.d.ts.map +1 -1
  31. package/dist/mcp-server/tools/definitions/search-entities.tool.js +194 -85
  32. package/dist/mcp-server/tools/definitions/search-entities.tool.js.map +1 -1
  33. package/dist/mcp-server/tools/escape-markdown.d.ts +26 -11
  34. package/dist/mcp-server/tools/escape-markdown.d.ts.map +1 -1
  35. package/dist/mcp-server/tools/escape-markdown.js +95 -26
  36. package/dist/mcp-server/tools/escape-markdown.js.map +1 -1
  37. package/dist/mcp-server/tools/page-size.d.ts +38 -7
  38. package/dist/mcp-server/tools/page-size.d.ts.map +1 -1
  39. package/dist/mcp-server/tools/page-size.js +37 -11
  40. package/dist/mcp-server/tools/page-size.js.map +1 -1
  41. package/dist/mcp-server/tools/record-page.d.ts +174 -0
  42. package/dist/mcp-server/tools/record-page.d.ts.map +1 -0
  43. package/dist/mcp-server/tools/record-page.js +392 -0
  44. package/dist/mcp-server/tools/record-page.js.map +1 -0
  45. package/dist/mcp-server/tools/render-entity-record.d.ts +3 -1
  46. package/dist/mcp-server/tools/render-entity-record.d.ts.map +1 -1
  47. package/dist/mcp-server/tools/render-entity-record.js +7 -2
  48. package/dist/mcp-server/tools/render-entity-record.js.map +1 -1
  49. package/dist/services/openalex/field-catalog.json +107 -0
  50. package/dist/services/openalex/openalex-service.d.ts +18 -7
  51. package/dist/services/openalex/openalex-service.d.ts.map +1 -1
  52. package/dist/services/openalex/openalex-service.js +84 -63
  53. package/dist/services/openalex/openalex-service.js.map +1 -1
  54. package/dist/services/openalex/types.d.ts +13 -2
  55. package/dist/services/openalex/types.d.ts.map +1 -1
  56. package/dist/services/openalex/types.js +28 -1
  57. package/dist/services/openalex/types.js.map +1 -1
  58. package/package.json +7 -6
  59. package/server.json +5 -5
  60. package/skills/openalex-guide/SKILL.md +77 -0
  61. package/dist/mcp-server/tools/response-budget.d.ts +0 -159
  62. package/dist/mcp-server/tools/response-budget.d.ts.map +0 -1
  63. package/dist/mcp-server/tools/response-budget.js +0 -509
  64. package/dist/mcp-server/tools/response-budget.js.map +0 -1
@@ -7,6 +7,7 @@ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
7
7
  export declare const searchEntitiesTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
8
8
  entity_type: z.ZodEnum<{
9
9
  authors: "authors";
10
+ awards: "awards";
10
11
  funders: "funders";
11
12
  institutions: "institutions";
12
13
  keywords: "keywords";
@@ -28,14 +29,15 @@ export declare const searchEntitiesTool: import("@cyanheads/mcp-ts-core").ToolDe
28
29
  }, z.core.$strip>, unknown>>;
29
30
  sort: z.ZodOptional<z.ZodString>;
30
31
  select: z.ZodOptional<z.ZodArray<z.ZodString>>;
31
- per_page: z.ZodDefault<z.ZodLazy<z.ZodNumber>>;
32
+ per_page: z.ZodOptional<z.ZodLazy<z.ZodNumber>>;
32
33
  cursor: z.ZodOptional<z.ZodString>;
33
34
  page: z.ZodOptional<z.ZodNumber>;
34
- sample: z.ZodOptional<z.ZodNumber>;
35
+ sample: z.ZodOptional<z.ZodLazy<z.ZodNumber>>;
35
36
  seed: z.ZodOptional<z.ZodString>;
36
37
  slice: z.ZodOptional<z.ZodObject<{
37
38
  field: z.ZodString;
38
39
  offset: z.ZodDefault<z.ZodNumber>;
40
+ limit: z.ZodDefault<z.ZodLazy<z.ZodNumber>>;
39
41
  }, z.core.$strip>>;
40
42
  }, z.core.$strip>, z.ZodObject<{
41
43
  meta: z.ZodObject<{
@@ -47,13 +49,6 @@ export declare const searchEntitiesTool: import("@cyanheads/mcp-ts-core").ToolDe
47
49
  id: z.ZodString;
48
50
  display_name: z.ZodNullable<z.ZodString>;
49
51
  }, z.core.$loose>>;
50
- omitted: z.ZodOptional<z.ZodObject<{
51
- ids: z.ZodArray<z.ZodString>;
52
- next: z.ZodObject<{
53
- tool: z.ZodLiteral<"openalex_search_entities">;
54
- arguments: z.ZodObject<{}, z.core.$loose>;
55
- }, z.core.$strip>;
56
- }, z.core.$strip>>;
57
52
  windows: z.ZodOptional<z.ZodArray<z.ZodObject<{
58
53
  id: z.ZodString;
59
54
  field: z.ZodString;
@@ -66,7 +61,6 @@ export declare const searchEntitiesTool: import("@cyanheads/mcp-ts-core").ToolDe
66
61
  arguments: z.ZodObject<{}, z.core.$loose>;
67
62
  }, z.core.$strip>>;
68
63
  }, z.core.$strip>>>;
69
- over_budget: z.ZodOptional<z.ZodBoolean>;
70
64
  }, z.core.$strip>, readonly [{
71
65
  readonly reason: "invalid_filter_string";
72
66
  readonly code: JsonRpcErrorCode.ValidationError;
@@ -88,8 +82,13 @@ export declare const searchEntitiesTool: import("@cyanheads/mcp-ts-core").ToolDe
88
82
  }, {
89
83
  readonly reason: "semantic_per_page_cap";
90
84
  readonly code: JsonRpcErrorCode.ValidationError;
91
- readonly when: "A search (no `id`) set per_page above the semantic-search cap of 50.";
85
+ readonly when: "A semantic search (no `id`) set per_page above its cap of 50 on a server with OPENALEX_CLAMP_PER_PAGE=false; with clamping on (the default), it returns 50 and says so.";
92
86
  readonly recovery: "Reduce per_page to 50 or less, or switch search_mode to keyword.";
87
+ }, {
88
+ readonly reason: "response_too_large";
89
+ readonly code: JsonRpcErrorCode.ValidationError;
90
+ readonly when: "The response's structuredContent or content[] text would exceed 8,000,000 bytes — a wide `select` on a large page, or a record with very long arrays. A page is never shortened to fit.";
91
+ readonly recovery: "Rerun with the per_page or slice.limit the error names when it names one, or narrow `select` to the fields you need; for a single oversized record, page its largest array with `slice`.";
93
92
  }, {
94
93
  readonly reason: "semantic_without_query";
95
94
  readonly code: JsonRpcErrorCode.ValidationError;
@@ -103,18 +102,23 @@ export declare const searchEntitiesTool: import("@cyanheads/mcp-ts-core").ToolDe
103
102
  }, {
104
103
  readonly reason: "page_without_semantic";
105
104
  readonly code: JsonRpcErrorCode.ValidationError;
106
- readonly when: "A search supplied `page` under a search_mode other than \"semantic\".";
107
- readonly recovery: "Drop `page` and paginate with `cursor`, or set search_mode to \"semantic\" — the only mode `page` applies to.";
105
+ readonly when: "A search supplied `page` with neither search_mode \"semantic\" nor `sample`.";
106
+ readonly recovery: "Drop `page` and paginate with `cursor`, set search_mode to \"semantic\", or pass `sample` with a `seed` — the only searches `page` walks.";
108
107
  }, {
109
108
  readonly reason: "sample_with_cursor";
110
109
  readonly code: JsonRpcErrorCode.ValidationError;
111
110
  readonly when: "A search (no `id`) provided both `sample` and `cursor`.";
112
- readonly recovery: "Sampling returns a single page only; remove `cursor` or remove `sample`.";
111
+ readonly recovery: "A sample walks its draw with `page` and a `seed`, not `cursor`; remove `cursor`, or remove `sample`.";
112
+ }, {
113
+ readonly reason: "sample_page_without_seed";
114
+ readonly code: JsonRpcErrorCode.ValidationError;
115
+ readonly when: "A search (no `id`) provided `page` with `sample` but no `seed`, which OpenAlex refuses: an unseeded sample redraws on every call, so its pages would overlap.";
116
+ readonly recovery: "Pass `seed` to page a sample — an unseeded sample redraws on every call — or drop `page`.";
113
117
  }, {
114
- readonly reason: "sample_with_page";
118
+ readonly reason: "sample_page_too_deep";
115
119
  readonly code: JsonRpcErrorCode.ValidationError;
116
- readonly when: "A search (no `id`) provided both `sample` and `page`.";
117
- readonly recovery: "Sampling returns a single page only; remove `page` or remove `sample`.";
120
+ readonly when: `A sample page reaches past record ${string} (\`page\` × \`per_page\` above ${string}), the most of a sample OpenAlex serves by page number.`;
121
+ readonly recovery: `Keep \`page\` × \`per_page\` at or under ${string}, with a per_page that divides ${string} — 25, 50, or 100 — so the last page ends on record ${string}; at per_page 100 that is page 100.`;
118
122
  }, {
119
123
  readonly reason: "sample_with_semantic";
120
124
  readonly code: JsonRpcErrorCode.ValidationError;
@@ -144,7 +148,7 @@ export declare const searchEntitiesTool: import("@cyanheads/mcp-ts-core").ToolDe
144
148
  readonly reason: "id_type_mismatch";
145
149
  readonly code: JsonRpcErrorCode.ValidationError;
146
150
  readonly when: "`id` is a native OpenAlex ID whose letter names another entity type than `entity_type`, or a concept ID (C…), a type this server does not serve.";
147
- readonly recovery: "Pass the entity_type the ID letter names — W works, A authors, S sources, I institutions, T topics, P publishers, F funders. A concept ID (C…) has no entity_type here; search topics for the concept by name with openalex_resolve_name instead.";
151
+ readonly recovery: "Pass the entity_type the ID letter names — W works, A authors, S sources, I institutions, T topics, P publishers, F funders, G awards. A concept ID (C…) has no entity_type here; search topics for the concept by name with openalex_resolve_name instead.";
148
152
  readonly thrownBy: "service";
149
153
  }, {
150
154
  readonly reason: "id_dot_segment";
@@ -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;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AA4HjE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqsB7B,CAAC"}
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;AA4IjE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2zB7B,CAAC"}