@cyanheads/pubchem-mcp-server 0.1.23 → 0.2.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/README.md +43 -8
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/resources/definitions/assay.resource.d.ts +9 -0
- package/dist/mcp-server/resources/definitions/assay.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/assay.resource.js +24 -0
- package/dist/mcp-server/resources/definitions/assay.resource.js.map +1 -0
- package/dist/mcp-server/resources/definitions/compound-bioactivity.resource.d.ts +9 -0
- package/dist/mcp-server/resources/definitions/compound-bioactivity.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/compound-bioactivity.resource.js +28 -0
- package/dist/mcp-server/resources/definitions/compound-bioactivity.resource.js.map +1 -0
- package/dist/mcp-server/resources/definitions/compound-image.resource.d.ts +11 -0
- package/dist/mcp-server/resources/definitions/compound-image.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/compound-image.resource.js +28 -0
- package/dist/mcp-server/resources/definitions/compound-image.resource.js.map +1 -0
- package/dist/mcp-server/resources/definitions/compound-safety.resource.d.ts +9 -0
- package/dist/mcp-server/resources/definitions/compound-safety.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/compound-safety.resource.js +32 -0
- package/dist/mcp-server/resources/definitions/compound-safety.resource.js.map +1 -0
- package/dist/mcp-server/resources/definitions/compound-xrefs.resource.d.ts +9 -0
- package/dist/mcp-server/resources/definitions/compound-xrefs.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/compound-xrefs.resource.js +29 -0
- package/dist/mcp-server/resources/definitions/compound-xrefs.resource.js.map +1 -0
- package/dist/mcp-server/resources/definitions/compound.resource.d.ts +9 -0
- package/dist/mcp-server/resources/definitions/compound.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/compound.resource.js +28 -0
- package/dist/mcp-server/resources/definitions/compound.resource.js.map +1 -0
- package/dist/mcp-server/resources/definitions/index.d.ts +14 -0
- package/dist/mcp-server/resources/definitions/index.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/index.js +19 -0
- package/dist/mcp-server/resources/definitions/index.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-bioactivity.tool.d.ts +3 -0
- package/dist/mcp-server/tools/definitions/get-bioactivity.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-bioactivity.tool.js +38 -6
- package/dist/mcp-server/tools/definitions/get-bioactivity.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-compound-3d-structure.tool.d.ts +38 -0
- package/dist/mcp-server/tools/definitions/get-compound-3d-structure.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-compound-3d-structure.tool.js +133 -0
- package/dist/mcp-server/tools/definitions/get-compound-3d-structure.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-compound-interactions.tool.d.ts +33 -0
- package/dist/mcp-server/tools/definitions/get-compound-interactions.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-compound-interactions.tool.js +110 -0
- package/dist/mcp-server/tools/definitions/get-compound-interactions.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-compound-safety.tool.d.ts +19 -15
- package/dist/mcp-server/tools/definitions/get-compound-safety.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-compound-safety.tool.js +106 -73
- package/dist/mcp-server/tools/definitions/get-compound-safety.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/index.d.ts +75 -12
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/index.js +4 -0
- package/dist/mcp-server/tools/definitions/index.js.map +1 -1
- package/dist/services/pubchem/pubchem-client.d.ts +36 -1
- package/dist/services/pubchem/pubchem-client.d.ts.map +1 -1
- package/dist/services/pubchem/pubchem-client.js +191 -23
- package/dist/services/pubchem/pubchem-client.js.map +1 -1
- package/dist/services/pubchem/sdf-parser.d.ts +20 -0
- package/dist/services/pubchem/sdf-parser.d.ts.map +1 -0
- package/dist/services/pubchem/sdf-parser.js +55 -0
- package/dist/services/pubchem/sdf-parser.js.map +1 -0
- package/dist/services/pubchem/types.d.ts +55 -0
- package/dist/services/pubchem/types.d.ts.map +1 -1
- package/dist/services/pubchem/types.js.map +1 -1
- package/manifest.json +1 -1
- package/package.json +1 -1
- package/server.json +3 -3
|
@@ -1,108 +1,141 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview Get GHS hazard classification and safety data for
|
|
2
|
+
* @fileoverview Get GHS hazard classification and safety data for PubChem compounds (batched).
|
|
3
3
|
* @module mcp-server/tools/definitions/get-compound-safety
|
|
4
4
|
*/
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { getPubChemClient } from '../../../services/pubchem/pubchem-client.js';
|
|
7
|
+
const ghsSchema = z
|
|
8
|
+
.object({
|
|
9
|
+
signalWord: z.string().optional().describe('GHS signal word: "Danger" or "Warning".'),
|
|
10
|
+
pictograms: z.array(z.string()).describe('GHS pictogram labels (e.g. "Flammable", "Toxic").'),
|
|
11
|
+
hazardStatements: z
|
|
12
|
+
.array(z
|
|
13
|
+
.object({
|
|
14
|
+
code: z.string().describe('H-code (e.g. "H225").'),
|
|
15
|
+
statement: z.string().describe('Hazard statement text.'),
|
|
16
|
+
})
|
|
17
|
+
.describe('GHS hazard statement entry.'))
|
|
18
|
+
.describe('GHS hazard statements.'),
|
|
19
|
+
precautionaryStatements: z
|
|
20
|
+
.array(z
|
|
21
|
+
.object({
|
|
22
|
+
code: z.string().describe('P-code (e.g. "P210").'),
|
|
23
|
+
statement: z.string().describe('Precautionary statement text.'),
|
|
24
|
+
})
|
|
25
|
+
.describe('GHS precautionary statement entry.'))
|
|
26
|
+
.describe('GHS precautionary statements.'),
|
|
27
|
+
})
|
|
28
|
+
.describe('GHS classification data.');
|
|
29
|
+
/** Fan-out cap: at most this many PUG View calls in flight at once (mirrors get_compound_details). */
|
|
30
|
+
const MAX_IN_FLIGHT = 10;
|
|
7
31
|
export const getCompoundSafety = tool('pubchem_get_compound_safety', {
|
|
8
32
|
title: 'Get Compound Safety',
|
|
9
|
-
description: 'Get GHS (Globally Harmonized System) hazard classification and safety data for
|
|
33
|
+
description: 'Get GHS (Globally Harmonized System) hazard classification and safety data for one or more compounds by CID. Returns signal word, pictograms, hazard statements (H-codes), and precautionary statements (P-codes) per compound. Data sourced from PubChem depositors — source attribution included.',
|
|
10
34
|
annotations: {
|
|
11
35
|
readOnlyHint: true,
|
|
12
36
|
idempotentHint: true,
|
|
13
37
|
openWorldHint: true,
|
|
14
38
|
},
|
|
15
39
|
input: z.object({
|
|
16
|
-
|
|
17
|
-
.number()
|
|
18
|
-
.
|
|
19
|
-
.
|
|
20
|
-
.describe('PubChem Compound
|
|
40
|
+
cids: z
|
|
41
|
+
.array(z.number().int().positive())
|
|
42
|
+
.min(1)
|
|
43
|
+
.max(25)
|
|
44
|
+
.describe('PubChem Compound IDs to fetch safety data for (1-25). Resolve from names/SMILES with pubchem_search_compounds.'),
|
|
21
45
|
}),
|
|
22
46
|
output: z.object({
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
ghs: z
|
|
47
|
+
results: z
|
|
48
|
+
.array(z
|
|
26
49
|
.object({
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
.
|
|
30
|
-
.describe('GHS
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
.object({
|
|
34
|
-
code: z.string().describe('H-code (e.g. "H225").'),
|
|
35
|
-
statement: z.string().describe('Hazard statement text.'),
|
|
36
|
-
})
|
|
37
|
-
.describe('GHS hazard statement entry.'))
|
|
38
|
-
.describe('GHS hazard statements.'),
|
|
39
|
-
precautionaryStatements: z
|
|
40
|
-
.array(z
|
|
41
|
-
.object({
|
|
42
|
-
code: z.string().describe('P-code (e.g. "P210").'),
|
|
43
|
-
statement: z.string().describe('Precautionary statement text.'),
|
|
44
|
-
})
|
|
45
|
-
.describe('GHS precautionary statement entry.'))
|
|
46
|
-
.describe('GHS precautionary statements.'),
|
|
50
|
+
cid: z.number().describe('PubChem Compound ID.'),
|
|
51
|
+
hasData: z
|
|
52
|
+
.boolean()
|
|
53
|
+
.describe('Whether GHS safety data is available for this compound.'),
|
|
54
|
+
ghs: ghsSchema.optional(),
|
|
55
|
+
source: z.string().optional().describe('Data source attribution.'),
|
|
47
56
|
})
|
|
48
|
-
.
|
|
49
|
-
.describe('
|
|
50
|
-
source: z.string().optional().describe('Data source attribution.'),
|
|
57
|
+
.describe('Per-CID safety result.'))
|
|
58
|
+
.describe('Safety results, one per requested CID (input order preserved).'),
|
|
51
59
|
}),
|
|
52
|
-
// Agent-facing context — a cross-tool notice
|
|
53
|
-
//
|
|
60
|
+
// Agent-facing context — requested/with-data counts and a cross-tool notice listing the CIDs
|
|
61
|
+
// that lack GHS data. Reaches structuredContent and content[]; keys disjoint from output.
|
|
54
62
|
enrichment: {
|
|
63
|
+
requestedCount: z.number().describe('CIDs requested.'),
|
|
64
|
+
withDataCount: z.number().describe('CIDs with GHS safety data available.'),
|
|
55
65
|
notice: z
|
|
56
66
|
.string()
|
|
57
67
|
.optional()
|
|
58
|
-
.describe('Cross-tool guidance when no GHS data
|
|
68
|
+
.describe('Cross-tool guidance when one or more CIDs have no GHS data, pointing to an alternative source.'),
|
|
59
69
|
},
|
|
60
70
|
async handler(input, ctx) {
|
|
61
71
|
const client = getPubChemClient();
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
72
|
+
// Fan out per CID, capped at MAX_IN_FLIGHT in flight.
|
|
73
|
+
const dataByCid = new Map();
|
|
74
|
+
for (let i = 0; i < input.cids.length; i += MAX_IN_FLIGHT) {
|
|
75
|
+
const chunk = input.cids.slice(i, i + MAX_IN_FLIGHT);
|
|
76
|
+
const chunkData = await Promise.all(chunk.map(async (cid) => [cid, await client.getSafetyData(cid)]));
|
|
77
|
+
for (const [cid, data] of chunkData)
|
|
78
|
+
dataByCid.set(cid, data);
|
|
79
|
+
}
|
|
80
|
+
const results = input.cids.map((cid) => {
|
|
81
|
+
const data = dataByCid.get(cid) ?? null;
|
|
82
|
+
if (!data)
|
|
83
|
+
return { cid, hasData: false };
|
|
84
|
+
return {
|
|
85
|
+
cid,
|
|
86
|
+
hasData: true,
|
|
87
|
+
ghs: {
|
|
88
|
+
signalWord: data.signalWord,
|
|
89
|
+
pictograms: data.pictograms,
|
|
90
|
+
hazardStatements: data.hazardStatements,
|
|
91
|
+
precautionaryStatements: data.precautionaryStatements,
|
|
92
|
+
},
|
|
93
|
+
source: data.source,
|
|
94
|
+
};
|
|
95
|
+
});
|
|
96
|
+
const withDataCount = results.filter((r) => r.hasData).length;
|
|
97
|
+
ctx.log.info('Safety data fetched', {
|
|
98
|
+
requested: input.cids.length,
|
|
99
|
+
withData: withDataCount,
|
|
100
|
+
});
|
|
101
|
+
ctx.enrich({ requestedCount: input.cids.length, withDataCount });
|
|
102
|
+
if (withDataCount < input.cids.length) {
|
|
103
|
+
const missing = results.filter((r) => !r.hasData).map((r) => r.cid);
|
|
104
|
+
ctx.enrich.notice(`No GHS classification on file for ${missing.length} of ${input.cids.length} CID(s): ${missing.join(', ')}. Try pubchem_get_compound_details with includeDescription for hazard context, or those compounds may simply lack deposited safety data.`);
|
|
67
105
|
}
|
|
68
|
-
return {
|
|
69
|
-
cid: input.cid,
|
|
70
|
-
hasData: true,
|
|
71
|
-
ghs: {
|
|
72
|
-
signalWord: data.signalWord,
|
|
73
|
-
pictograms: data.pictograms,
|
|
74
|
-
hazardStatements: data.hazardStatements,
|
|
75
|
-
precautionaryStatements: data.precautionaryStatements,
|
|
76
|
-
},
|
|
77
|
-
source: data.source,
|
|
78
|
-
};
|
|
106
|
+
return { results };
|
|
79
107
|
},
|
|
80
108
|
format(result) {
|
|
81
|
-
if (
|
|
82
|
-
return [{ type: 'text', text:
|
|
109
|
+
if (result.results.length === 0) {
|
|
110
|
+
return [{ type: 'text', text: 'No compounds requested.' }];
|
|
83
111
|
}
|
|
84
|
-
const
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
lines.push(`**Pictograms:** ${g.pictograms.join(', ')}`);
|
|
90
|
-
if (g.hazardStatements.length > 0) {
|
|
91
|
-
lines.push('', '**Hazard Statements:**');
|
|
92
|
-
for (const h of g.hazardStatements) {
|
|
93
|
-
lines.push(` ${h.code}: ${h.statement}`);
|
|
112
|
+
const blocks = [];
|
|
113
|
+
for (const r of result.results) {
|
|
114
|
+
if (!r.hasData || !r.ghs) {
|
|
115
|
+
blocks.push(`## CID ${r.cid} — no GHS safety data`, '');
|
|
116
|
+
continue;
|
|
94
117
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
118
|
+
const lines = [`## GHS Safety Data — CID ${r.cid}`];
|
|
119
|
+
const g = r.ghs;
|
|
120
|
+
if (g.signalWord)
|
|
121
|
+
lines.push(`**Signal Word:** ${g.signalWord}`);
|
|
122
|
+
if (g.pictograms.length > 0)
|
|
123
|
+
lines.push(`**Pictograms:** ${g.pictograms.join(', ')}`);
|
|
124
|
+
if (g.hazardStatements.length > 0) {
|
|
125
|
+
lines.push('', '**Hazard Statements:**');
|
|
126
|
+
for (const h of g.hazardStatements)
|
|
127
|
+
lines.push(` ${h.code}: ${h.statement}`);
|
|
100
128
|
}
|
|
129
|
+
if (g.precautionaryStatements.length > 0) {
|
|
130
|
+
lines.push('', '**Precautionary Statements:**');
|
|
131
|
+
for (const p of g.precautionaryStatements)
|
|
132
|
+
lines.push(` ${p.code}: ${p.statement}`);
|
|
133
|
+
}
|
|
134
|
+
if (r.source)
|
|
135
|
+
lines.push('', `*Source: ${r.source}*`);
|
|
136
|
+
blocks.push(lines.join('\n'), '');
|
|
101
137
|
}
|
|
102
|
-
|
|
103
|
-
lines.push('', `*Source: ${result.source}*`);
|
|
104
|
-
}
|
|
105
|
-
return [{ type: 'text', text: lines.join('\n') }];
|
|
138
|
+
return [{ type: 'text', text: blocks.join('\n') }];
|
|
106
139
|
},
|
|
107
140
|
});
|
|
108
141
|
//# sourceMappingURL=get-compound-safety.tool.js.map
|
|
@@ -1 +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,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;
|
|
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,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAGxE,MAAM,SAAS,GAAG,CAAC;KAChB,MAAM,CAAC;IACN,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC;IACrF,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,mDAAmD,CAAC;IAC7F,gBAAgB,EAAE,CAAC;SAChB,KAAK,CACJ,CAAC;SACE,MAAM,CAAC;QACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QAClD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;KACzD,CAAC;SACD,QAAQ,CAAC,6BAA6B,CAAC,CAC3C;SACA,QAAQ,CAAC,wBAAwB,CAAC;IACrC,uBAAuB,EAAE,CAAC;SACvB,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AAuB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACzC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,+BAA+B,CAAC,CAAC;gBAChD,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,uBAAuB;oBAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;YACvF,CAAC;YAED,IAAI,CAAC,CAAC,MAAM;gBAAE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;YAEtD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QACpC,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"}
|
|
@@ -9,6 +9,8 @@ export declare const allToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolD
|
|
|
9
9
|
inactive: "inactive";
|
|
10
10
|
all: "all";
|
|
11
11
|
}>>;
|
|
12
|
+
targetGeneId: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
13
|
+
targetAccession: import("zod").ZodOptional<import("zod").ZodString>;
|
|
12
14
|
maxResults: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
13
15
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
14
16
|
cid: import("zod").ZodNumber;
|
|
@@ -29,10 +31,41 @@ export declare const allToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolD
|
|
|
29
31
|
}, import("zod/v4/core").$strip>>;
|
|
30
32
|
}, import("zod/v4/core").$strip>, undefined, {
|
|
31
33
|
readonly outcomeFilter: import("zod").ZodString;
|
|
34
|
+
readonly targetFilter: import("zod").ZodOptional<import("zod").ZodString>;
|
|
32
35
|
readonly filteredCount: import("zod").ZodNumber;
|
|
33
36
|
readonly returnedCount: import("zod").ZodNumber;
|
|
34
37
|
readonly notice: import("zod").ZodOptional<import("zod").ZodString>;
|
|
35
38
|
}> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
|
|
39
|
+
cid: import("zod").ZodNumber;
|
|
40
|
+
format: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
41
|
+
sdf: "sdf";
|
|
42
|
+
json: "json";
|
|
43
|
+
}>>;
|
|
44
|
+
includeAlternateConformerIds: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
45
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
46
|
+
cid: import("zod").ZodNumber;
|
|
47
|
+
conformerId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
48
|
+
atomCount: import("zod").ZodNumber;
|
|
49
|
+
bondCount: import("zod").ZodNumber;
|
|
50
|
+
atoms: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
51
|
+
element: import("zod").ZodString;
|
|
52
|
+
x: import("zod").ZodNumber;
|
|
53
|
+
y: import("zod").ZodNumber;
|
|
54
|
+
z: import("zod").ZodNumber;
|
|
55
|
+
}, import("zod/v4/core").$strip>>>;
|
|
56
|
+
bonds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
57
|
+
a1: import("zod").ZodNumber;
|
|
58
|
+
a2: import("zod").ZodNumber;
|
|
59
|
+
order: import("zod").ZodNumber;
|
|
60
|
+
}, import("zod/v4/core").$strip>>>;
|
|
61
|
+
sdf: import("zod").ZodOptional<import("zod").ZodString>;
|
|
62
|
+
alternateConformerIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
63
|
+
}, import("zod/v4/core").$strip>, readonly [{
|
|
64
|
+
readonly reason: "no_3d_structure";
|
|
65
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
66
|
+
readonly when: "PubChem has no computed 3D conformer for the requested CID";
|
|
67
|
+
readonly recovery: "Use pubchem_get_compound_image for the 2D structure, or verify the CID with pubchem_search_compounds.";
|
|
68
|
+
}], undefined> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
|
|
36
69
|
cids: import("zod").ZodArray<import("zod").ZodNumber>;
|
|
37
70
|
properties: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodEnum<{
|
|
38
71
|
[x: string]: string;
|
|
@@ -121,23 +154,53 @@ export declare const allToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolD
|
|
|
121
154
|
readonly recovery: "Verify the CID with pubchem_search_compounds before retrying.";
|
|
122
155
|
}], undefined> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
|
|
123
156
|
cid: import("zod").ZodNumber;
|
|
157
|
+
kinds: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodEnum<{
|
|
158
|
+
"drug-drug": "drug-drug";
|
|
159
|
+
"drug-food": "drug-food";
|
|
160
|
+
target: "target";
|
|
161
|
+
}>>>;
|
|
162
|
+
maxEntries: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
124
163
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
125
164
|
cid: import("zod").ZodNumber;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
165
|
+
entries: import("zod").ZodArray<import("zod").ZodObject<{
|
|
166
|
+
kind: import("zod").ZodEnum<{
|
|
167
|
+
"drug-drug": "drug-drug";
|
|
168
|
+
"drug-food": "drug-food";
|
|
169
|
+
target: "target";
|
|
170
|
+
}>;
|
|
171
|
+
partner: import("zod").ZodOptional<import("zod").ZodString>;
|
|
172
|
+
source: import("zod").ZodString;
|
|
173
|
+
severity: import("zod").ZodOptional<import("zod").ZodString>;
|
|
174
|
+
text: import("zod").ZodString;
|
|
175
|
+
}, import("zod/v4/core").$strip>>;
|
|
176
|
+
}, import("zod/v4/core").$strip>, undefined, {
|
|
177
|
+
readonly requestedKinds: import("zod").ZodString;
|
|
178
|
+
readonly returnedCount: import("zod").ZodNumber;
|
|
179
|
+
readonly failedKinds: import("zod").ZodOptional<import("zod").ZodString>;
|
|
180
|
+
readonly notice: import("zod").ZodOptional<import("zod").ZodString>;
|
|
181
|
+
}> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
|
|
182
|
+
cids: import("zod").ZodArray<import("zod").ZodNumber>;
|
|
183
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
184
|
+
results: import("zod").ZodArray<import("zod").ZodObject<{
|
|
185
|
+
cid: import("zod").ZodNumber;
|
|
186
|
+
hasData: import("zod").ZodBoolean;
|
|
187
|
+
ghs: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
188
|
+
signalWord: import("zod").ZodOptional<import("zod").ZodString>;
|
|
189
|
+
pictograms: import("zod").ZodArray<import("zod").ZodString>;
|
|
190
|
+
hazardStatements: import("zod").ZodArray<import("zod").ZodObject<{
|
|
191
|
+
code: import("zod").ZodString;
|
|
192
|
+
statement: import("zod").ZodString;
|
|
193
|
+
}, import("zod/v4/core").$strip>>;
|
|
194
|
+
precautionaryStatements: import("zod").ZodArray<import("zod").ZodObject<{
|
|
195
|
+
code: import("zod").ZodString;
|
|
196
|
+
statement: import("zod").ZodString;
|
|
197
|
+
}, import("zod/v4/core").$strip>>;
|
|
137
198
|
}, import("zod/v4/core").$strip>>;
|
|
199
|
+
source: import("zod").ZodOptional<import("zod").ZodString>;
|
|
138
200
|
}, import("zod/v4/core").$strip>>;
|
|
139
|
-
source: import("zod").ZodOptional<import("zod").ZodString>;
|
|
140
201
|
}, import("zod/v4/core").$strip>, undefined, {
|
|
202
|
+
readonly requestedCount: import("zod").ZodNumber;
|
|
203
|
+
readonly withDataCount: import("zod").ZodNumber;
|
|
141
204
|
readonly notice: import("zod").ZodOptional<import("zod").ZodString>;
|
|
142
205
|
}> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
|
|
143
206
|
cid: import("zod").ZodNumber;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAW9B,CAAC"}
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
* @module mcp-server/tools/definitions
|
|
4
4
|
*/
|
|
5
5
|
import { getBioactivity } from './get-bioactivity.tool.js';
|
|
6
|
+
import { getCompound3dStructure } from './get-compound-3d-structure.tool.js';
|
|
6
7
|
import { getCompoundDetails } from './get-compound-details.tool.js';
|
|
7
8
|
import { getCompoundImage } from './get-compound-image.tool.js';
|
|
9
|
+
import { getCompoundInteractions } from './get-compound-interactions.tool.js';
|
|
8
10
|
import { getCompoundSafety } from './get-compound-safety.tool.js';
|
|
9
11
|
import { getCompoundXrefs } from './get-compound-xrefs.tool.js';
|
|
10
12
|
import { getSummary } from './get-summary.tool.js';
|
|
@@ -14,9 +16,11 @@ export const allToolDefinitions = [
|
|
|
14
16
|
searchCompounds,
|
|
15
17
|
getCompoundDetails,
|
|
16
18
|
getCompoundImage,
|
|
19
|
+
getCompound3dStructure,
|
|
17
20
|
getCompoundXrefs,
|
|
18
21
|
getCompoundSafety,
|
|
19
22
|
getBioactivity,
|
|
23
|
+
getCompoundInteractions,
|
|
20
24
|
searchAssays,
|
|
21
25
|
getSummary,
|
|
22
26
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,eAAe;IACf,kBAAkB;IAClB,gBAAgB;IAChB,gBAAgB;IAChB,iBAAiB;IACjB,cAAc;IACd,YAAY;IACZ,UAAU;CACX,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,eAAe;IACf,kBAAkB;IAClB,gBAAgB;IAChB,sBAAsB;IACtB,gBAAgB;IAChB,iBAAiB;IACjB,cAAc;IACd,uBAAuB;IACvB,YAAY;IACZ,UAAU;CACX,CAAC"}
|
|
@@ -3,13 +3,22 @@
|
|
|
3
3
|
* Wraps both PUG REST and PUG View APIs behind a shared rate limiter.
|
|
4
4
|
* @module services/pubchem/pubchem-client
|
|
5
5
|
*/
|
|
6
|
-
import type { BioactivityRow, CompoundClassification, GHSClassification } from './types.js';
|
|
6
|
+
import type { BioactivityRow, CompoundClassification, GHSClassification, InteractionsResult } from './types.js';
|
|
7
7
|
export declare class PubChemClient {
|
|
8
8
|
private readonly pugBase;
|
|
9
9
|
private readonly viewBase;
|
|
10
|
+
private readonly sdqBase;
|
|
10
11
|
private readonly rateLimiter;
|
|
12
|
+
/** Shared HTTP core: rate-limit, 30s timeout, retry once on 5xx and once on a transient
|
|
13
|
+
* network error, and surface a clean timeout message. Returns the ok Response; callers
|
|
14
|
+
* extract the body (JSON, bytes, or text). Centralizing this keeps every fetch variant on
|
|
15
|
+
* one resilience contract — the divergence that left fetchBinary without retry or a clean
|
|
16
|
+
* timeout message (#16) cannot recur. */
|
|
17
|
+
private fetchResponse;
|
|
11
18
|
private fetchJson;
|
|
12
19
|
private fetchBinary;
|
|
20
|
+
/** Fetch a text/plain body (e.g. an SDF record). Non-2xx is classified and thrown. */
|
|
21
|
+
private fetchText;
|
|
13
22
|
/** Fetch CID list, with automatic ListKey polling for async searches */
|
|
14
23
|
private fetchCids;
|
|
15
24
|
/** Poll a PubChem ListKey until results are ready */
|
|
@@ -35,6 +44,32 @@ export declare class PubChemClient {
|
|
|
35
44
|
private parseAssayTable;
|
|
36
45
|
searchAssaysByTarget(targetType: string, query: string): Promise<number[]>;
|
|
37
46
|
getEntitySummary(entityType: string, identifier: string | number): Promise<Record<string, unknown> | null>;
|
|
47
|
+
/** Fetch drug-drug, drug-food, and/or chemical-target interactions for a compound.
|
|
48
|
+
* Drug-drug and target data live in PubChem SDQ external tables (drugbankddi,
|
|
49
|
+
* consolidatedcompoundtarget); drug-food is inline PUG View text. Each kind is capped
|
|
50
|
+
* at maxEntries; absent data for a kind contributes nothing rather than erroring. */
|
|
51
|
+
getInteractions(cid: number, kinds: Array<'drug-drug' | 'drug-food' | 'target'>, maxEntries: number): Promise<InteractionsResult>;
|
|
52
|
+
private getInteractionsForKind;
|
|
53
|
+
private getDrugDrugInteractions;
|
|
54
|
+
/** Chemical-target binding/activity from PubChem's `bioactivity` SDQ collection (BindingDB,
|
|
55
|
+
* ChEMBL, and others). That collection is cid-keyed and scopes correctly to the requested
|
|
56
|
+
* compound; the `consolidatedcompoundtarget` collection used previously is gene-indexed, so
|
|
57
|
+
* its `cid` filter was silently ignored — every CID returned the same default compound (#20).
|
|
58
|
+
* Only rows naming a molecular target are returned; untargeted assay outcomes are the domain
|
|
59
|
+
* of pubchem_get_bioactivity. */
|
|
60
|
+
private getTargetInteractions;
|
|
61
|
+
private getDrugFoodInteractions;
|
|
62
|
+
/** Query a PubChem SDQ external table for a single CID, projecting only the columns the
|
|
63
|
+
* caller maps. Projection keeps payloads small and excludes the free-text `citations` column
|
|
64
|
+
* whose unescaped quotes make PubChem emit invalid JSON (#20). Returns [] on not-found; on an
|
|
65
|
+
* unparseable body throws a contextful error rather than the bare `Failed to parse JSON`, so
|
|
66
|
+
* the caller and per-kind isolation can report it cleanly. */
|
|
67
|
+
private fetchSdq;
|
|
68
|
+
/** Fetch the default 3D conformer as raw V2000 SDF text. Throws a typed not-found when
|
|
69
|
+
* PubChem has no computed 3D coordinates (large molecules, mixtures, undefined salts). */
|
|
70
|
+
getSdf3d(cid: number): Promise<string>;
|
|
71
|
+
/** List the conformer IDs PubChem has computed for a compound. Returns [] on not-found. */
|
|
72
|
+
getConformerIds(cid: number): Promise<string[]>;
|
|
38
73
|
}
|
|
39
74
|
export declare function initPubChemClient(): void;
|
|
40
75
|
export declare function getPubChemClient(): PubChemClient;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pubchem-client.d.ts","sourceRoot":"","sources":["../../../src/services/pubchem/pubchem-client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAGV,cAAc,EAEd,sBAAsB,
|
|
1
|
+
{"version":3,"file":"pubchem-client.d.ts","sourceRoot":"","sources":["../../../src/services/pubchem/pubchem-client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAGV,cAAc,EAEd,sBAAsB,EAEtB,iBAAiB,EAEjB,kBAAkB,EAQnB,MAAM,YAAY,CAAC;AA8MpB,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA+C;IACvE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoD;IAC7E,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAuD;IAC/E,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAsB;IAIlD;;;;6CAIyC;YAC3B,aAAa;YA8Cb,SAAS;YAKT,WAAW;IAKzB,sFAAsF;YACxE,SAAS;IAOvB,wEAAwE;YAC1D,SAAS;IAWvB,qDAAqD;YACvC,WAAW;IAgBzB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAI7C,cAAc,CA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