@cyanheads/orcid-mcp-server 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +405 -0
- package/Dockerfile +98 -0
- package/README.md +321 -0
- package/changelog/0.1.x/0.1.0.md +20 -0
- package/changelog/0.1.x/0.1.1.md +13 -0
- package/changelog/template.md +119 -0
- package/dist/config/server-config.d.ts +12 -0
- package/dist/config/server-config.d.ts.map +1 -0
- package/dist/config/server-config.js +22 -0
- package/dist/config/server-config.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-server/resources/definitions/researcher-profile.resource.d.ts +24 -0
- package/dist/mcp-server/resources/definitions/researcher-profile.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/researcher-profile.resource.js +62 -0
- package/dist/mcp-server/resources/definitions/researcher-profile.resource.js.map +1 -0
- package/dist/mcp-server/resources/definitions/researcher-works.resource.d.ts +24 -0
- package/dist/mcp-server/resources/definitions/researcher-works.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/researcher-works.resource.js +60 -0
- package/dist/mcp-server/resources/definitions/researcher-works.resource.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-affiliations.tool.d.ts +47 -0
- package/dist/mcp-server/tools/definitions/get-affiliations.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-affiliations.tool.js +170 -0
- package/dist/mcp-server/tools/definitions/get-affiliations.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-funding.tool.d.ts +36 -0
- package/dist/mcp-server/tools/definitions/get-funding.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-funding.tool.js +140 -0
- package/dist/mcp-server/tools/definitions/get-funding.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-peer-reviews.tool.d.ts +35 -0
- package/dist/mcp-server/tools/definitions/get-peer-reviews.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-peer-reviews.tool.js +146 -0
- package/dist/mcp-server/tools/definitions/get-peer-reviews.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-profile.tool.d.ts +39 -0
- package/dist/mcp-server/tools/definitions/get-profile.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-profile.tool.js +146 -0
- package/dist/mcp-server/tools/definitions/get-profile.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-works.tool.d.ts +35 -0
- package/dist/mcp-server/tools/definitions/get-works.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-works.tool.js +127 -0
- package/dist/mcp-server/tools/definitions/get-works.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/resolve-researcher.tool.d.ts +46 -0
- package/dist/mcp-server/tools/definitions/resolve-researcher.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/resolve-researcher.tool.js +250 -0
- package/dist/mcp-server/tools/definitions/resolve-researcher.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/search-researchers.tool.d.ts +40 -0
- package/dist/mcp-server/tools/definitions/search-researchers.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/search-researchers.tool.js +192 -0
- package/dist/mcp-server/tools/definitions/search-researchers.tool.js.map +1 -0
- package/dist/services/orcid/normalizers.d.ts +32 -0
- package/dist/services/orcid/normalizers.d.ts.map +1 -0
- package/dist/services/orcid/normalizers.js +256 -0
- package/dist/services/orcid/normalizers.js.map +1 -0
- package/dist/services/orcid/orcid-service.d.ts +65 -0
- package/dist/services/orcid/orcid-service.d.ts.map +1 -0
- package/dist/services/orcid/orcid-service.js +140 -0
- package/dist/services/orcid/orcid-service.js.map +1 -0
- package/dist/services/orcid/types.d.ts +335 -0
- package/dist/services/orcid/types.d.ts.map +1 -0
- package/dist/services/orcid/types.js +6 -0
- package/dist/services/orcid/types.js.map +1 -0
- package/package.json +79 -0
- package/server.json +99 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"researcher-profile.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/researcher-profile.resource.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAEtF,MAAM,CAAC,MAAM,yBAAyB,GAAG,QAAQ,CAAC,uCAAuC,EAAE;IACzF,IAAI,EAAE,0BAA0B;IAChC,WAAW,EACT,kWAAkW;IACpW,QAAQ,EAAE,kBAAkB;IAE5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,KAAK,CACJ,0DAA0D,EAC1D,wEAAwE,CACzE;aACA,QAAQ,CACP,mGAAmG,CACpG;KACJ,CAAC;IAEF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;QAClE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;QAChD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;QAC/E,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;QAC/E,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;QAC5E,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAA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UAAU,EAAE,CAAC;YAC3D,GAAG,CAAC,MAAM,CAAC,UAAU,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC;YAC3D,GAAG,CAAC,MAAM,CAAC,UAAU,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC;YAC3D,GAAG,CAAC,MAAM,CAAC,SAAS,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC;YACxD,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,mBAAmB,EAAE,MAAM,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;gBAC3D,IAAI,EAAE,EAAE,CAAC,IAAI;gBACb,KAAK,EAAE,EAAE,CAAC,KAAK;gBACf,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC;aAC/B,CAAC,CAAC;SACJ,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Resource for injecting a researcher's works list from ORCID as
|
|
3
|
+
* stable inline context into prompts. DOIs and PMIDs are ready for Crossref/PubMed chaining.
|
|
4
|
+
* @module mcp-server/resources/definitions/researcher-works.resource
|
|
5
|
+
*/
|
|
6
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
7
|
+
export declare const researcherWorksResource: import("@cyanheads/mcp-ts-core").ResourceDefinition<z.ZodObject<{
|
|
8
|
+
orcid_id: z.ZodString;
|
|
9
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
10
|
+
orcidId: z.ZodString;
|
|
11
|
+
orcidUri: z.ZodString;
|
|
12
|
+
workCount: z.ZodNumber;
|
|
13
|
+
works: z.ZodArray<z.ZodObject<{
|
|
14
|
+
title: z.ZodOptional<z.ZodString>;
|
|
15
|
+
workType: z.ZodOptional<z.ZodString>;
|
|
16
|
+
publicationDate: z.ZodOptional<z.ZodString>;
|
|
17
|
+
journalTitle: z.ZodOptional<z.ZodString>;
|
|
18
|
+
externalIds: z.ZodArray<z.ZodObject<{
|
|
19
|
+
type: z.ZodString;
|
|
20
|
+
value: z.ZodString;
|
|
21
|
+
}, z.core.$strip>>;
|
|
22
|
+
}, z.core.$strip>>;
|
|
23
|
+
}, z.core.$strip>, undefined>;
|
|
24
|
+
//# sourceMappingURL=researcher-works.resource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"researcher-works.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/researcher-works.resource.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAGrD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;6BAmElC,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Resource for injecting a researcher's works list from ORCID as
|
|
3
|
+
* stable inline context into prompts. DOIs and PMIDs are ready for Crossref/PubMed chaining.
|
|
4
|
+
* @module mcp-server/resources/definitions/researcher-works.resource
|
|
5
|
+
*/
|
|
6
|
+
import { resource, z } from '@cyanheads/mcp-ts-core';
|
|
7
|
+
import { getOrcidService, normalizeOrcidId } from '../../../services/orcid/orcid-service.js';
|
|
8
|
+
export const researcherWorksResource = resource('orcid://researcher/{orcid_id}/works', {
|
|
9
|
+
name: 'orcid-researcher-works',
|
|
10
|
+
description: "Works list for an ORCID researcher: titles, types, publication dates, journal names, and external identifiers (DOIs, PMIDs, arXiv IDs). Use when providing a researcher's publication list as background context, e.g., before asking an LLM to summarize a body of work. DOIs and PMIDs in the response are ready for Crossref or PubMed chaining. Prefer the orcid_get_works tool when filtering or processing results is needed.",
|
|
11
|
+
mimeType: 'application/json',
|
|
12
|
+
params: z.object({
|
|
13
|
+
orcid_id: z
|
|
14
|
+
.string()
|
|
15
|
+
.regex(/^(https?:\/\/orcid\.org\/)?\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/, 'Must be a valid ORCID iD (e.g. 0000-0001-2345-6789) or full ORCID URI.')
|
|
16
|
+
.describe('ORCID iD — bare format (0000-0001-2345-6789) or full URI (https://orcid.org/0000-0001-2345-6789).'),
|
|
17
|
+
}),
|
|
18
|
+
output: z.object({
|
|
19
|
+
orcidId: z.string().describe('Normalized ORCID iD (bare format).'),
|
|
20
|
+
orcidUri: z.string().describe('Full ORCID URI.'),
|
|
21
|
+
workCount: z.number().describe('Total works in this list.'),
|
|
22
|
+
works: z
|
|
23
|
+
.array(z
|
|
24
|
+
.object({
|
|
25
|
+
title: z.string().optional().describe('Work title.'),
|
|
26
|
+
workType: z.string().optional().describe('Work type (journal-article, dataset, etc.).'),
|
|
27
|
+
publicationDate: z.string().optional().describe('Publication date.'),
|
|
28
|
+
journalTitle: z.string().optional().describe('Journal or container title.'),
|
|
29
|
+
externalIds: z
|
|
30
|
+
.array(z
|
|
31
|
+
.object({
|
|
32
|
+
type: z.string().describe('ID type (doi, pmid, arxiv, isbn, etc.).'),
|
|
33
|
+
value: z.string().describe('ID value.'),
|
|
34
|
+
})
|
|
35
|
+
.describe('External identifier.'))
|
|
36
|
+
.describe('External identifiers for this work.'),
|
|
37
|
+
})
|
|
38
|
+
.describe('Work summary.'))
|
|
39
|
+
.describe('Works associated with this ORCID iD.'),
|
|
40
|
+
}),
|
|
41
|
+
async handler(params, ctx) {
|
|
42
|
+
const service = getOrcidService();
|
|
43
|
+
const bareId = normalizeOrcidId(params.orcid_id);
|
|
44
|
+
ctx.log.debug('orcid-researcher-works resource', { orcidId: bareId });
|
|
45
|
+
const works = await service.getWorks(params.orcid_id, ctx);
|
|
46
|
+
return {
|
|
47
|
+
orcidId: bareId,
|
|
48
|
+
orcidUri: `https://orcid.org/${bareId}`,
|
|
49
|
+
workCount: works.length,
|
|
50
|
+
works: works.map((w) => ({
|
|
51
|
+
...(w.title && { title: w.title }),
|
|
52
|
+
...(w.workType && { workType: w.workType }),
|
|
53
|
+
...(w.publicationDate && { publicationDate: w.publicationDate }),
|
|
54
|
+
...(w.journalTitle && { journalTitle: w.journalTitle }),
|
|
55
|
+
externalIds: w.externalIds.map((id) => ({ type: id.type, value: id.value })),
|
|
56
|
+
})),
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=researcher-works.resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"researcher-works.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/researcher-works.resource.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAEtF,MAAM,CAAC,MAAM,uBAAuB,GAAG,QAAQ,CAAC,qCAAqC,EAAE;IACrF,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EACT,qaAAqa;IACva,QAAQ,EAAE,kBAAkB;IAE5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,KAAK,CACJ,0DAA0D,EAC1D,wEAAwE,CACzE;aACA,QAAQ,CACP,mGAAmG,CACpG;KACJ,CAAC;IAEF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;QAClE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;QAChD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;QAC3D,KAAK,EAAE,CAAC;aACL,KAAK,CACJ,CAAC;aACE,MAAM,CAAC;YACN,KAAK,EAAE,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B,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBACvB,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;gBAClC,GAAG,CAAC,CAAC,CAAC,QAAQ,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;gBAC3C,GAAG,CAAC,CAAC,CAAC,eAAe,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC,eAAe,EAAE,CAAC;gBAChE,GAAG,CAAC,CAAC,CAAC,YAAY,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC,YAAY,EAAE,CAAC;gBACvD,WAAW,EAAE,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC;aAC7E,CAAC,CAAC;SACJ,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Fetch affiliation records (employment, education, invited positions,
|
|
3
|
+
* distinctions, memberships, qualifications, services) for an ORCID researcher.
|
|
4
|
+
* @module mcp-server/tools/definitions/get-affiliations.tool
|
|
5
|
+
*/
|
|
6
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
7
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
8
|
+
export declare const orcidGetAffiliations: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
9
|
+
orcid_id: z.ZodString;
|
|
10
|
+
types: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
11
|
+
employment: "employment";
|
|
12
|
+
education: "education";
|
|
13
|
+
"invited-positions": "invited-positions";
|
|
14
|
+
distinctions: "distinctions";
|
|
15
|
+
memberships: "memberships";
|
|
16
|
+
qualifications: "qualifications";
|
|
17
|
+
services: "services";
|
|
18
|
+
all: "all";
|
|
19
|
+
}>>>;
|
|
20
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
21
|
+
orcidId: z.ZodString;
|
|
22
|
+
orcidUri: z.ZodString;
|
|
23
|
+
affiliationCount: z.ZodNumber;
|
|
24
|
+
affiliations: z.ZodArray<z.ZodObject<{
|
|
25
|
+
type: z.ZodString;
|
|
26
|
+
organization: z.ZodOptional<z.ZodObject<{
|
|
27
|
+
name: z.ZodOptional<z.ZodString>;
|
|
28
|
+
city: z.ZodOptional<z.ZodString>;
|
|
29
|
+
country: z.ZodOptional<z.ZodString>;
|
|
30
|
+
disambiguatedId: z.ZodOptional<z.ZodString>;
|
|
31
|
+
disambiguationSource: z.ZodOptional<z.ZodString>;
|
|
32
|
+
}, z.core.$strip>>;
|
|
33
|
+
department: z.ZodOptional<z.ZodString>;
|
|
34
|
+
role: z.ZodOptional<z.ZodString>;
|
|
35
|
+
startDate: z.ZodOptional<z.ZodString>;
|
|
36
|
+
endDate: z.ZodOptional<z.ZodString>;
|
|
37
|
+
url: z.ZodOptional<z.ZodString>;
|
|
38
|
+
}, z.core.$strip>>;
|
|
39
|
+
requestedTypes: z.ZodArray<z.ZodString>;
|
|
40
|
+
notice: z.ZodOptional<z.ZodString>;
|
|
41
|
+
}, z.core.$strip>, readonly [{
|
|
42
|
+
readonly reason: "profile_not_found";
|
|
43
|
+
readonly code: JsonRpcErrorCode.NotFound;
|
|
44
|
+
readonly when: "The ORCID iD does not correspond to a registered researcher.";
|
|
45
|
+
readonly recovery: "Verify the ORCID iD is correct and try orcid_search_researchers to find valid iDs.";
|
|
46
|
+
}]>;
|
|
47
|
+
//# sourceMappingURL=get-affiliations.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-affiliations.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-affiliations.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAY,MAAM,+BAA+B,CAAC;AAmB3E,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0L/B,CAAC"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Fetch affiliation records (employment, education, invited positions,
|
|
3
|
+
* distinctions, memberships, qualifications, services) for an ORCID researcher.
|
|
4
|
+
* @module mcp-server/tools/definitions/get-affiliations.tool
|
|
5
|
+
*/
|
|
6
|
+
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
7
|
+
import { JsonRpcErrorCode, McpError } from '@cyanheads/mcp-ts-core/errors';
|
|
8
|
+
import { getOrcidService, normalizeOrcidId, } from '../../../services/orcid/orcid-service.js';
|
|
9
|
+
const AFFILIATION_TYPES = [
|
|
10
|
+
'employment',
|
|
11
|
+
'education',
|
|
12
|
+
'invited-positions',
|
|
13
|
+
'distinctions',
|
|
14
|
+
'memberships',
|
|
15
|
+
'qualifications',
|
|
16
|
+
'services',
|
|
17
|
+
'all',
|
|
18
|
+
];
|
|
19
|
+
export const orcidGetAffiliations = tool('orcid_get_affiliations', {
|
|
20
|
+
title: 'Get ORCID Researcher Affiliations',
|
|
21
|
+
description: 'Fetch affiliation records for an ORCID researcher. The `types` parameter controls which affiliation sections to return: employment, education, invited-positions, distinctions, memberships, qualifications, services, or all. Default is employment and education. Returns organization names, disambiguated organization identifiers (ROR/GRID/Ringgold), departments, roles, and date ranges. Affiliation data is self-reported; absence does not mean no affiliation.',
|
|
22
|
+
annotations: { readOnlyHint: true, openWorldHint: false, idempotentHint: true },
|
|
23
|
+
input: z.object({
|
|
24
|
+
orcid_id: z
|
|
25
|
+
.string()
|
|
26
|
+
.regex(/^(https?:\/\/orcid\.org\/)?\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/, 'Must be a valid ORCID iD (e.g. 0000-0001-2345-6789) or full ORCID URI.')
|
|
27
|
+
.describe('ORCID iD — bare format (0000-0001-2345-6789) or full URI (https://orcid.org/0000-0001-2345-6789).'),
|
|
28
|
+
types: z
|
|
29
|
+
.array(z
|
|
30
|
+
.enum(AFFILIATION_TYPES)
|
|
31
|
+
.describe('Affiliation section type. Use "all" to include all section types.'))
|
|
32
|
+
.default(['employment', 'education'])
|
|
33
|
+
.describe('Which affiliation types to return. Defaults to employment and education. Use ["all"] to get every section.'),
|
|
34
|
+
}),
|
|
35
|
+
output: z.object({
|
|
36
|
+
orcidId: z.string().describe('Normalized ORCID iD (bare format).'),
|
|
37
|
+
orcidUri: z.string().describe('Full ORCID URI.'),
|
|
38
|
+
affiliationCount: z.number().describe('Total number of affiliation records returned.'),
|
|
39
|
+
affiliations: z
|
|
40
|
+
.array(z
|
|
41
|
+
.object({
|
|
42
|
+
type: z
|
|
43
|
+
.string()
|
|
44
|
+
.describe('Affiliation section type (employment, education, invited-positions, etc.).'),
|
|
45
|
+
organization: z
|
|
46
|
+
.object({
|
|
47
|
+
name: z.string().optional().describe('Organization name.'),
|
|
48
|
+
city: z.string().optional().describe('City of the organization.'),
|
|
49
|
+
country: z.string().optional().describe('Country of the organization.'),
|
|
50
|
+
disambiguatedId: z
|
|
51
|
+
.string()
|
|
52
|
+
.optional()
|
|
53
|
+
.describe('Disambiguated organization identifier (ROR URL, GRID ID, or Ringgold ID).'),
|
|
54
|
+
disambiguationSource: z
|
|
55
|
+
.string()
|
|
56
|
+
.optional()
|
|
57
|
+
.describe('Source of the disambiguation (ROR, GRID, or RINGGOLD).'),
|
|
58
|
+
})
|
|
59
|
+
.optional()
|
|
60
|
+
.describe('Organization details.'),
|
|
61
|
+
department: z
|
|
62
|
+
.string()
|
|
63
|
+
.optional()
|
|
64
|
+
.describe('Department or unit within the organization.'),
|
|
65
|
+
role: z.string().optional().describe('Job title or role.'),
|
|
66
|
+
startDate: z.string().optional().describe('Start date (YYYY, YYYY-MM, or YYYY-MM-DD).'),
|
|
67
|
+
endDate: z
|
|
68
|
+
.string()
|
|
69
|
+
.optional()
|
|
70
|
+
.describe('End date (YYYY, YYYY-MM, or YYYY-MM-DD). Absent if current.'),
|
|
71
|
+
url: z.string().optional().describe('URL for the affiliation record, if provided.'),
|
|
72
|
+
})
|
|
73
|
+
.describe('Affiliation record.'))
|
|
74
|
+
.describe('Affiliation records for the requested types.'),
|
|
75
|
+
requestedTypes: z
|
|
76
|
+
.array(z.string().describe('Affiliation type.'))
|
|
77
|
+
.describe('Affiliation types that were requested.'),
|
|
78
|
+
notice: z
|
|
79
|
+
.string()
|
|
80
|
+
.optional()
|
|
81
|
+
.describe('Note when no affiliations were found — may indicate private visibility or no self-reported affiliations.'),
|
|
82
|
+
}),
|
|
83
|
+
errors: [
|
|
84
|
+
{
|
|
85
|
+
reason: 'profile_not_found',
|
|
86
|
+
code: JsonRpcErrorCode.NotFound,
|
|
87
|
+
when: 'The ORCID iD does not correspond to a registered researcher.',
|
|
88
|
+
recovery: 'Verify the ORCID iD is correct and try orcid_search_researchers to find valid iDs.',
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
async handler(input, ctx) {
|
|
92
|
+
const service = getOrcidService();
|
|
93
|
+
ctx.log.info('orcid_get_affiliations', { orcidId: input.orcid_id, types: input.types });
|
|
94
|
+
let affiliations;
|
|
95
|
+
try {
|
|
96
|
+
affiliations = await service.getAffiliations(input.orcid_id, input.types, ctx);
|
|
97
|
+
}
|
|
98
|
+
catch (err) {
|
|
99
|
+
if (err instanceof McpError && err.code === JsonRpcErrorCode.NotFound) {
|
|
100
|
+
throw ctx.fail('profile_not_found', `ORCID iD ${normalizeOrcidId(input.orcid_id)} not found`);
|
|
101
|
+
}
|
|
102
|
+
throw err;
|
|
103
|
+
}
|
|
104
|
+
const bareId = normalizeOrcidId(input.orcid_id);
|
|
105
|
+
ctx.log.info('orcid_get_affiliations completed', {
|
|
106
|
+
orcidId: bareId,
|
|
107
|
+
affiliationCount: affiliations.length,
|
|
108
|
+
});
|
|
109
|
+
const notice = affiliations.length === 0
|
|
110
|
+
? `No affiliations found for the requested types (${input.types.join(', ')}). These may be set to private or not self-reported.`
|
|
111
|
+
: undefined;
|
|
112
|
+
return {
|
|
113
|
+
orcidId: bareId,
|
|
114
|
+
orcidUri: `https://orcid.org/${bareId}`,
|
|
115
|
+
affiliationCount: affiliations.length,
|
|
116
|
+
affiliations,
|
|
117
|
+
requestedTypes: input.types,
|
|
118
|
+
...(notice && { notice }),
|
|
119
|
+
};
|
|
120
|
+
},
|
|
121
|
+
format: (result) => {
|
|
122
|
+
const lines = [
|
|
123
|
+
`## Affiliations for ORCID ${result.orcidId}`,
|
|
124
|
+
`**URI:** ${result.orcidUri}`,
|
|
125
|
+
`**Types Requested:** ${result.requestedTypes.join(', ')}`,
|
|
126
|
+
`**Total Affiliations:** ${result.affiliationCount}`,
|
|
127
|
+
];
|
|
128
|
+
if (result.notice) {
|
|
129
|
+
lines.push('', `> ${result.notice}`);
|
|
130
|
+
}
|
|
131
|
+
if (result.affiliations.length === 0) {
|
|
132
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
133
|
+
}
|
|
134
|
+
// Group by type for readability
|
|
135
|
+
const byType = new Map();
|
|
136
|
+
for (const a of result.affiliations) {
|
|
137
|
+
const group = byType.get(a.type) ?? [];
|
|
138
|
+
group.push(a);
|
|
139
|
+
byType.set(a.type, group);
|
|
140
|
+
}
|
|
141
|
+
for (const [type, affs] of byType) {
|
|
142
|
+
lines.push('', `### ${type.charAt(0).toUpperCase() + type.slice(1).replace(/-/g, ' ')}`);
|
|
143
|
+
for (const a of affs) {
|
|
144
|
+
const orgName = a.organization?.name ?? 'Unknown organization';
|
|
145
|
+
lines.push(`**${orgName}**`);
|
|
146
|
+
if (a.department)
|
|
147
|
+
lines.push(` Department: ${a.department}`);
|
|
148
|
+
if (a.role)
|
|
149
|
+
lines.push(` Role: ${a.role}`);
|
|
150
|
+
const dateRange = [a.startDate, a.endDate ? a.endDate : 'present']
|
|
151
|
+
.filter(Boolean)
|
|
152
|
+
.join(' – ');
|
|
153
|
+
if (dateRange)
|
|
154
|
+
lines.push(` Dates: ${dateRange}`);
|
|
155
|
+
if (a.organization?.city)
|
|
156
|
+
lines.push(` City: ${a.organization.city}`);
|
|
157
|
+
if (a.organization?.country)
|
|
158
|
+
lines.push(` Country: ${a.organization.country}`);
|
|
159
|
+
if (a.organization?.disambiguatedId) {
|
|
160
|
+
lines.push(` Org ID: ${a.organization.disambiguatedId} (${a.organization.disambiguationSource ?? 'unknown source'})`);
|
|
161
|
+
}
|
|
162
|
+
if (a.url)
|
|
163
|
+
lines.push(` URL: ${a.url}`);
|
|
164
|
+
lines.push('');
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
//# sourceMappingURL=get-affiliations.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-affiliations.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-affiliations.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAEL,eAAe,EACf,gBAAgB,GACjB,MAAM,mCAAmC,CAAC;AAG3C,MAAM,iBAAiB,GAAG;IACxB,YAAY;IACZ,WAAW;IACX,mBAAmB;IACnB,cAAc;IACd,aAAa;IACb,gBAAgB;IAChB,UAAU;IACV,KAAK;CACG,CAAC;AAEX,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC,wBAAwB,EAAE;IACjE,KAAK,EAAE,mCAAmC;IAC1C,WAAW,EACT,2cAA2c;IAC7c,WAAW,EAAE,EAA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AU,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;gBACzC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACjB,CAAC;QACH,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"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Fetch funding records for a researcher from ORCID: grants, contracts,
|
|
3
|
+
* awards, and salary awards with funder names, grant numbers, and funding periods.
|
|
4
|
+
* @module mcp-server/tools/definitions/get-funding.tool
|
|
5
|
+
*/
|
|
6
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
7
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
8
|
+
export declare const orcidGetFunding: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
9
|
+
orcid_id: z.ZodString;
|
|
10
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
11
|
+
orcidId: z.ZodString;
|
|
12
|
+
orcidUri: z.ZodString;
|
|
13
|
+
fundingCount: z.ZodNumber;
|
|
14
|
+
funding: z.ZodArray<z.ZodObject<{
|
|
15
|
+
title: z.ZodOptional<z.ZodString>;
|
|
16
|
+
type: z.ZodOptional<z.ZodString>;
|
|
17
|
+
funder: z.ZodOptional<z.ZodObject<{
|
|
18
|
+
name: z.ZodOptional<z.ZodString>;
|
|
19
|
+
city: z.ZodOptional<z.ZodString>;
|
|
20
|
+
country: z.ZodOptional<z.ZodString>;
|
|
21
|
+
disambiguatedId: z.ZodOptional<z.ZodString>;
|
|
22
|
+
disambiguationSource: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.core.$strip>>;
|
|
24
|
+
startDate: z.ZodOptional<z.ZodString>;
|
|
25
|
+
endDate: z.ZodOptional<z.ZodString>;
|
|
26
|
+
grantNumbers: z.ZodArray<z.ZodString>;
|
|
27
|
+
url: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}, z.core.$strip>>;
|
|
29
|
+
notice: z.ZodOptional<z.ZodString>;
|
|
30
|
+
}, z.core.$strip>, readonly [{
|
|
31
|
+
readonly reason: "profile_not_found";
|
|
32
|
+
readonly code: JsonRpcErrorCode.NotFound;
|
|
33
|
+
readonly when: "The ORCID iD does not correspond to a registered researcher.";
|
|
34
|
+
readonly recovery: "Verify the ORCID iD is correct and try orcid_search_researchers to find valid iDs.";
|
|
35
|
+
}]>;
|
|
36
|
+
//# sourceMappingURL=get-funding.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-funding.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-funding.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAY,MAAM,+BAA+B,CAAC;AAI3E,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0J1B,CAAC"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Fetch funding records for a researcher from ORCID: grants, contracts,
|
|
3
|
+
* awards, and salary awards with funder names, grant numbers, and funding periods.
|
|
4
|
+
* @module mcp-server/tools/definitions/get-funding.tool
|
|
5
|
+
*/
|
|
6
|
+
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
7
|
+
import { JsonRpcErrorCode, McpError } from '@cyanheads/mcp-ts-core/errors';
|
|
8
|
+
import { getOrcidService, normalizeOrcidId } from '../../../services/orcid/orcid-service.js';
|
|
9
|
+
export const orcidGetFunding = tool('orcid_get_funding', {
|
|
10
|
+
title: 'Get ORCID Researcher Funding',
|
|
11
|
+
description: 'Fetch funding records for an ORCID researcher: grants, contracts, awards, and salary awards. Returns funder names, funder organization identifiers, grant numbers, and funding periods. Funding data is entirely self-reported — most researchers do not enter funding even when they have grants. Absence of funding records does not imply absence of funding. When records exist they are high-value for grant tracking and funder analysis.',
|
|
12
|
+
annotations: { readOnlyHint: true, openWorldHint: false, idempotentHint: true },
|
|
13
|
+
input: z.object({
|
|
14
|
+
orcid_id: z
|
|
15
|
+
.string()
|
|
16
|
+
.regex(/^(https?:\/\/orcid\.org\/)?\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/, 'Must be a valid ORCID iD (e.g. 0000-0001-2345-6789) or full ORCID URI.')
|
|
17
|
+
.describe('ORCID iD — bare format (0000-0001-2345-6789) or full URI (https://orcid.org/0000-0001-2345-6789).'),
|
|
18
|
+
}),
|
|
19
|
+
output: z.object({
|
|
20
|
+
orcidId: z.string().describe('Normalized ORCID iD (bare format).'),
|
|
21
|
+
orcidUri: z.string().describe('Full ORCID URI.'),
|
|
22
|
+
fundingCount: z.number().describe('Total number of funding records returned.'),
|
|
23
|
+
funding: z
|
|
24
|
+
.array(z
|
|
25
|
+
.object({
|
|
26
|
+
title: z.string().optional().describe('Funding title or project name.'),
|
|
27
|
+
type: z
|
|
28
|
+
.string()
|
|
29
|
+
.optional()
|
|
30
|
+
.describe('Funding type (e.g. grant, contract, award, salary-award).'),
|
|
31
|
+
funder: z
|
|
32
|
+
.object({
|
|
33
|
+
name: z.string().optional().describe('Funder organization name.'),
|
|
34
|
+
city: z.string().optional().describe('Funder city.'),
|
|
35
|
+
country: z.string().optional().describe('Funder country.'),
|
|
36
|
+
disambiguatedId: z
|
|
37
|
+
.string()
|
|
38
|
+
.optional()
|
|
39
|
+
.describe('Disambiguated funder identifier (e.g. Crossref Funder ID URL or ROR URL).'),
|
|
40
|
+
disambiguationSource: z
|
|
41
|
+
.string()
|
|
42
|
+
.optional()
|
|
43
|
+
.describe('Source of funder disambiguation (FUNDREF, ROR, GRID, etc.).'),
|
|
44
|
+
})
|
|
45
|
+
.optional()
|
|
46
|
+
.describe('Funder organization details.'),
|
|
47
|
+
startDate: z
|
|
48
|
+
.string()
|
|
49
|
+
.optional()
|
|
50
|
+
.describe('Funding start date (YYYY, YYYY-MM, or YYYY-MM-DD).'),
|
|
51
|
+
endDate: z
|
|
52
|
+
.string()
|
|
53
|
+
.optional()
|
|
54
|
+
.describe('Funding end date (YYYY, YYYY-MM, or YYYY-MM-DD).'),
|
|
55
|
+
grantNumbers: z
|
|
56
|
+
.array(z.string().describe('Grant or award number.'))
|
|
57
|
+
.describe('Grant numbers or award identifiers for this funding record.'),
|
|
58
|
+
url: z.string().optional().describe('URL for the funding record, if available.'),
|
|
59
|
+
})
|
|
60
|
+
.describe('Funding record.'))
|
|
61
|
+
.describe('Funding records associated with this ORCID iD.'),
|
|
62
|
+
notice: z
|
|
63
|
+
.string()
|
|
64
|
+
.optional()
|
|
65
|
+
.describe('Note when no funding is found — absence of records does not mean absence of funding.'),
|
|
66
|
+
}),
|
|
67
|
+
errors: [
|
|
68
|
+
{
|
|
69
|
+
reason: 'profile_not_found',
|
|
70
|
+
code: JsonRpcErrorCode.NotFound,
|
|
71
|
+
when: 'The ORCID iD does not correspond to a registered researcher.',
|
|
72
|
+
recovery: 'Verify the ORCID iD is correct and try orcid_search_researchers to find valid iDs.',
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
async handler(input, ctx) {
|
|
76
|
+
const service = getOrcidService();
|
|
77
|
+
ctx.log.info('orcid_get_funding', { orcidId: input.orcid_id });
|
|
78
|
+
let records;
|
|
79
|
+
try {
|
|
80
|
+
records = await service.getFundings(input.orcid_id, ctx);
|
|
81
|
+
}
|
|
82
|
+
catch (err) {
|
|
83
|
+
if (err instanceof McpError && err.code === JsonRpcErrorCode.NotFound) {
|
|
84
|
+
throw ctx.fail('profile_not_found', `ORCID iD ${normalizeOrcidId(input.orcid_id)} not found`);
|
|
85
|
+
}
|
|
86
|
+
throw err;
|
|
87
|
+
}
|
|
88
|
+
const bareId = normalizeOrcidId(input.orcid_id);
|
|
89
|
+
ctx.log.info('orcid_get_funding completed', { orcidId: bareId, fundingCount: records.length });
|
|
90
|
+
const notice = records.length === 0
|
|
91
|
+
? 'No funding records found. ORCID funding data is self-reported and most researchers do not enter funding details. Absence does not imply no funding.'
|
|
92
|
+
: undefined;
|
|
93
|
+
return {
|
|
94
|
+
orcidId: bareId,
|
|
95
|
+
orcidUri: `https://orcid.org/${bareId}`,
|
|
96
|
+
fundingCount: records.length,
|
|
97
|
+
funding: records,
|
|
98
|
+
...(notice && { notice }),
|
|
99
|
+
};
|
|
100
|
+
},
|
|
101
|
+
format: (result) => {
|
|
102
|
+
const lines = [
|
|
103
|
+
`## Funding for ORCID ${result.orcidId}`,
|
|
104
|
+
`**URI:** ${result.orcidUri}`,
|
|
105
|
+
`**Total Funding Records:** ${result.fundingCount}`,
|
|
106
|
+
];
|
|
107
|
+
if (result.notice) {
|
|
108
|
+
lines.push('', `> ${result.notice}`);
|
|
109
|
+
}
|
|
110
|
+
if (result.funding.length === 0) {
|
|
111
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
112
|
+
}
|
|
113
|
+
lines.push('');
|
|
114
|
+
for (const f of result.funding) {
|
|
115
|
+
const title = f.title ?? '(untitled funding)';
|
|
116
|
+
lines.push(`### ${title}`);
|
|
117
|
+
if (f.type)
|
|
118
|
+
lines.push(`**Type:** ${f.type}`);
|
|
119
|
+
if (f.funder?.name)
|
|
120
|
+
lines.push(`**Funder:** ${f.funder.name}`);
|
|
121
|
+
if (f.funder?.city)
|
|
122
|
+
lines.push(`**Funder City:** ${f.funder.city}`);
|
|
123
|
+
if (f.funder?.country)
|
|
124
|
+
lines.push(`**Funder Country:** ${f.funder.country}`);
|
|
125
|
+
if (f.funder?.disambiguatedId) {
|
|
126
|
+
lines.push(`**Funder ID:** ${f.funder.disambiguatedId} (${f.funder.disambiguationSource ?? 'unknown source'})`);
|
|
127
|
+
}
|
|
128
|
+
if (f.grantNumbers.length)
|
|
129
|
+
lines.push(`**Grant Numbers:** ${f.grantNumbers.join(', ')}`);
|
|
130
|
+
const dateRange = [f.startDate, f.endDate].filter(Boolean).join(' – ');
|
|
131
|
+
if (dateRange)
|
|
132
|
+
lines.push(`**Period:** ${dateRange}`);
|
|
133
|
+
if (f.url)
|
|
134
|
+
lines.push(`**URL:** ${f.url}`);
|
|
135
|
+
lines.push('');
|
|
136
|
+
}
|
|
137
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
//# sourceMappingURL=get-funding.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-funding.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-funding.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAGtF,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,mBAAmB,EAAE;IACvD,KAAK,EAAE,8BAA8B;IACrC,WAAW,EACT,ibAAib;IACnb,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE;IAE/E,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,KAAK,CACJ,0DAA0D,EAC1D,wEAAwE,CACzE;aACA,QAAQ,CACP,mGAAmG,CACpG;KACJ,CAAC;IAEF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;QAClE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;QACh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AAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Fetch peer review activity records for an ORCID researcher:
|
|
3
|
+
* convening organizations, reviewer roles, review types, and ISSN-keyed groups.
|
|
4
|
+
* @module mcp-server/tools/definitions/get-peer-reviews.tool
|
|
5
|
+
*/
|
|
6
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
7
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
8
|
+
export declare const orcidGetPeerReviews: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
9
|
+
orcid_id: z.ZodString;
|
|
10
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
11
|
+
orcidId: z.ZodString;
|
|
12
|
+
orcidUri: z.ZodString;
|
|
13
|
+
reviewCount: z.ZodNumber;
|
|
14
|
+
peerReviews: z.ZodArray<z.ZodObject<{
|
|
15
|
+
reviewerRole: z.ZodOptional<z.ZodString>;
|
|
16
|
+
reviewType: z.ZodOptional<z.ZodString>;
|
|
17
|
+
completionDate: z.ZodOptional<z.ZodString>;
|
|
18
|
+
conveningOrganization: z.ZodOptional<z.ZodObject<{
|
|
19
|
+
name: z.ZodOptional<z.ZodString>;
|
|
20
|
+
city: z.ZodOptional<z.ZodString>;
|
|
21
|
+
country: z.ZodOptional<z.ZodString>;
|
|
22
|
+
disambiguatedId: z.ZodOptional<z.ZodString>;
|
|
23
|
+
disambiguationSource: z.ZodOptional<z.ZodString>;
|
|
24
|
+
}, z.core.$strip>>;
|
|
25
|
+
reviewUrl: z.ZodOptional<z.ZodString>;
|
|
26
|
+
groupIssn: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, z.core.$strip>>;
|
|
28
|
+
notice: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}, z.core.$strip>, readonly [{
|
|
30
|
+
readonly reason: "profile_not_found";
|
|
31
|
+
readonly code: JsonRpcErrorCode.NotFound;
|
|
32
|
+
readonly when: "The ORCID iD does not correspond to a registered researcher.";
|
|
33
|
+
readonly recovery: "Verify the ORCID iD is correct and try orcid_search_researchers to find valid iDs.";
|
|
34
|
+
}]>;
|
|
35
|
+
//# sourceMappingURL=get-peer-reviews.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-peer-reviews.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-peer-reviews.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAY,MAAM,+BAA+B,CAAC;AAI3E,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;GAkK9B,CAAC"}
|