@cyanheads/pubchem-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/LICENSE +190 -0
- package/README.md +198 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-bioactivity.tool.d.ts +33 -0
- package/dist/mcp-server/tools/definitions/get-bioactivity.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-bioactivity.tool.js +115 -0
- package/dist/mcp-server/tools/definitions/get-bioactivity.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-compound-details.tool.d.ts +22 -0
- package/dist/mcp-server/tools/definitions/get-compound-details.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-compound-details.tool.js +190 -0
- package/dist/mcp-server/tools/definitions/get-compound-details.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-compound-image.tool.d.ts +19 -0
- package/dist/mcp-server/tools/definitions/get-compound-image.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-compound-image.tool.js +57 -0
- package/dist/mcp-server/tools/definitions/get-compound-image.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-compound-safety.tool.d.ts +25 -0
- package/dist/mcp-server/tools/definitions/get-compound-safety.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-compound-safety.tool.js +94 -0
- package/dist/mcp-server/tools/definitions/get-compound-safety.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-compound-xrefs.tool.d.ts +21 -0
- package/dist/mcp-server/tools/definitions/get-compound-xrefs.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-compound-xrefs.tool.js +90 -0
- package/dist/mcp-server/tools/definitions/get-compound-xrefs.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-summary.tool.d.ts +23 -0
- package/dist/mcp-server/tools/definitions/get-summary.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-summary.tool.js +143 -0
- package/dist/mcp-server/tools/definitions/get-summary.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/index.d.ts +152 -0
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/index.js +23 -0
- package/dist/mcp-server/tools/definitions/index.js.map +1 -0
- package/dist/mcp-server/tools/definitions/search-assays.tool.d.ts +22 -0
- package/dist/mcp-server/tools/definitions/search-assays.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/search-assays.tool.js +76 -0
- package/dist/mcp-server/tools/definitions/search-assays.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/search-compounds.tool.d.ts +42 -0
- package/dist/mcp-server/tools/definitions/search-compounds.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/search-compounds.tool.js +204 -0
- package/dist/mcp-server/tools/definitions/search-compounds.tool.js.map +1 -0
- package/dist/services/pubchem/pubchem-client.d.ts +37 -0
- package/dist/services/pubchem/pubchem-client.d.ts.map +1 -0
- package/dist/services/pubchem/pubchem-client.js +546 -0
- package/dist/services/pubchem/pubchem-client.js.map +1 -0
- package/dist/services/pubchem/types.d.ts +133 -0
- package/dist/services/pubchem/types.d.ts.map +1 -0
- package/dist/services/pubchem/types.js +68 -0
- package/dist/services/pubchem/types.js.map +1 -0
- package/package.json +67 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Get detailed compound information: physicochemical properties,
|
|
3
|
+
* textual descriptions, and/or synonyms for one or more CIDs.
|
|
4
|
+
* @module mcp-server/tools/definitions/get-compound-details
|
|
5
|
+
*/
|
|
6
|
+
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
7
|
+
import { getPubChemClient } from '../../../services/pubchem/pubchem-client.js';
|
|
8
|
+
import { COMPOUND_PROPERTIES, DEFAULT_PROPERTIES } from '../../../services/pubchem/types.js';
|
|
9
|
+
const propertyEnum = z.enum(COMPOUND_PROPERTIES);
|
|
10
|
+
export const getCompoundDetails = tool('pubchem_get_compound_details', {
|
|
11
|
+
title: 'Get Compound Details',
|
|
12
|
+
description: 'Get detailed compound information by CID. Returns physicochemical properties ' +
|
|
13
|
+
'(molecular weight, SMILES, InChIKey, XLogP, TPSA, etc.), optionally with a textual ' +
|
|
14
|
+
'description (pharmacology, mechanism, therapeutic use) and/or all known synonyms. ' +
|
|
15
|
+
'Efficiently batches up to 100 CIDs in a single request.',
|
|
16
|
+
annotations: {
|
|
17
|
+
readOnlyHint: true,
|
|
18
|
+
destructiveHint: false,
|
|
19
|
+
idempotentHint: true,
|
|
20
|
+
openWorldHint: true,
|
|
21
|
+
},
|
|
22
|
+
input: z.object({
|
|
23
|
+
cids: z
|
|
24
|
+
.array(z.number().int().positive())
|
|
25
|
+
.min(1)
|
|
26
|
+
.max(100)
|
|
27
|
+
.describe('PubChem Compound IDs to fetch (1-100). Batched efficiently.'),
|
|
28
|
+
properties: z
|
|
29
|
+
.array(propertyEnum)
|
|
30
|
+
.optional()
|
|
31
|
+
.describe('Properties to retrieve. Defaults to a core set: MolecularFormula, MolecularWeight, ' +
|
|
32
|
+
'IUPACName, CanonicalSMILES, IsomericSMILES, InChIKey, XLogP, TPSA, HBondDonorCount, ' +
|
|
33
|
+
'HBondAcceptorCount, RotatableBondCount, HeavyAtomCount, Charge, Complexity.'),
|
|
34
|
+
includeDescription: z
|
|
35
|
+
.boolean()
|
|
36
|
+
.default(false)
|
|
37
|
+
.describe('Fetch textual description from PUG View (pharmacology, mechanism, therapeutic use). ' +
|
|
38
|
+
'Adds one API call per CID — consider limiting CID count when enabled.'),
|
|
39
|
+
includeSynonyms: z
|
|
40
|
+
.boolean()
|
|
41
|
+
.default(false)
|
|
42
|
+
.describe('Fetch all known names and synonyms (trade names, systematic names, registry numbers).'),
|
|
43
|
+
}),
|
|
44
|
+
output: z.object({
|
|
45
|
+
compounds: z
|
|
46
|
+
.array(z.object({
|
|
47
|
+
cid: z.number().describe('PubChem Compound ID.'),
|
|
48
|
+
properties: z
|
|
49
|
+
.record(z.string(), z.unknown())
|
|
50
|
+
.describe('Requested physicochemical properties.'),
|
|
51
|
+
description: z.string().optional().describe('Textual description from PUG View.'),
|
|
52
|
+
synonyms: z.array(z.string()).optional().describe('Known names and synonyms.'),
|
|
53
|
+
}))
|
|
54
|
+
.describe('Compound detail records.'),
|
|
55
|
+
}),
|
|
56
|
+
async handler(input, ctx) {
|
|
57
|
+
const client = getPubChemClient();
|
|
58
|
+
const props = input.properties ?? [...DEFAULT_PROPERTIES];
|
|
59
|
+
// Batch property fetch
|
|
60
|
+
const propertyRows = await client.getProperties(input.cids, props);
|
|
61
|
+
const propsMap = new Map(propertyRows.map((r) => [r.CID, r]));
|
|
62
|
+
// Optional: descriptions (per-CID, parallelized with concurrency limit)
|
|
63
|
+
let descMap;
|
|
64
|
+
if (input.includeDescription) {
|
|
65
|
+
const descCids = input.cids.slice(0, 10); // Cap at 10 to limit API calls
|
|
66
|
+
if (descCids.length < input.cids.length) {
|
|
67
|
+
ctx.log.info('Description fetch capped at 10 CIDs', {
|
|
68
|
+
requested: input.cids.length,
|
|
69
|
+
fetching: descCids.length,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
const entries = await Promise.all(descCids.map(async (cid) => {
|
|
73
|
+
const desc = await client.getDescription(cid);
|
|
74
|
+
return [cid, desc];
|
|
75
|
+
}));
|
|
76
|
+
descMap = new Map(entries.filter((e) => e[1] !== null));
|
|
77
|
+
}
|
|
78
|
+
// Optional: synonyms (per-CID)
|
|
79
|
+
let synMap;
|
|
80
|
+
if (input.includeSynonyms) {
|
|
81
|
+
const entries = await Promise.all(input.cids.map(async (cid) => {
|
|
82
|
+
const syns = await client.getSynonyms(cid);
|
|
83
|
+
return [cid, syns];
|
|
84
|
+
}));
|
|
85
|
+
synMap = new Map(entries.filter((e) => e[1].length > 0));
|
|
86
|
+
}
|
|
87
|
+
ctx.log.info('Details fetched', {
|
|
88
|
+
cids: input.cids.length,
|
|
89
|
+
withDescription: input.includeDescription,
|
|
90
|
+
withSynonyms: input.includeSynonyms,
|
|
91
|
+
});
|
|
92
|
+
const compounds = input.cids.map((cid) => {
|
|
93
|
+
const rawProps = propsMap.get(cid) ?? {};
|
|
94
|
+
const properties = { ...rawProps };
|
|
95
|
+
delete properties.CID;
|
|
96
|
+
const compound = { cid, properties };
|
|
97
|
+
const desc = descMap?.get(cid);
|
|
98
|
+
if (desc)
|
|
99
|
+
compound.description = desc;
|
|
100
|
+
const syns = synMap?.get(cid);
|
|
101
|
+
if (syns)
|
|
102
|
+
compound.synonyms = syns;
|
|
103
|
+
return compound;
|
|
104
|
+
});
|
|
105
|
+
return { compounds };
|
|
106
|
+
},
|
|
107
|
+
format(result) {
|
|
108
|
+
const blocks = [];
|
|
109
|
+
for (const c of result.compounds) {
|
|
110
|
+
const p = c.properties;
|
|
111
|
+
const name = p.IUPACName ?? p.Title ?? '';
|
|
112
|
+
const header = name ? `## CID ${c.cid} — ${name}` : `## CID ${c.cid}`;
|
|
113
|
+
blocks.push(header);
|
|
114
|
+
const lines = [];
|
|
115
|
+
// Key identifiers
|
|
116
|
+
if (p.MolecularFormula)
|
|
117
|
+
lines.push(`**Formula:** ${p.MolecularFormula}`);
|
|
118
|
+
const mw = p.MolecularWeight;
|
|
119
|
+
if (mw != null)
|
|
120
|
+
lines.push(`**MW:** ${mw} g/mol`);
|
|
121
|
+
if (p.CanonicalSMILES)
|
|
122
|
+
lines.push(`**SMILES:** ${p.CanonicalSMILES}`);
|
|
123
|
+
if (p.IsomericSMILES && p.IsomericSMILES !== p.CanonicalSMILES) {
|
|
124
|
+
lines.push(`**Isomeric SMILES:** ${p.IsomericSMILES}`);
|
|
125
|
+
}
|
|
126
|
+
if (p.InChIKey)
|
|
127
|
+
lines.push(`**InChIKey:** ${p.InChIKey}`);
|
|
128
|
+
// Drug-likeness properties
|
|
129
|
+
const drugProps = [];
|
|
130
|
+
if (p.XLogP != null)
|
|
131
|
+
drugProps.push(`XLogP: ${p.XLogP}`);
|
|
132
|
+
if (p.TPSA != null)
|
|
133
|
+
drugProps.push(`TPSA: ${p.TPSA}`);
|
|
134
|
+
if (p.Complexity != null)
|
|
135
|
+
drugProps.push(`Complexity: ${p.Complexity}`);
|
|
136
|
+
if (drugProps.length > 0)
|
|
137
|
+
lines.push(`**Properties:** ${drugProps.join(' | ')}`);
|
|
138
|
+
// Atom/bond counts
|
|
139
|
+
const counts = [];
|
|
140
|
+
if (p.HBondDonorCount != null)
|
|
141
|
+
counts.push(`HBD: ${p.HBondDonorCount}`);
|
|
142
|
+
if (p.HBondAcceptorCount != null)
|
|
143
|
+
counts.push(`HBA: ${p.HBondAcceptorCount}`);
|
|
144
|
+
if (p.RotatableBondCount != null)
|
|
145
|
+
counts.push(`Rotatable: ${p.RotatableBondCount}`);
|
|
146
|
+
if (p.HeavyAtomCount != null)
|
|
147
|
+
counts.push(`Heavy: ${p.HeavyAtomCount}`);
|
|
148
|
+
if (p.Charge != null && p.Charge !== 0)
|
|
149
|
+
counts.push(`Charge: ${p.Charge}`);
|
|
150
|
+
if (counts.length > 0)
|
|
151
|
+
lines.push(`**Counts:** ${counts.join(' | ')}`);
|
|
152
|
+
// Remaining properties not already shown
|
|
153
|
+
const shown = new Set([
|
|
154
|
+
'MolecularFormula',
|
|
155
|
+
'MolecularWeight',
|
|
156
|
+
'CanonicalSMILES',
|
|
157
|
+
'IsomericSMILES',
|
|
158
|
+
'InChIKey',
|
|
159
|
+
'IUPACName',
|
|
160
|
+
'Title',
|
|
161
|
+
'XLogP',
|
|
162
|
+
'TPSA',
|
|
163
|
+
'Complexity',
|
|
164
|
+
'HBondDonorCount',
|
|
165
|
+
'HBondAcceptorCount',
|
|
166
|
+
'RotatableBondCount',
|
|
167
|
+
'HeavyAtomCount',
|
|
168
|
+
'Charge',
|
|
169
|
+
]);
|
|
170
|
+
const extra = Object.entries(p).filter(([k]) => !shown.has(k));
|
|
171
|
+
if (extra.length > 0) {
|
|
172
|
+
lines.push(extra.map(([k, v]) => `**${k}:** ${v}`).join(' | '));
|
|
173
|
+
}
|
|
174
|
+
blocks.push(lines.join('\n'));
|
|
175
|
+
// Description
|
|
176
|
+
if (c.description) {
|
|
177
|
+
blocks.push(`\n> ${c.description.replace(/\n/g, '\n> ')}`);
|
|
178
|
+
}
|
|
179
|
+
// Synonyms
|
|
180
|
+
if (c.synonyms && c.synonyms.length > 0) {
|
|
181
|
+
const shown = c.synonyms.slice(0, 20);
|
|
182
|
+
const more = c.synonyms.length > 20 ? ` (+${c.synonyms.length - 20} more)` : '';
|
|
183
|
+
blocks.push(`\n**Synonyms:** ${shown.join(', ')}${more}`);
|
|
184
|
+
}
|
|
185
|
+
blocks.push('');
|
|
186
|
+
}
|
|
187
|
+
return [{ type: 'text', text: blocks.join('\n') }];
|
|
188
|
+
},
|
|
189
|
+
});
|
|
190
|
+
//# sourceMappingURL=get-compound-details.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-compound-details.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-compound-details.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtF,MAAM,YAAY,GAAG,CAAC,CAAC,IAAI,CAAC,mBAAuD,CAAC,CAAC;AAErF,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC,8BAA8B,EAAE;IACrE,KAAK,EAAE,sBAAsB;IAC7B,WAAW,EACT,+EAA+E;QAC/E,qFAAqF;QACrF,oFAAoF;QACpF,yDAAyD;IAC3D,WAAW,EAAE;QACX,YAAY,EAAE,IAAI;QAClB,eAAe,EA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AC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;YAC7D,CAAC;YAED,WAAW;YACX,IAAI,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACxC,MAAM,KAAK,GAAG,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBACtC,MAAM,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,MAAM,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;gBAChF,MAAM,CAAC,IAAI,CAAC,mBAAmB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;YAC5D,CAAC;YAED,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAClB,CAAC;QAED,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACrD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Fetch a 2D structure diagram (PNG) for a PubChem compound.
|
|
3
|
+
* @module mcp-server/tools/definitions/get-compound-image
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
export declare const getCompoundImage: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
7
|
+
cid: z.ZodNumber;
|
|
8
|
+
size: z.ZodDefault<z.ZodEnum<{
|
|
9
|
+
small: "small";
|
|
10
|
+
large: "large";
|
|
11
|
+
}>>;
|
|
12
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
13
|
+
cid: z.ZodNumber;
|
|
14
|
+
imageBase64: z.ZodString;
|
|
15
|
+
mimeType: z.ZodString;
|
|
16
|
+
width: z.ZodNumber;
|
|
17
|
+
height: z.ZodNumber;
|
|
18
|
+
}, z.core.$strip>>;
|
|
19
|
+
//# sourceMappingURL=get-compound-image.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-compound-image.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-compound-image.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAQjD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;kBAiD3B,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Fetch a 2D structure diagram (PNG) for a PubChem compound.
|
|
3
|
+
* @module mcp-server/tools/definitions/get-compound-image
|
|
4
|
+
*/
|
|
5
|
+
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { getPubChemClient } from '../../../services/pubchem/pubchem-client.js';
|
|
7
|
+
/** Convert ArrayBuffer to base64 string */
|
|
8
|
+
function arrayBufferToBase64(buffer) {
|
|
9
|
+
return Buffer.from(buffer).toString('base64');
|
|
10
|
+
}
|
|
11
|
+
export const getCompoundImage = tool('pubchem_get_compound_image', {
|
|
12
|
+
title: 'Get Compound Image',
|
|
13
|
+
description: 'Fetch a 2D structure diagram (PNG image) for a compound by CID.',
|
|
14
|
+
annotations: {
|
|
15
|
+
readOnlyHint: true,
|
|
16
|
+
destructiveHint: false,
|
|
17
|
+
idempotentHint: true,
|
|
18
|
+
openWorldHint: true,
|
|
19
|
+
},
|
|
20
|
+
input: z.object({
|
|
21
|
+
cid: z.number().int().positive().describe('PubChem Compound ID.'),
|
|
22
|
+
size: z
|
|
23
|
+
.enum(['small', 'large'])
|
|
24
|
+
.default('large')
|
|
25
|
+
.describe('Image size: "small" (100x100) or "large" (300x300). Default: "large".'),
|
|
26
|
+
}),
|
|
27
|
+
output: z.object({
|
|
28
|
+
cid: z.number().describe('PubChem Compound ID.'),
|
|
29
|
+
imageBase64: z.string().describe('Base64-encoded PNG image data.'),
|
|
30
|
+
mimeType: z.string().describe('Image MIME type.'),
|
|
31
|
+
width: z.number().describe('Image width in pixels.'),
|
|
32
|
+
height: z.number().describe('Image height in pixels.'),
|
|
33
|
+
}),
|
|
34
|
+
async handler(input, ctx) {
|
|
35
|
+
const client = getPubChemClient();
|
|
36
|
+
const buffer = await client.getImage(input.cid, input.size);
|
|
37
|
+
const dim = input.size === 'small' ? 100 : 300;
|
|
38
|
+
ctx.log.info('Image fetched', { cid: input.cid, size: input.size, bytes: buffer.byteLength });
|
|
39
|
+
return {
|
|
40
|
+
cid: input.cid,
|
|
41
|
+
imageBase64: arrayBufferToBase64(buffer),
|
|
42
|
+
mimeType: 'image/png',
|
|
43
|
+
width: dim,
|
|
44
|
+
height: dim,
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
format(result) {
|
|
48
|
+
return [
|
|
49
|
+
{ type: 'image', data: result.imageBase64, mimeType: result.mimeType },
|
|
50
|
+
{
|
|
51
|
+
type: 'text',
|
|
52
|
+
text: `2D structure for CID ${result.cid} (${result.width}x${result.height})`,
|
|
53
|
+
},
|
|
54
|
+
];
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
//# sourceMappingURL=get-compound-image.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-compound-image.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-compound-image.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,2CAA2C;AAC3C,SAAS,mBAAmB,CAAC,MAAmB;IAC9C,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAA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QAC5D,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;QAE/C,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;QAE9F,OAAO;YACL,GAAG,EAAE,KAAK,CAAC,GAAG;YACd,WAAW,EAAE,mBAAmB,CAAC,MAAM,CAAC;YACxC,QAAQ,EAAE,WAAW;YACrB,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,GAAG;SACZ,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,MAAM;QACX,OAAO;YACL,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,WAAW,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE;YACtE;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,wBAAwB,MAAM,CAAC,GAAG,KAAK,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,MAAM,GAAG;aAC9E;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Get GHS hazard classification and safety data for a PubChem compound.
|
|
3
|
+
* @module mcp-server/tools/definitions/get-compound-safety
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
export declare const getCompoundSafety: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
7
|
+
cid: z.ZodNumber;
|
|
8
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
9
|
+
cid: z.ZodNumber;
|
|
10
|
+
hasData: z.ZodBoolean;
|
|
11
|
+
ghs: z.ZodOptional<z.ZodObject<{
|
|
12
|
+
signalWord: z.ZodOptional<z.ZodString>;
|
|
13
|
+
pictograms: z.ZodArray<z.ZodString>;
|
|
14
|
+
hazardStatements: z.ZodArray<z.ZodObject<{
|
|
15
|
+
code: z.ZodString;
|
|
16
|
+
statement: z.ZodString;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
|
+
precautionaryStatements: z.ZodArray<z.ZodObject<{
|
|
19
|
+
code: z.ZodString;
|
|
20
|
+
statement: z.ZodString;
|
|
21
|
+
}, z.core.$strip>>;
|
|
22
|
+
}, z.core.$strip>>;
|
|
23
|
+
source: z.ZodOptional<z.ZodString>;
|
|
24
|
+
}, z.core.$strip>>;
|
|
25
|
+
//# sourceMappingURL=get-compound-safety.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-compound-safety.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-compound-safety.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAGjD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;kBAoG5B,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Get GHS hazard classification and safety data for a PubChem compound.
|
|
3
|
+
* @module mcp-server/tools/definitions/get-compound-safety
|
|
4
|
+
*/
|
|
5
|
+
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { getPubChemClient } from '../../../services/pubchem/pubchem-client.js';
|
|
7
|
+
export const getCompoundSafety = tool('pubchem_get_compound_safety', {
|
|
8
|
+
title: 'Get Compound Safety',
|
|
9
|
+
description: 'Get GHS (Globally Harmonized System) hazard classification and safety data for a compound. ' +
|
|
10
|
+
'Returns signal word, pictograms, hazard statements (H-codes), and precautionary statements (P-codes). ' +
|
|
11
|
+
'Data sourced from PubChem depositors — source attribution included.',
|
|
12
|
+
annotations: {
|
|
13
|
+
readOnlyHint: true,
|
|
14
|
+
destructiveHint: false,
|
|
15
|
+
idempotentHint: true,
|
|
16
|
+
openWorldHint: true,
|
|
17
|
+
},
|
|
18
|
+
input: z.object({
|
|
19
|
+
cid: z.number().int().positive().describe('PubChem Compound ID.'),
|
|
20
|
+
}),
|
|
21
|
+
output: z.object({
|
|
22
|
+
cid: z.number().describe('PubChem Compound ID.'),
|
|
23
|
+
hasData: z.boolean().describe('Whether GHS safety data is available for this compound.'),
|
|
24
|
+
ghs: z
|
|
25
|
+
.object({
|
|
26
|
+
signalWord: z.string().optional().describe('GHS signal word: "Danger" or "Warning".'),
|
|
27
|
+
pictograms: z
|
|
28
|
+
.array(z.string())
|
|
29
|
+
.describe('GHS pictogram labels (e.g. "Flammable", "Toxic").'),
|
|
30
|
+
hazardStatements: z
|
|
31
|
+
.array(z.object({
|
|
32
|
+
code: z.string().describe('H-code (e.g. "H225").'),
|
|
33
|
+
statement: z.string().describe('Hazard statement text.'),
|
|
34
|
+
}))
|
|
35
|
+
.describe('GHS hazard statements.'),
|
|
36
|
+
precautionaryStatements: z
|
|
37
|
+
.array(z.object({
|
|
38
|
+
code: z.string().describe('P-code (e.g. "P210").'),
|
|
39
|
+
statement: z.string().describe('Precautionary statement text.'),
|
|
40
|
+
}))
|
|
41
|
+
.describe('GHS precautionary statements.'),
|
|
42
|
+
})
|
|
43
|
+
.optional()
|
|
44
|
+
.describe('GHS classification data.'),
|
|
45
|
+
source: z.string().optional().describe('Data source attribution.'),
|
|
46
|
+
}),
|
|
47
|
+
async handler(input, ctx) {
|
|
48
|
+
const client = getPubChemClient();
|
|
49
|
+
const data = await client.getSafetyData(input.cid);
|
|
50
|
+
ctx.log.info('Safety data fetched', { cid: input.cid, hasData: data !== null });
|
|
51
|
+
if (!data) {
|
|
52
|
+
return { cid: input.cid, hasData: false };
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
cid: input.cid,
|
|
56
|
+
hasData: true,
|
|
57
|
+
ghs: {
|
|
58
|
+
signalWord: data.signalWord,
|
|
59
|
+
pictograms: data.pictograms,
|
|
60
|
+
hazardStatements: data.hazardStatements,
|
|
61
|
+
precautionaryStatements: data.precautionaryStatements,
|
|
62
|
+
},
|
|
63
|
+
source: data.source,
|
|
64
|
+
};
|
|
65
|
+
},
|
|
66
|
+
format(result) {
|
|
67
|
+
if (!result.hasData || !result.ghs) {
|
|
68
|
+
return [{ type: 'text', text: `No GHS safety data available for CID ${result.cid}.` }];
|
|
69
|
+
}
|
|
70
|
+
const lines = [`## GHS Safety — CID ${result.cid}`, ''];
|
|
71
|
+
const g = result.ghs;
|
|
72
|
+
if (g.signalWord)
|
|
73
|
+
lines.push(`**Signal Word:** ${g.signalWord}`);
|
|
74
|
+
if (g.pictograms.length > 0)
|
|
75
|
+
lines.push(`**Pictograms:** ${g.pictograms.join(', ')}`);
|
|
76
|
+
if (g.hazardStatements.length > 0) {
|
|
77
|
+
lines.push('', '**Hazard Statements:**');
|
|
78
|
+
for (const h of g.hazardStatements) {
|
|
79
|
+
lines.push(` ${h.code}: ${h.statement}`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (g.precautionaryStatements.length > 0) {
|
|
83
|
+
lines.push('', '**Precautionary Statements:**');
|
|
84
|
+
for (const p of g.precautionaryStatements) {
|
|
85
|
+
lines.push(` ${p.code}: ${p.statement}`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (result.source) {
|
|
89
|
+
lines.push('', `*Source: ${result.source}*`);
|
|
90
|
+
}
|
|
91
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
//# sourceMappingURL=get-compound-safety.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-compound-safety.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-compound-safety.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAA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AAC,MAAM,EAAE,CAAC;YAClB,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,YAAY,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;QAC/C,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,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Get external database cross-references for a PubChem compound.
|
|
3
|
+
* @module mcp-server/tools/definitions/get-compound-xrefs
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
export declare const getCompoundXrefs: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
7
|
+
cid: z.ZodNumber;
|
|
8
|
+
xrefTypes: z.ZodArray<z.ZodEnum<{
|
|
9
|
+
[x: string]: string;
|
|
10
|
+
}>>;
|
|
11
|
+
maxPerType: z.ZodDefault<z.ZodNumber>;
|
|
12
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
13
|
+
cid: z.ZodNumber;
|
|
14
|
+
xrefs: z.ZodArray<z.ZodObject<{
|
|
15
|
+
type: z.ZodString;
|
|
16
|
+
ids: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
17
|
+
totalAvailable: z.ZodNumber;
|
|
18
|
+
truncated: z.ZodBoolean;
|
|
19
|
+
}, z.core.$strip>>;
|
|
20
|
+
}, z.core.$strip>>;
|
|
21
|
+
//# sourceMappingURL=get-compound-xrefs.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-compound-xrefs.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-compound-xrefs.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAMjD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;kBAqG3B,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Get external database cross-references for a PubChem compound.
|
|
3
|
+
* @module mcp-server/tools/definitions/get-compound-xrefs
|
|
4
|
+
*/
|
|
5
|
+
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { getPubChemClient } from '../../../services/pubchem/pubchem-client.js';
|
|
7
|
+
import { XREF_TYPES } from '../../../services/pubchem/types.js';
|
|
8
|
+
const xrefTypeEnum = z.enum(XREF_TYPES);
|
|
9
|
+
export const getCompoundXrefs = tool('pubchem_get_compound_xrefs', {
|
|
10
|
+
title: 'Get Compound Cross-References',
|
|
11
|
+
description: 'Get external database cross-references for a compound: PubMed citations, patent IDs, ' +
|
|
12
|
+
'gene/protein associations, registry numbers, and taxonomy IDs. Results are capped per ' +
|
|
13
|
+
'type with total counts reported.',
|
|
14
|
+
annotations: {
|
|
15
|
+
readOnlyHint: true,
|
|
16
|
+
destructiveHint: false,
|
|
17
|
+
idempotentHint: true,
|
|
18
|
+
openWorldHint: true,
|
|
19
|
+
},
|
|
20
|
+
input: z.object({
|
|
21
|
+
cid: z.number().int().positive().describe('PubChem Compound ID.'),
|
|
22
|
+
xrefTypes: z
|
|
23
|
+
.array(xrefTypeEnum)
|
|
24
|
+
.min(1)
|
|
25
|
+
.describe('Cross-reference types to retrieve. Options: RegistryID, RN (CAS numbers), ' +
|
|
26
|
+
'PubMedID, PatentID, GeneID, ProteinGI, TaxonomyID.'),
|
|
27
|
+
maxPerType: z
|
|
28
|
+
.number()
|
|
29
|
+
.min(1)
|
|
30
|
+
.max(500)
|
|
31
|
+
.default(50)
|
|
32
|
+
.describe('Max IDs to return per xref type (1-500). A compound may have thousands of PubMed ' +
|
|
33
|
+
'references — this cap prevents bloat. Total count always reported. Default: 50.'),
|
|
34
|
+
}),
|
|
35
|
+
output: z.object({
|
|
36
|
+
cid: z.number().describe('PubChem Compound ID.'),
|
|
37
|
+
xrefs: z
|
|
38
|
+
.array(z.object({
|
|
39
|
+
type: z.string().describe('Cross-reference type.'),
|
|
40
|
+
ids: z
|
|
41
|
+
.array(z.union([z.string(), z.number()]))
|
|
42
|
+
.describe('Cross-reference IDs (capped by maxPerType).'),
|
|
43
|
+
totalAvailable: z.number().describe('Total IDs available before truncation.'),
|
|
44
|
+
truncated: z.boolean().describe('Whether results were truncated.'),
|
|
45
|
+
}))
|
|
46
|
+
.describe('Cross-references grouped by type.'),
|
|
47
|
+
}),
|
|
48
|
+
async handler(input, ctx) {
|
|
49
|
+
const client = getPubChemClient();
|
|
50
|
+
// Sequential per type to avoid rate limit spikes
|
|
51
|
+
const xrefs = [];
|
|
52
|
+
for (const xrefType of input.xrefTypes) {
|
|
53
|
+
const allIds = await client.getXrefs(input.cid, xrefType);
|
|
54
|
+
const totalAvailable = allIds.length;
|
|
55
|
+
const ids = allIds.slice(0, input.maxPerType);
|
|
56
|
+
xrefs.push({
|
|
57
|
+
type: xrefType,
|
|
58
|
+
ids,
|
|
59
|
+
totalAvailable,
|
|
60
|
+
truncated: totalAvailable > input.maxPerType,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
ctx.log.info('Xrefs fetched', {
|
|
64
|
+
cid: input.cid,
|
|
65
|
+
types: input.xrefTypes,
|
|
66
|
+
totalIds: xrefs.reduce((sum, x) => sum + x.ids.length, 0),
|
|
67
|
+
});
|
|
68
|
+
return { cid: input.cid, xrefs };
|
|
69
|
+
},
|
|
70
|
+
format(result) {
|
|
71
|
+
const lines = [`Cross-references for CID ${result.cid}`, ''];
|
|
72
|
+
for (const xref of result.xrefs) {
|
|
73
|
+
const countInfo = xref.truncated
|
|
74
|
+
? `${xref.ids.length} of ${xref.totalAvailable} total`
|
|
75
|
+
: `${xref.totalAvailable} total`;
|
|
76
|
+
lines.push(`**${xref.type}** (${countInfo})`);
|
|
77
|
+
if (xref.ids.length > 0) {
|
|
78
|
+
const display = xref.ids.slice(0, 20);
|
|
79
|
+
const more = xref.ids.length > 20 ? `, ... (+${xref.ids.length - 20} more)` : '';
|
|
80
|
+
lines.push(` ${display.join(', ')}${more}`);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
lines.push(' None found');
|
|
84
|
+
}
|
|
85
|
+
lines.push('');
|
|
86
|
+
}
|
|
87
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
//# sourceMappingURL=get-compound-xrefs.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-compound-xrefs.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-compound-xrefs.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD,MAAM,YAAY,GAAG,CAAC,CAAC,IAAI,CAAC,UAA8C,CAAC,CAAC;AAE5E,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC,4BAA4B,EAAE;IACjE,KAAK,EAAE,+BAA+B;IACtC,WAAW,EACT,uFAAuF;QACvF,wFAAwF;QACxF,kCAAkC;IACpC,WAAW,EAAE;QACX,YAAY,EAAE,IAAI;QAClB,eAAe,EAAE,KAAK;QACtB,cAAc,EAAE,IAAI;QACpB,aAAa,EAAE,IAAI;KACpB;IACD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC;QACjE,SAAS,EAAE,CAAC;aACT,KAAK,CAAC,YAAY,CAAC;aACnB,GAAG,CAAC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AC;gBACtC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;gBACjF,KAAK,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;YAC/C,CAAC;iBAAM,CAAC;gBACN,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAC7B,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,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Get descriptive summaries for PubChem entities: assays, genes,
|
|
3
|
+
* proteins, pathways, taxonomy, cell lines, or substances.
|
|
4
|
+
* @module mcp-server/tools/definitions/get-summary
|
|
5
|
+
*/
|
|
6
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
7
|
+
export declare const getSummary: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
8
|
+
entityType: z.ZodEnum<{
|
|
9
|
+
assay: "assay";
|
|
10
|
+
gene: "gene";
|
|
11
|
+
protein: "protein";
|
|
12
|
+
taxonomy: "taxonomy";
|
|
13
|
+
}>;
|
|
14
|
+
identifiers: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
15
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
16
|
+
entityType: z.ZodString;
|
|
17
|
+
summaries: z.ZodArray<z.ZodObject<{
|
|
18
|
+
identifier: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
19
|
+
found: z.ZodBoolean;
|
|
20
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
21
|
+
}, z.core.$strip>>;
|
|
22
|
+
}, z.core.$strip>>;
|
|
23
|
+
//# sourceMappingURL=get-summary.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-summary.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-summary.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAOjD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;kBA8FrB,CAAC"}
|