@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,146 @@
|
|
|
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 { 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 orcidGetPeerReviews = tool('orcid_get_peer_reviews', {
|
|
10
|
+
title: 'Get ORCID Researcher Peer Reviews',
|
|
11
|
+
description: "Fetch peer review activity for an ORCID researcher: convening organizations (journals and publishers), reviewer role (reviewer, editor, chair, etc.), review type, completion dates, and ISSN-keyed group identifiers. Use to assess editorial activity, journal affiliations, and the scope of a researcher's peer review contributions. Peer review records are self-reported or imported by participating publishers — coverage varies by researcher.",
|
|
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
|
+
reviewCount: z.number().describe('Total number of peer review records returned.'),
|
|
23
|
+
peerReviews: z
|
|
24
|
+
.array(z
|
|
25
|
+
.object({
|
|
26
|
+
reviewerRole: z
|
|
27
|
+
.string()
|
|
28
|
+
.optional()
|
|
29
|
+
.describe('Reviewer role (e.g. reviewer, editor, chair, organizer, co-investigator, co-reviewer).'),
|
|
30
|
+
reviewType: z
|
|
31
|
+
.string()
|
|
32
|
+
.optional()
|
|
33
|
+
.describe('Review type (e.g. review, evaluation, grant-review, editor-report).'),
|
|
34
|
+
completionDate: z
|
|
35
|
+
.string()
|
|
36
|
+
.optional()
|
|
37
|
+
.describe('Completion date of the review (YYYY, YYYY-MM, or YYYY-MM-DD).'),
|
|
38
|
+
conveningOrganization: z
|
|
39
|
+
.object({
|
|
40
|
+
name: z
|
|
41
|
+
.string()
|
|
42
|
+
.optional()
|
|
43
|
+
.describe('Convening organization name (journal or publisher).'),
|
|
44
|
+
city: z.string().optional().describe('Convening organization city.'),
|
|
45
|
+
country: z.string().optional().describe('Convening organization country.'),
|
|
46
|
+
disambiguatedId: z
|
|
47
|
+
.string()
|
|
48
|
+
.optional()
|
|
49
|
+
.describe('Disambiguated organization identifier.'),
|
|
50
|
+
disambiguationSource: z
|
|
51
|
+
.string()
|
|
52
|
+
.optional()
|
|
53
|
+
.describe('Source of disambiguation (ROR, GRID, RINGGOLD, etc.).'),
|
|
54
|
+
})
|
|
55
|
+
.optional()
|
|
56
|
+
.describe('Journal or publisher that convened the review.'),
|
|
57
|
+
reviewUrl: z.string().optional().describe('URL for the review record, if available.'),
|
|
58
|
+
groupIssn: z
|
|
59
|
+
.string()
|
|
60
|
+
.optional()
|
|
61
|
+
.describe('ISSN of the journal group this review belongs to, if available.'),
|
|
62
|
+
})
|
|
63
|
+
.describe('Peer review record.'))
|
|
64
|
+
.describe('Peer review records for this ORCID iD.'),
|
|
65
|
+
notice: z
|
|
66
|
+
.string()
|
|
67
|
+
.optional()
|
|
68
|
+
.describe('Note when no peer reviews are found — coverage varies by researcher and publisher participation.'),
|
|
69
|
+
}),
|
|
70
|
+
errors: [
|
|
71
|
+
{
|
|
72
|
+
reason: 'profile_not_found',
|
|
73
|
+
code: JsonRpcErrorCode.NotFound,
|
|
74
|
+
when: 'The ORCID iD does not correspond to a registered researcher.',
|
|
75
|
+
recovery: 'Verify the ORCID iD is correct and try orcid_search_researchers to find valid iDs.',
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
async handler(input, ctx) {
|
|
79
|
+
const service = getOrcidService();
|
|
80
|
+
ctx.log.info('orcid_get_peer_reviews', { orcidId: input.orcid_id });
|
|
81
|
+
let reviews;
|
|
82
|
+
try {
|
|
83
|
+
reviews = await service.getPeerReviews(input.orcid_id, ctx);
|
|
84
|
+
}
|
|
85
|
+
catch (err) {
|
|
86
|
+
if (err instanceof McpError && err.code === JsonRpcErrorCode.NotFound) {
|
|
87
|
+
throw ctx.fail('profile_not_found', `ORCID iD ${normalizeOrcidId(input.orcid_id)} not found`);
|
|
88
|
+
}
|
|
89
|
+
throw err;
|
|
90
|
+
}
|
|
91
|
+
const bareId = normalizeOrcidId(input.orcid_id);
|
|
92
|
+
ctx.log.info('orcid_get_peer_reviews completed', {
|
|
93
|
+
orcidId: bareId,
|
|
94
|
+
reviewCount: reviews.length,
|
|
95
|
+
});
|
|
96
|
+
const notice = reviews.length === 0
|
|
97
|
+
? 'No peer review records found. Coverage depends on researcher self-reporting and publisher participation in ORCID peer review import.'
|
|
98
|
+
: undefined;
|
|
99
|
+
return {
|
|
100
|
+
orcidId: bareId,
|
|
101
|
+
orcidUri: `https://orcid.org/${bareId}`,
|
|
102
|
+
reviewCount: reviews.length,
|
|
103
|
+
peerReviews: reviews,
|
|
104
|
+
...(notice && { notice }),
|
|
105
|
+
};
|
|
106
|
+
},
|
|
107
|
+
format: (result) => {
|
|
108
|
+
const lines = [
|
|
109
|
+
`## Peer Reviews for ORCID ${result.orcidId}`,
|
|
110
|
+
`**URI:** ${result.orcidUri}`,
|
|
111
|
+
`**Total Reviews:** ${result.reviewCount}`,
|
|
112
|
+
];
|
|
113
|
+
if (result.notice) {
|
|
114
|
+
lines.push('', `> ${result.notice}`);
|
|
115
|
+
}
|
|
116
|
+
if (result.peerReviews.length === 0) {
|
|
117
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
118
|
+
}
|
|
119
|
+
lines.push('');
|
|
120
|
+
for (const r of result.peerReviews) {
|
|
121
|
+
const orgName = r.conveningOrganization?.name ?? 'Unknown organization';
|
|
122
|
+
lines.push(`### ${orgName}`);
|
|
123
|
+
if (r.reviewerRole)
|
|
124
|
+
lines.push(`**Role:** ${r.reviewerRole}`);
|
|
125
|
+
if (r.reviewType)
|
|
126
|
+
lines.push(`**Type:** ${r.reviewType}`);
|
|
127
|
+
if (r.completionDate)
|
|
128
|
+
lines.push(`**Completed:** ${r.completionDate}`);
|
|
129
|
+
if (r.groupIssn)
|
|
130
|
+
lines.push(`**Journal ISSN:** ${r.groupIssn}`);
|
|
131
|
+
if (r.reviewUrl)
|
|
132
|
+
lines.push(`**URL:** ${r.reviewUrl}`);
|
|
133
|
+
// Render all conveningOrganization sub-fields for format parity
|
|
134
|
+
if (r.conveningOrganization?.city)
|
|
135
|
+
lines.push(`**Org City:** ${r.conveningOrganization.city}`);
|
|
136
|
+
if (r.conveningOrganization?.country)
|
|
137
|
+
lines.push(`**Org Country:** ${r.conveningOrganization.country}`);
|
|
138
|
+
if (r.conveningOrganization?.disambiguatedId) {
|
|
139
|
+
lines.push(`**Org ID:** ${r.conveningOrganization.disambiguatedId} (${r.conveningOrganization.disambiguationSource ?? 'unknown source'})`);
|
|
140
|
+
}
|
|
141
|
+
lines.push('');
|
|
142
|
+
}
|
|
143
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
//# sourceMappingURL=get-peer-reviews.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-peer-reviews.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-peer-reviews.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,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EAAE,OAAO;gBAClC,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,qBAAqB,CAAC,OAAO,EAAE,CAAC,CAAC;YACpE,IAAI,CAAC,CAAC,qBAAqB,EAAE,eAAe,EAAE,CAAC;gBAC7C,KAAK,CAAC,IAAI,CACR,eAAe,CAAC,CAAC,qBAAqB,CAAC,eAAe,KAAK,CAAC,CAAC,qBAAqB,CAAC,oBAAoB,IAAI,gBAAgB,GAAG,CAC/H,CAAC;YACJ,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,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,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Fetch a researcher's public profile from ORCID: name, biography,
|
|
3
|
+
* keywords, researcher URLs, and external identifiers (Scopus ID, ResearcherID, etc.).
|
|
4
|
+
* @module mcp-server/tools/definitions/get-profile.tool
|
|
5
|
+
*/
|
|
6
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
7
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
8
|
+
export declare const orcidGetProfile: 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
|
+
givenNames: z.ZodOptional<z.ZodString>;
|
|
14
|
+
familyName: z.ZodOptional<z.ZodString>;
|
|
15
|
+
creditName: z.ZodOptional<z.ZodString>;
|
|
16
|
+
biography: z.ZodOptional<z.ZodString>;
|
|
17
|
+
keywords: z.ZodArray<z.ZodString>;
|
|
18
|
+
researcherUrls: z.ZodArray<z.ZodObject<{
|
|
19
|
+
name: z.ZodOptional<z.ZodString>;
|
|
20
|
+
url: z.ZodString;
|
|
21
|
+
}, z.core.$strip>>;
|
|
22
|
+
externalIdentifiers: z.ZodArray<z.ZodObject<{
|
|
23
|
+
type: z.ZodString;
|
|
24
|
+
value: z.ZodString;
|
|
25
|
+
url: z.ZodOptional<z.ZodString>;
|
|
26
|
+
relationship: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, z.core.$strip>>;
|
|
28
|
+
emails: z.ZodArray<z.ZodObject<{
|
|
29
|
+
email: z.ZodString;
|
|
30
|
+
primary: z.ZodOptional<z.ZodBoolean>;
|
|
31
|
+
}, z.core.$strip>>;
|
|
32
|
+
countries: z.ZodArray<z.ZodString>;
|
|
33
|
+
}, z.core.$strip>, readonly [{
|
|
34
|
+
readonly reason: "profile_not_found";
|
|
35
|
+
readonly code: JsonRpcErrorCode.NotFound;
|
|
36
|
+
readonly when: "The ORCID iD does not correspond to a registered researcher.";
|
|
37
|
+
readonly recovery: "Verify the ORCID iD is correct and try orcid_search_researchers to find valid iDs.";
|
|
38
|
+
}]>;
|
|
39
|
+
//# sourceMappingURL=get-profile.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-profile.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-profile.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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuK1B,CAAC"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Fetch a researcher's public profile from ORCID: name, biography,
|
|
3
|
+
* keywords, researcher URLs, and external identifiers (Scopus ID, ResearcherID, etc.).
|
|
4
|
+
* @module mcp-server/tools/definitions/get-profile.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 orcidGetProfile = tool('orcid_get_profile', {
|
|
10
|
+
title: 'Get ORCID Researcher Profile',
|
|
11
|
+
description: "Fetch a researcher's public profile from ORCID: name, biography, keywords, researcher URLs, and external identifiers such as Scopus Author ID, ResearcherID, and Loop profile. This is the entry point for building a researcher dossier. Pass a bare ORCID iD (0000-0001-2345-6789) or a full URI (https://orcid.org/0000-0001-2345-6789). The profile contains only publicly visible data — researchers control visibility per field.",
|
|
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 without URI prefix).'),
|
|
21
|
+
orcidUri: z.string().describe('Full ORCID URI (https://orcid.org/{id}).'),
|
|
22
|
+
givenNames: z.string().optional().describe('Given (first) name, if publicly visible.'),
|
|
23
|
+
familyName: z.string().optional().describe('Family (last) name, if publicly visible.'),
|
|
24
|
+
creditName: z.string().optional().describe('Published credit name, if set.'),
|
|
25
|
+
biography: z.string().optional().describe('Researcher biography, if publicly visible.'),
|
|
26
|
+
keywords: z
|
|
27
|
+
.array(z.string().describe('Keyword term.'))
|
|
28
|
+
.describe('Research keywords set by the researcher.'),
|
|
29
|
+
researcherUrls: z
|
|
30
|
+
.array(z
|
|
31
|
+
.object({
|
|
32
|
+
name: z.string().optional().describe('Label for this URL.'),
|
|
33
|
+
url: z.string().describe('URL value.'),
|
|
34
|
+
})
|
|
35
|
+
.describe('Researcher URL entry.'))
|
|
36
|
+
.describe('Researcher-provided URLs (personal site, lab page, blog, etc.).'),
|
|
37
|
+
externalIdentifiers: z
|
|
38
|
+
.array(z
|
|
39
|
+
.object({
|
|
40
|
+
type: z
|
|
41
|
+
.string()
|
|
42
|
+
.describe('Identifier type (e.g. Scopus Author ID, ResearcherID, Loop).'),
|
|
43
|
+
value: z.string().describe('Identifier value.'),
|
|
44
|
+
url: z.string().optional().describe('Resolver URL for this identifier, if provided.'),
|
|
45
|
+
relationship: z.string().optional().describe('Relationship type (self or part-of).'),
|
|
46
|
+
})
|
|
47
|
+
.describe('External identifier linking to another scholarly system.'))
|
|
48
|
+
.describe('External identifiers from scholarly systems (Scopus, Web of Science, Loop, etc.).'),
|
|
49
|
+
emails: z
|
|
50
|
+
.array(z
|
|
51
|
+
.object({
|
|
52
|
+
email: z.string().describe('Email address.'),
|
|
53
|
+
primary: z
|
|
54
|
+
.boolean()
|
|
55
|
+
.optional()
|
|
56
|
+
.describe('True when this is the primary email address.'),
|
|
57
|
+
})
|
|
58
|
+
.describe('Email address entry.'))
|
|
59
|
+
.describe('Publicly visible email addresses.'),
|
|
60
|
+
countries: z
|
|
61
|
+
.array(z.string().describe('ISO 3166-1 alpha-2 country code.'))
|
|
62
|
+
.describe("Countries listed in the researcher's address section."),
|
|
63
|
+
}),
|
|
64
|
+
errors: [
|
|
65
|
+
{
|
|
66
|
+
reason: 'profile_not_found',
|
|
67
|
+
code: JsonRpcErrorCode.NotFound,
|
|
68
|
+
when: 'The ORCID iD does not correspond to a registered researcher.',
|
|
69
|
+
recovery: 'Verify the ORCID iD is correct and try orcid_search_researchers to find valid iDs.',
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
async handler(input, ctx) {
|
|
73
|
+
const service = getOrcidService();
|
|
74
|
+
ctx.log.info('orcid_get_profile', { orcidId: input.orcid_id });
|
|
75
|
+
let person;
|
|
76
|
+
try {
|
|
77
|
+
person = await service.getPerson(input.orcid_id, ctx);
|
|
78
|
+
}
|
|
79
|
+
catch (err) {
|
|
80
|
+
if (err instanceof McpError && err.code === JsonRpcErrorCode.NotFound) {
|
|
81
|
+
throw ctx.fail('profile_not_found', `ORCID iD ${normalizeOrcidId(input.orcid_id)} not found`);
|
|
82
|
+
}
|
|
83
|
+
throw err;
|
|
84
|
+
}
|
|
85
|
+
const bareId = normalizeOrcidId(input.orcid_id);
|
|
86
|
+
ctx.log.info('orcid_get_profile completed', {
|
|
87
|
+
orcidId: bareId,
|
|
88
|
+
hasName: !!(person.givenNames || person.familyName),
|
|
89
|
+
keywordCount: person.keywords.length,
|
|
90
|
+
externalIdCount: person.externalIdentifiers.length,
|
|
91
|
+
});
|
|
92
|
+
return {
|
|
93
|
+
orcidId: bareId,
|
|
94
|
+
orcidUri: `https://orcid.org/${bareId}`,
|
|
95
|
+
...(person.givenNames && { givenNames: person.givenNames }),
|
|
96
|
+
...(person.familyName && { familyName: person.familyName }),
|
|
97
|
+
...(person.creditName && { creditName: person.creditName }),
|
|
98
|
+
...(person.biography && { biography: person.biography }),
|
|
99
|
+
keywords: person.keywords,
|
|
100
|
+
researcherUrls: person.researcherUrls,
|
|
101
|
+
externalIdentifiers: person.externalIdentifiers,
|
|
102
|
+
emails: person.emails,
|
|
103
|
+
countries: person.countries,
|
|
104
|
+
};
|
|
105
|
+
},
|
|
106
|
+
format: (result) => {
|
|
107
|
+
const lines = [`## ORCID Profile: ${result.orcidId}`];
|
|
108
|
+
const nameParts = [result.givenNames, result.familyName].filter(Boolean);
|
|
109
|
+
if (nameParts.length)
|
|
110
|
+
lines.push(`**Name:** ${nameParts.join(' ')}`);
|
|
111
|
+
if (result.creditName)
|
|
112
|
+
lines.push(`**Credit Name:** ${result.creditName}`);
|
|
113
|
+
lines.push(`**ORCID URI:** ${result.orcidUri}`);
|
|
114
|
+
if (result.biography) {
|
|
115
|
+
lines.push('', '### Biography', result.biography);
|
|
116
|
+
}
|
|
117
|
+
if (result.keywords.length) {
|
|
118
|
+
lines.push('', `**Keywords:** ${result.keywords.join(', ')}`);
|
|
119
|
+
}
|
|
120
|
+
if (result.externalIdentifiers.length) {
|
|
121
|
+
lines.push('', '### External Identifiers');
|
|
122
|
+
for (const id of result.externalIdentifiers) {
|
|
123
|
+
const rel = id.relationship ? ` [${id.relationship}]` : '';
|
|
124
|
+
const line = `- **${id.type}:** ${id.value}${id.url ? ` (${id.url})` : ''}${rel}`;
|
|
125
|
+
lines.push(line);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (result.researcherUrls.length) {
|
|
129
|
+
lines.push('', '### Researcher URLs');
|
|
130
|
+
for (const ru of result.researcherUrls) {
|
|
131
|
+
lines.push(`- ${ru.name ? `**${ru.name}:** ` : ''}${ru.url}`);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (result.emails.length) {
|
|
135
|
+
lines.push('', '### Emails');
|
|
136
|
+
for (const e of result.emails) {
|
|
137
|
+
lines.push(`- ${e.email}${e.primary ? ' (primary)' : ''}`);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
if (result.countries.length) {
|
|
141
|
+
lines.push('', `**Countries:** ${result.countries.join(', ')}`);
|
|
142
|
+
}
|
|
143
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
//# sourceMappingURL=get-profile.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-profile.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-profile.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE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EAAE,YAAY,CAAC,CAAC;YAC7B,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;gBAC9B,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC7D,CAAC;QACH,CAAC;QAED,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;YAC5B,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,kBAAkB,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAClE,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,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Retrieve works (publications, datasets, software, preprints, etc.)
|
|
3
|
+
* associated with an ORCID iD. Returns titles, types, dates, journal names, and
|
|
4
|
+
* external identifiers ready for chaining to Crossref, PubMed, or arXiv.
|
|
5
|
+
* @module mcp-server/tools/definitions/get-works.tool
|
|
6
|
+
*/
|
|
7
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
8
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
9
|
+
export declare const orcidGetWorks: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
10
|
+
orcid_id: z.ZodString;
|
|
11
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
12
|
+
orcidId: z.ZodString;
|
|
13
|
+
orcidUri: z.ZodString;
|
|
14
|
+
workCount: z.ZodNumber;
|
|
15
|
+
works: z.ZodArray<z.ZodObject<{
|
|
16
|
+
title: z.ZodOptional<z.ZodString>;
|
|
17
|
+
workType: z.ZodOptional<z.ZodString>;
|
|
18
|
+
publicationDate: z.ZodOptional<z.ZodString>;
|
|
19
|
+
journalTitle: z.ZodOptional<z.ZodString>;
|
|
20
|
+
url: z.ZodOptional<z.ZodString>;
|
|
21
|
+
externalIds: z.ZodArray<z.ZodObject<{
|
|
22
|
+
type: z.ZodString;
|
|
23
|
+
value: z.ZodString;
|
|
24
|
+
url: z.ZodOptional<z.ZodString>;
|
|
25
|
+
relationship: z.ZodOptional<z.ZodString>;
|
|
26
|
+
}, z.core.$strip>>;
|
|
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-works.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-works.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-works.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAY,MAAM,+BAA+B,CAAC;AAa3E,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;GAmIxB,CAAC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Retrieve works (publications, datasets, software, preprints, etc.)
|
|
3
|
+
* associated with an ORCID iD. Returns titles, types, dates, journal names, and
|
|
4
|
+
* external identifiers ready for chaining to Crossref, PubMed, or arXiv.
|
|
5
|
+
* @module mcp-server/tools/definitions/get-works.tool
|
|
6
|
+
*/
|
|
7
|
+
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
8
|
+
import { JsonRpcErrorCode, McpError } from '@cyanheads/mcp-ts-core/errors';
|
|
9
|
+
import { getOrcidService, normalizeOrcidId } from '../../../services/orcid/orcid-service.js';
|
|
10
|
+
const ExternalIdSchema = z
|
|
11
|
+
.object({
|
|
12
|
+
type: z.string().describe('Identifier type (e.g. doi, pmid, arxiv, isbn).'),
|
|
13
|
+
value: z.string().describe('Identifier value.'),
|
|
14
|
+
url: z.string().optional().describe('Resolver URL for this identifier, if available.'),
|
|
15
|
+
relationship: z.string().optional().describe('Relationship to the work (self or part-of).'),
|
|
16
|
+
})
|
|
17
|
+
.describe('External identifier for a work.');
|
|
18
|
+
export const orcidGetWorks = tool('orcid_get_works', {
|
|
19
|
+
title: 'Get ORCID Researcher Works',
|
|
20
|
+
description: 'Retrieve works associated with an ORCID iD — publications, datasets, software, preprints, and more. Returns work summaries with titles, types, publication dates, journal names, and all external identifiers (DOIs, PMIDs, arXiv IDs, ISBNs). External IDs are ready for chaining to Crossref, PubMed, or arXiv servers. The /works endpoint returns summaries only — pass DOIs to Crossref or PMIDs to PubMed to retrieve full metadata or abstracts. Works are self-reported; a researcher may not have linked all their publications.',
|
|
21
|
+
annotations: { readOnlyHint: true, openWorldHint: false, idempotentHint: true },
|
|
22
|
+
input: z.object({
|
|
23
|
+
orcid_id: z
|
|
24
|
+
.string()
|
|
25
|
+
.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.')
|
|
26
|
+
.describe('ORCID iD — bare format (0000-0001-2345-6789) or full URI (https://orcid.org/0000-0001-2345-6789).'),
|
|
27
|
+
}),
|
|
28
|
+
output: z.object({
|
|
29
|
+
orcidId: z.string().describe('Normalized ORCID iD (bare format).'),
|
|
30
|
+
orcidUri: z.string().describe('Full ORCID URI.'),
|
|
31
|
+
workCount: z.number().describe('Total number of works returned.'),
|
|
32
|
+
works: z
|
|
33
|
+
.array(z
|
|
34
|
+
.object({
|
|
35
|
+
title: z.string().optional().describe('Work title.'),
|
|
36
|
+
workType: z
|
|
37
|
+
.string()
|
|
38
|
+
.optional()
|
|
39
|
+
.describe('Work type (e.g. journal-article, dataset, software, preprint).'),
|
|
40
|
+
publicationDate: z
|
|
41
|
+
.string()
|
|
42
|
+
.optional()
|
|
43
|
+
.describe('Publication date (YYYY, YYYY-MM, or YYYY-MM-DD).'),
|
|
44
|
+
journalTitle: z.string().optional().describe('Journal or container title.'),
|
|
45
|
+
url: z.string().optional().describe('URL for the work, if available.'),
|
|
46
|
+
externalIds: z
|
|
47
|
+
.array(ExternalIdSchema)
|
|
48
|
+
.describe('External identifiers (DOIs, PMIDs, arXiv IDs, ISBNs, etc.).'),
|
|
49
|
+
})
|
|
50
|
+
.describe('Work summary record.'))
|
|
51
|
+
.describe('Works associated with this ORCID iD.'),
|
|
52
|
+
notice: z
|
|
53
|
+
.string()
|
|
54
|
+
.optional()
|
|
55
|
+
.describe('Note when the works list is empty — may indicate no self-reported works or private visibility settings.'),
|
|
56
|
+
}),
|
|
57
|
+
errors: [
|
|
58
|
+
{
|
|
59
|
+
reason: 'profile_not_found',
|
|
60
|
+
code: JsonRpcErrorCode.NotFound,
|
|
61
|
+
when: 'The ORCID iD does not correspond to a registered researcher.',
|
|
62
|
+
recovery: 'Verify the ORCID iD is correct and try orcid_search_researchers to find valid iDs.',
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
async handler(input, ctx) {
|
|
66
|
+
const service = getOrcidService();
|
|
67
|
+
ctx.log.info('orcid_get_works', { orcidId: input.orcid_id });
|
|
68
|
+
let works;
|
|
69
|
+
try {
|
|
70
|
+
works = await service.getWorks(input.orcid_id, ctx);
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
if (err instanceof McpError && err.code === JsonRpcErrorCode.NotFound) {
|
|
74
|
+
throw ctx.fail('profile_not_found', `ORCID iD ${normalizeOrcidId(input.orcid_id)} not found`);
|
|
75
|
+
}
|
|
76
|
+
throw err;
|
|
77
|
+
}
|
|
78
|
+
const bareId = normalizeOrcidId(input.orcid_id);
|
|
79
|
+
ctx.log.info('orcid_get_works completed', { orcidId: bareId, workCount: works.length });
|
|
80
|
+
const notice = works.length === 0
|
|
81
|
+
? 'No works found. The researcher may not have linked works to their ORCID record, or works may be set to private visibility.'
|
|
82
|
+
: undefined;
|
|
83
|
+
return {
|
|
84
|
+
orcidId: bareId,
|
|
85
|
+
orcidUri: `https://orcid.org/${bareId}`,
|
|
86
|
+
workCount: works.length,
|
|
87
|
+
works,
|
|
88
|
+
...(notice && { notice }),
|
|
89
|
+
};
|
|
90
|
+
},
|
|
91
|
+
format: (result) => {
|
|
92
|
+
const lines = [
|
|
93
|
+
`## Works for ORCID ${result.orcidId}`,
|
|
94
|
+
`**URI:** ${result.orcidUri}`,
|
|
95
|
+
`**Total Works:** ${result.workCount}`,
|
|
96
|
+
];
|
|
97
|
+
if (result.notice) {
|
|
98
|
+
lines.push('', `> ${result.notice}`);
|
|
99
|
+
}
|
|
100
|
+
if (result.works.length === 0) {
|
|
101
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
102
|
+
}
|
|
103
|
+
lines.push('');
|
|
104
|
+
for (const w of result.works) {
|
|
105
|
+
lines.push(`### ${w.title ?? '(untitled)'}`);
|
|
106
|
+
if (w.workType)
|
|
107
|
+
lines.push(`**Type:** ${w.workType}`);
|
|
108
|
+
if (w.publicationDate)
|
|
109
|
+
lines.push(`**Date:** ${w.publicationDate}`);
|
|
110
|
+
if (w.journalTitle)
|
|
111
|
+
lines.push(`**Journal:** ${w.journalTitle}`);
|
|
112
|
+
if (w.url)
|
|
113
|
+
lines.push(`**URL:** ${w.url}`);
|
|
114
|
+
if (w.externalIds.length) {
|
|
115
|
+
const idParts = w.externalIds.map((id) => {
|
|
116
|
+
const rel = id.relationship ? ` [${id.relationship}]` : '';
|
|
117
|
+
const urlPart = id.url ? ` (${id.url})` : '';
|
|
118
|
+
return `${id.type}:${id.value}${urlPart}${rel}`;
|
|
119
|
+
});
|
|
120
|
+
lines.push(`**IDs:** ${idParts.join(', ')}`);
|
|
121
|
+
}
|
|
122
|
+
lines.push('');
|
|
123
|
+
}
|
|
124
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
//# sourceMappingURL=get-works.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-works.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-works.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;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,gBAAgB,GAAG,CAAC;KACvB,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gDAAgD,CAAC;IAC3E,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IAC/C,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iDAAiD,CAAC;IACtF,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6CAA6C,CAAC;CAC5F,CAAC;KACD,QAAQ,CAAC,iCAAiC,CAAC,CAAC;AAE/C,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,iBAAiB,EAAE;IACnD,KAAK,EAAE,4BAA4B;IACnC,WAAW,EACT,2gBAA2gB;IAC7gB,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EA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AC,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;YAC3C,IAAI,CAAC,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;gBACzB,MAAM,OAAO,GAAG,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE;oBACvC,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;oBAC3D,MAAM,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;oBAC7C,OAAO,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,KAAK,GAAG,OAAO,GAAG,GAAG,EAAE,CAAC;gBAClD,CAAC,CAAC,CAAC;gBACH,KAAK,CAAC,IAAI,CAAC,YAAY,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAC/C,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,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,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Disambiguate an author name to a verified ORCID iD. Returns a
|
|
3
|
+
* ranked candidate list with transparent disambiguation signals: name match type,
|
|
4
|
+
* institution overlap, and anchor type (doi/pmid/none).
|
|
5
|
+
* @module mcp-server/tools/definitions/resolve-researcher.tool
|
|
6
|
+
*/
|
|
7
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
8
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
9
|
+
export declare const orcidResolveResearcher: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
10
|
+
name: z.ZodString;
|
|
11
|
+
affiliation: z.ZodOptional<z.ZodString>;
|
|
12
|
+
doi: z.ZodOptional<z.ZodString>;
|
|
13
|
+
pmid: z.ZodOptional<z.ZodString>;
|
|
14
|
+
rows: z.ZodDefault<z.ZodNumber>;
|
|
15
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
16
|
+
candidates: z.ZodArray<z.ZodObject<{
|
|
17
|
+
orcidId: z.ZodString;
|
|
18
|
+
orcidUri: z.ZodString;
|
|
19
|
+
givenNames: z.ZodOptional<z.ZodString>;
|
|
20
|
+
familyNames: z.ZodOptional<z.ZodString>;
|
|
21
|
+
creditName: z.ZodOptional<z.ZodString>;
|
|
22
|
+
institutionNames: z.ZodArray<z.ZodString>;
|
|
23
|
+
nameMatchType: z.ZodEnum<{
|
|
24
|
+
"other-name": "other-name";
|
|
25
|
+
none: "none";
|
|
26
|
+
exact: "exact";
|
|
27
|
+
partial: "partial";
|
|
28
|
+
}>;
|
|
29
|
+
institutionOverlap: z.ZodBoolean;
|
|
30
|
+
anchorType: z.ZodEnum<{
|
|
31
|
+
none: "none";
|
|
32
|
+
doi: "doi";
|
|
33
|
+
pmid: "pmid";
|
|
34
|
+
}>;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
queryUsed: z.ZodString;
|
|
37
|
+
relaxedQuery: z.ZodOptional<z.ZodString>;
|
|
38
|
+
totalFound: z.ZodNumber;
|
|
39
|
+
notice: z.ZodOptional<z.ZodString>;
|
|
40
|
+
}, z.core.$strip>, readonly [{
|
|
41
|
+
readonly reason: "no_candidates";
|
|
42
|
+
readonly code: JsonRpcErrorCode.NotFound;
|
|
43
|
+
readonly when: "No ORCID records matched even the relaxed query for this name.";
|
|
44
|
+
readonly recovery: "Try a different name spelling, use orcid_search_researchers with broader parameters, or verify the DOI/PMID is correct.";
|
|
45
|
+
}]>;
|
|
46
|
+
//# sourceMappingURL=resolve-researcher.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-researcher.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/resolve-researcher.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AA0DjE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6OjC,CAAC"}
|