@cyanheads/pubchem-mcp-server 0.4.1 → 0.4.2
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/Dockerfile +11 -7
- package/LICENSE +1 -1
- package/README.md +1 -1
- package/dist/mcp-server/resources/definitions/compound-safety.resource.d.ts.map +1 -1
- package/dist/mcp-server/resources/definitions/compound-safety.resource.js +12 -8
- package/dist/mcp-server/resources/definitions/compound-safety.resource.js.map +1 -1
- package/dist/mcp-server/resources/definitions/index.d.ts +3 -3
- package/dist/mcp-server/resources/definitions/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-bioactivity.tool.d.ts +1 -1
- package/dist/mcp-server/tools/definitions/get-compound-3d-structure.tool.d.ts +1 -1
- package/dist/mcp-server/tools/definitions/get-compound-image.tool.d.ts +1 -1
- package/dist/mcp-server/tools/definitions/get-compound-interactions.tool.d.ts +0 -1
- package/dist/mcp-server/tools/definitions/get-compound-interactions.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-compound-interactions.tool.js +1 -6
- package/dist/mcp-server/tools/definitions/get-compound-interactions.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-compound-safety.tool.d.ts +6 -0
- 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 +51 -22
- package/dist/mcp-server/tools/definitions/get-compound-safety.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/index.d.ts +200 -195
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-assays.tool.d.ts +2 -2
- package/dist/mcp-server/tools/definitions/search-compounds.tool.d.ts +6 -6
- package/dist/mcp-server/tools/definitions/search-compounds.tool.js.map +1 -1
- package/dist/services/pubchem/pubchem-client.d.ts +8 -2
- package/dist/services/pubchem/pubchem-client.d.ts.map +1 -1
- package/dist/services/pubchem/pubchem-client.js +90 -23
- package/dist/services/pubchem/pubchem-client.js.map +1 -1
- package/dist/services/pubchem/types.d.ts +24 -6
- 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 +11 -10
- package/server.json +3 -3
package/Dockerfile
CHANGED
|
@@ -4,15 +4,17 @@
|
|
|
4
4
|
# This stage installs all dependencies (including dev), builds the TypeScript
|
|
5
5
|
# source code into JavaScript, and prepares the production assets.
|
|
6
6
|
# ==============================================================================
|
|
7
|
-
FROM oven/bun:1.3 AS build
|
|
7
|
+
FROM oven/bun:1.3.14 AS build
|
|
8
8
|
|
|
9
9
|
WORKDIR /usr/src/app
|
|
10
10
|
|
|
11
11
|
# Copy dependency manifests for optimized layer caching
|
|
12
12
|
COPY package.json bun.lock ./
|
|
13
13
|
|
|
14
|
-
# Install all dependencies (including dev dependencies for building)
|
|
15
|
-
|
|
14
|
+
# Install all dependencies (including dev dependencies for building).
|
|
15
|
+
# The BuildKit cache mount persists Bun's global package cache across builds.
|
|
16
|
+
RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
17
|
+
bun install --frozen-lockfile --ignore-scripts
|
|
16
18
|
|
|
17
19
|
# Copy the rest of the source code
|
|
18
20
|
COPY . .
|
|
@@ -28,7 +30,7 @@ RUN bun run build
|
|
|
28
30
|
# application. It uses a slim base image and only includes production
|
|
29
31
|
# dependencies and build artifacts.
|
|
30
32
|
# ==============================================================================
|
|
31
|
-
FROM oven/bun:1.3-slim AS production
|
|
33
|
+
FROM oven/bun:1.3.14-slim AS production
|
|
32
34
|
|
|
33
35
|
WORKDIR /usr/src/app
|
|
34
36
|
|
|
@@ -51,15 +53,17 @@ COPY package.json bun.lock ./
|
|
|
51
53
|
# that are not needed in the final production image.
|
|
52
54
|
# Remove platform-specific bun/rollup binaries pulled as optionalDependencies
|
|
53
55
|
# by @modelcontextprotocol/ext-apps — only needed for its build toolchain, not runtime.
|
|
54
|
-
RUN bun
|
|
56
|
+
RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
57
|
+
bun install --production --frozen-lockfile --ignore-scripts \
|
|
55
58
|
&& rm -rf node_modules/@oven node_modules/@rollup
|
|
56
59
|
|
|
57
60
|
# Conditionally install OpenTelemetry optional peer dependencies (Tier 3).
|
|
58
61
|
# These are not bundled by default to keep the base image lean. Enable at build time
|
|
59
62
|
# with: docker build --build-arg OTEL_ENABLED=true
|
|
60
63
|
ARG OTEL_ENABLED=true
|
|
61
|
-
RUN
|
|
62
|
-
|
|
64
|
+
RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
65
|
+
if [ "$OTEL_ENABLED" = "true" ]; then \
|
|
66
|
+
bun add --omit=dev --ignore-scripts @hono/otel \
|
|
63
67
|
@opentelemetry/instrumentation-http \
|
|
64
68
|
@opentelemetry/exporter-metrics-otlp-http \
|
|
65
69
|
@opentelemetry/exporter-trace-otlp-http \
|
package/LICENSE
CHANGED
|
@@ -175,7 +175,7 @@
|
|
|
175
175
|
|
|
176
176
|
END OF TERMS AND CONDITIONS
|
|
177
177
|
|
|
178
|
-
Copyright 2025 Casey Hand
|
|
178
|
+
Copyright 2025 Casey Hand @cyanheads
|
|
179
179
|
|
|
180
180
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
181
|
you may not use this file except in compliance with the License.
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](./CHANGELOG.md) [](./LICENSE) [](https://github.com/users/cyanheads/packages/container/package/pubchem-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/@cyanheads/pubchem-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compound-safety.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/compound-safety.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAGrD,eAAO,MAAM,sBAAsB;;
|
|
1
|
+
{"version":3,"file":"compound-safety.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/compound-safety.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAGrD,eAAO,MAAM,sBAAsB;;wCA8BjC,CAAC"}
|
|
@@ -13,19 +13,23 @@ export const compoundSafetyResource = resource('pubchem://compound/{cid}/safety'
|
|
|
13
13
|
}),
|
|
14
14
|
async handler(params) {
|
|
15
15
|
const client = getPubChemClient();
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
const lookup = await client.getSafetyData(params.cid);
|
|
17
|
+
// A resource returns raw JSON with no notice surface, so `status` is the only way a reader
|
|
18
|
+
// can tell a mistyped CID from a compound that genuinely carries no GHS classification.
|
|
19
|
+
if (lookup.status !== 'ok') {
|
|
20
|
+
return { cid: params.cid, hasData: false, status: lookup.status };
|
|
21
|
+
}
|
|
19
22
|
return {
|
|
20
23
|
cid: params.cid,
|
|
21
24
|
hasData: true,
|
|
25
|
+
status: lookup.status,
|
|
22
26
|
ghs: {
|
|
23
|
-
signalWord:
|
|
24
|
-
pictograms:
|
|
25
|
-
hazardStatements:
|
|
26
|
-
precautionaryStatements:
|
|
27
|
+
signalWord: lookup.ghs.signalWord,
|
|
28
|
+
pictograms: lookup.ghs.pictograms,
|
|
29
|
+
hazardStatements: lookup.ghs.hazardStatements,
|
|
30
|
+
precautionaryStatements: lookup.ghs.precautionaryStatements,
|
|
27
31
|
},
|
|
28
|
-
source:
|
|
32
|
+
source: lookup.ghs.source,
|
|
29
33
|
};
|
|
30
34
|
},
|
|
31
35
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compound-safety.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/compound-safety.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,MAAM,CAAC,MAAM,sBAAsB,GAAG,QAAQ,CAAC,iCAAiC,EAAE;IAChF,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EACT,gGAAgG;IAClG,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC;KACzE,CAAC;IAEF,KAAK,CAAC,OAAO,CAAC,MAAM;QAClB,MAAM,MAAM,GAAG,gBAAgB,EAAE,CAAC;QAClC,MAAM,
|
|
1
|
+
{"version":3,"file":"compound-safety.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/compound-safety.resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,MAAM,CAAC,MAAM,sBAAsB,GAAG,QAAQ,CAAC,iCAAiC,EAAE;IAChF,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EACT,gGAAgG;IAClG,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC;KACzE,CAAC;IAEF,KAAK,CAAC,OAAO,CAAC,MAAM;QAClB,MAAM,MAAM,GAAG,gBAAgB,EAAE,CAAC;QAClC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACtD,2FAA2F;QAC3F,wFAAwF;QACxF,IAAI,MAAM,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;YAC3B,OAAO,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;QACpE,CAAC;QACD,OAAO;YACL,GAAG,EAAE,MAAM,CAAC,GAAG;YACf,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,GAAG,EAAE;gBACH,UAAU,EAAE,MAAM,CAAC,GAAG,CAAC,UAAU;gBACjC,UAAU,EAAE,MAAM,CAAC,GAAG,CAAC,UAAU;gBACjC,gBAAgB,EAAE,MAAM,CAAC,GAAG,CAAC,gBAAgB;gBAC7C,uBAAuB,EAAE,MAAM,CAAC,GAAG,CAAC,uBAAuB;aAC5D;YACD,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM;SAC1B,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
* @module mcp-server/resources/definitions
|
|
4
4
|
*/
|
|
5
5
|
export declare const allResourceDefinitions: (import("@cyanheads/mcp-ts-core").ResourceDefinition<import("zod").ZodObject<{
|
|
6
|
-
aid: import("zod").ZodCoercedNumber<unknown>;
|
|
7
|
-
}, import("zod/v4/core").$strip>, undefined, undefined> | import("@cyanheads/mcp-ts-core").ResourceDefinition<import("zod").ZodObject<{
|
|
8
6
|
cid: import("zod").ZodCoercedNumber<unknown>;
|
|
9
7
|
}, import("zod/v4/core").$strip>, undefined, undefined> | import("@cyanheads/mcp-ts-core").ResourceDefinition<import("zod").ZodObject<{
|
|
10
8
|
cid: import("zod").ZodCoercedNumber<unknown>;
|
|
11
9
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
12
10
|
base64: import("zod").ZodString;
|
|
13
|
-
}, import("zod/v4/core").$strip>, undefined>)
|
|
11
|
+
}, import("zod/v4/core").$strip>, undefined> | import("@cyanheads/mcp-ts-core").ResourceDefinition<import("zod").ZodObject<{
|
|
12
|
+
aid: import("zod").ZodCoercedNumber<unknown>;
|
|
13
|
+
}, import("zod/v4/core").$strip>, undefined, undefined>)[];
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,eAAO,MAAM,sBAAsB;;;;;;;;0DAOlC,CAAC"}
|
|
@@ -8,8 +8,8 @@ export declare const getBioactivity: import("@cyanheads/mcp-ts-core").ToolDefini
|
|
|
8
8
|
cid: z.ZodNumber;
|
|
9
9
|
outcomeFilter: z.ZodDefault<z.ZodEnum<{
|
|
10
10
|
active: "active";
|
|
11
|
-
inactive: "inactive";
|
|
12
11
|
all: "all";
|
|
12
|
+
inactive: "inactive";
|
|
13
13
|
}>>;
|
|
14
14
|
targetGeneId: z.ZodOptional<z.ZodNumber>;
|
|
15
15
|
targetAccession: z.ZodOptional<z.ZodString>;
|
|
@@ -7,8 +7,8 @@ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
|
7
7
|
export declare const getCompound3dStructure: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
8
8
|
cid: z.ZodNumber;
|
|
9
9
|
format: z.ZodDefault<z.ZodEnum<{
|
|
10
|
-
sdf: "sdf";
|
|
11
10
|
json: "json";
|
|
11
|
+
sdf: "sdf";
|
|
12
12
|
}>>;
|
|
13
13
|
includeAlternateConformerIds: z.ZodDefault<z.ZodBoolean>;
|
|
14
14
|
maxAtoms: z.ZodOptional<z.ZodNumber>;
|
|
@@ -7,8 +7,8 @@ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
|
7
7
|
export declare const getCompoundImage: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
8
8
|
cid: z.ZodNumber;
|
|
9
9
|
size: z.ZodDefault<z.ZodEnum<{
|
|
10
|
-
small: "small";
|
|
11
10
|
large: "large";
|
|
11
|
+
small: "small";
|
|
12
12
|
}>>;
|
|
13
13
|
}, z.core.$strip>, z.ZodObject<{
|
|
14
14
|
cid: z.ZodNumber;
|
|
@@ -21,7 +21,6 @@ export declare const getCompoundInteractions: import("@cyanheads/mcp-ts-core").T
|
|
|
21
21
|
}>;
|
|
22
22
|
partner: z.ZodOptional<z.ZodString>;
|
|
23
23
|
source: z.ZodString;
|
|
24
|
-
severity: z.ZodOptional<z.ZodString>;
|
|
25
24
|
text: z.ZodString;
|
|
26
25
|
}, z.core.$strip>>;
|
|
27
26
|
}, z.core.$strip>, undefined, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-compound-interactions.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-compound-interactions.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAIjD,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"get-compound-interactions.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-compound-interactions.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAIjD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;EA+HlC,CAAC"}
|
|
@@ -43,10 +43,6 @@ export const getCompoundInteractions = tool('pubchem_get_compound_interactions',
|
|
|
43
43
|
.optional()
|
|
44
44
|
.describe('Interacting compound, food, or target name as the source reports it.'),
|
|
45
45
|
source: z.string().describe('Originating source (e.g. "DrugBank", "BindingDB").'),
|
|
46
|
-
severity: z
|
|
47
|
-
.string()
|
|
48
|
-
.optional()
|
|
49
|
-
.describe('Raw severity as the source reports it — not normalized across sources, and frequently unset (most sources embed severity in the statement text).'),
|
|
50
46
|
text: z.string().describe('The interaction statement.'),
|
|
51
47
|
})
|
|
52
48
|
.describe('A single interaction entry.'))
|
|
@@ -102,8 +98,7 @@ export const getCompoundInteractions = tool('pubchem_get_compound_interactions',
|
|
|
102
98
|
}
|
|
103
99
|
for (const e of result.entries) {
|
|
104
100
|
const partner = e.partner ? ` **${inlineData(e.partner)}**` : '';
|
|
105
|
-
|
|
106
|
-
lines.push(`- (${e.kind})${partner}${severity} _(source: ${inlineData(e.source)})_`);
|
|
101
|
+
lines.push(`- (${e.kind})${partner} _(source: ${inlineData(e.source)})_`);
|
|
107
102
|
// The interaction statement is upstream free text — render it as an
|
|
108
103
|
// indented blockquote so the data/instruction boundary is explicit.
|
|
109
104
|
for (const q of quoteData(e.text).split('\n'))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-compound-interactions.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-compound-interactions.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,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC,mCAAmC,EAAE;IAC/E,KAAK,EAAE,2BAA2B;IAClC,WAAW,EACT,oTAAoT;IACtT,WAAW,EAAE;QACX,YAAY,EAAE,IAAI;QAClB,cAAc,EAAE,IAAI;QACpB,aAAa,EAAE,IAAI;KACpB;IACD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,GAAG,EAAE,CAAC;aACH,MAAM,EAAE;aACR,GAAG,EAAE;aACL,QAAQ,EAAE;aACV,QAAQ,CAAC,8EAA8E,CAAC;QAC3F,KAAK,EAAE,CAAC;aACL,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;aACnD,GAAG,CAAC,CAAC,CAAC;aACN,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC;aACtB,QAAQ,CACP,6LAA6L,CAC9L;QACH,UAAU,EAAE,CAAC;aACV,MAAM,EAAE;aACR,GAAG,EAAE;aACL,GAAG,CAAC,CAAC,CAAC;aACN,GAAG,CAAC,EAAE,CAAC;aACP,OAAO,CAAC,EAAE,CAAC;aACX,QAAQ,CACP,gGAAgG,CACjG;KACJ,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC;QAChD,OAAO,EAAE,CAAC;aACP,KAAK,CACJ,CAAC;aACE,MAAM,CAAC;YACN,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,uBAAuB,CAAC;YACpF,OAAO,EAAE,CAAC;iBACP,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CAAC,sEAAsE,CAAC;YACnF,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oDAAoD,CAAC;YACjF,
|
|
1
|
+
{"version":3,"file":"get-compound-interactions.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-compound-interactions.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,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|
11
11
|
hasData: z.ZodBoolean;
|
|
12
|
+
status: z.ZodEnum<{
|
|
13
|
+
cid_not_found: "cid_not_found";
|
|
14
|
+
no_ghs_data: "no_ghs_data";
|
|
15
|
+
ok: "ok";
|
|
16
|
+
}>;
|
|
12
17
|
ghs: z.ZodOptional<z.ZodObject<{
|
|
13
18
|
signalWord: z.ZodOptional<z.ZodString>;
|
|
14
19
|
pictograms: z.ZodArray<z.ZodString>;
|
|
@@ -19,6 +24,7 @@ export declare const getCompoundSafety: import("@cyanheads/mcp-ts-core").ToolDef
|
|
|
19
24
|
precautionaryStatements: z.ZodArray<z.ZodObject<{
|
|
20
25
|
code: z.ZodString;
|
|
21
26
|
statement: z.ZodString;
|
|
27
|
+
decoded: z.ZodBoolean;
|
|
22
28
|
}, z.core.$strip>>;
|
|
23
29
|
}, z.core.$strip>>;
|
|
24
30
|
source: z.ZodOptional<z.ZodString>;
|
|
@@ -1 +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;
|
|
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;AA4CjD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuK5B,CAAC"}
|
|
@@ -21,7 +21,12 @@ const ghsSchema = z
|
|
|
21
21
|
.array(z
|
|
22
22
|
.object({
|
|
23
23
|
code: z.string().describe('P-code (e.g. "P210").'),
|
|
24
|
-
statement: z
|
|
24
|
+
statement: z
|
|
25
|
+
.string()
|
|
26
|
+
.describe('Standard precautionary statement text for the code. Empty string when "decoded" is false — PubChem deposits P-codes without text, so a blank statement means the code was not decoded, never that the depositor supplied an empty statement.'),
|
|
27
|
+
decoded: z
|
|
28
|
+
.boolean()
|
|
29
|
+
.describe('Whether "statement" carries the standard text. False for codes needing label-specific fill text the depositor must supply (disposal method, firefighting agent, first-aid reference) and for codes outside the decoder table; the code itself is still authoritative.'),
|
|
25
30
|
})
|
|
26
31
|
.describe('GHS precautionary statement entry.'))
|
|
27
32
|
.describe('GHS precautionary statements.'),
|
|
@@ -52,58 +57,74 @@ export const getCompoundSafety = tool('pubchem_get_compound_safety', {
|
|
|
52
57
|
hasData: z
|
|
53
58
|
.boolean()
|
|
54
59
|
.describe('Whether GHS safety data is available for this compound.'),
|
|
60
|
+
status: z
|
|
61
|
+
.enum(['ok', 'no_ghs_data', 'cid_not_found'])
|
|
62
|
+
.describe('Outcome for this CID. "ok": GHS data returned. "no_ghs_data": the compound exists in PubChem but has no deposited GHS classification. "cid_not_found": PubChem has no record for this CID at all — the identifier is wrong, so verify it with pubchem_search_compounds rather than concluding the compound is unclassified.'),
|
|
55
63
|
ghs: ghsSchema.optional(),
|
|
56
64
|
source: z.string().optional().describe('Data source attribution.'),
|
|
57
65
|
})
|
|
58
66
|
.describe('Per-CID safety result.'))
|
|
59
67
|
.describe('Safety results, one per requested CID (input order preserved).'),
|
|
60
68
|
}),
|
|
61
|
-
// Agent-facing context — requested/with-data counts and a
|
|
62
|
-
//
|
|
69
|
+
// Agent-facing context — requested/with-data counts and a notice that names the CIDs behind
|
|
70
|
+
// each non-ok status separately. Reaches structuredContent and content[]; keys disjoint from
|
|
71
|
+
// output.
|
|
63
72
|
enrichment: {
|
|
64
73
|
requestedCount: z.number().describe('CIDs requested.'),
|
|
65
74
|
withDataCount: z.number().describe('CIDs with GHS safety data available.'),
|
|
66
75
|
notice: z
|
|
67
76
|
.string()
|
|
68
77
|
.optional()
|
|
69
|
-
.describe('
|
|
78
|
+
.describe('Recovery guidance when one or more CIDs returned no GHS data, listing the unrecognized CIDs to verify separately from the CIDs that exist but carry no deposited classification.'),
|
|
70
79
|
},
|
|
71
80
|
async handler(input, ctx) {
|
|
72
81
|
const client = getPubChemClient();
|
|
73
82
|
// Fan out per CID, capped at MAX_IN_FLIGHT in flight.
|
|
74
|
-
const
|
|
83
|
+
const lookupByCid = new Map();
|
|
75
84
|
for (let i = 0; i < input.cids.length; i += MAX_IN_FLIGHT) {
|
|
76
85
|
const chunk = input.cids.slice(i, i + MAX_IN_FLIGHT);
|
|
77
86
|
const chunkData = await Promise.all(chunk.map(async (cid) => [cid, await client.getSafetyData(cid)]));
|
|
78
|
-
for (const [cid,
|
|
79
|
-
|
|
87
|
+
for (const [cid, lookup] of chunkData)
|
|
88
|
+
lookupByCid.set(cid, lookup);
|
|
80
89
|
}
|
|
81
90
|
const results = input.cids.map((cid) => {
|
|
82
|
-
const
|
|
83
|
-
if (
|
|
84
|
-
return { cid, hasData: false };
|
|
91
|
+
const lookup = lookupByCid.get(cid) ?? { status: 'no_ghs_data' };
|
|
92
|
+
if (lookup.status !== 'ok')
|
|
93
|
+
return { cid, hasData: false, status: lookup.status };
|
|
85
94
|
return {
|
|
86
95
|
cid,
|
|
87
96
|
hasData: true,
|
|
97
|
+
status: lookup.status,
|
|
88
98
|
ghs: {
|
|
89
|
-
signalWord:
|
|
90
|
-
pictograms:
|
|
91
|
-
hazardStatements:
|
|
92
|
-
precautionaryStatements:
|
|
99
|
+
signalWord: lookup.ghs.signalWord,
|
|
100
|
+
pictograms: lookup.ghs.pictograms,
|
|
101
|
+
hazardStatements: lookup.ghs.hazardStatements,
|
|
102
|
+
precautionaryStatements: lookup.ghs.precautionaryStatements,
|
|
93
103
|
},
|
|
94
|
-
source:
|
|
104
|
+
source: lookup.ghs.source,
|
|
95
105
|
};
|
|
96
106
|
});
|
|
97
107
|
const withDataCount = results.filter((r) => r.hasData).length;
|
|
108
|
+
const unknownCids = results.filter((r) => r.status === 'cid_not_found').map((r) => r.cid);
|
|
109
|
+
const noDataCids = results.filter((r) => r.status === 'no_ghs_data').map((r) => r.cid);
|
|
98
110
|
ctx.log.info('Safety data fetched', {
|
|
99
111
|
requested: input.cids.length,
|
|
100
112
|
withData: withDataCount,
|
|
113
|
+
notFound: unknownCids.length,
|
|
101
114
|
});
|
|
102
115
|
ctx.enrich({ requestedCount: input.cids.length, withDataCount });
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
116
|
+
// Unknown CIDs lead: a wrong identifier invalidates the question, whereas a real compound
|
|
117
|
+
// without GHS data is a real answer. Collapsing the two is what made a mistyped CID read
|
|
118
|
+
// as a confident "no hazards on file".
|
|
119
|
+
const notices = [];
|
|
120
|
+
if (unknownCids.length > 0) {
|
|
121
|
+
notices.push(`PubChem has no record for ${unknownCids.length} of ${input.cids.length} CID(s): ${unknownCids.join(', ')} — verify the CID with pubchem_search_compounds. Nothing was evaluated for these identifiers, so they say nothing about any compound's hazards.`);
|
|
122
|
+
}
|
|
123
|
+
if (noDataCids.length > 0) {
|
|
124
|
+
notices.push(`No GHS classification on file for ${noDataCids.length} of ${input.cids.length} CID(s): ${noDataCids.join(', ')}. These compounds exist in PubChem but have no deposited safety data — try pubchem_get_compound_details with includeDescription for hazard context.`);
|
|
106
125
|
}
|
|
126
|
+
if (notices.length > 0)
|
|
127
|
+
ctx.enrich.notice(notices.join(' '));
|
|
107
128
|
return { results };
|
|
108
129
|
},
|
|
109
130
|
format(result) {
|
|
@@ -113,10 +134,18 @@ export const getCompoundSafety = tool('pubchem_get_compound_safety', {
|
|
|
113
134
|
const blocks = [];
|
|
114
135
|
for (const r of result.results) {
|
|
115
136
|
if (!r.hasData || !r.ghs) {
|
|
116
|
-
blocks.push(
|
|
137
|
+
blocks.push(...(r.status === 'cid_not_found'
|
|
138
|
+
? [
|
|
139
|
+
`## CID ${r.cid} — no PubChem record`,
|
|
140
|
+
'**Status:** cid_not_found — PubChem has no compound with this CID, so nothing was evaluated for safety. Verify it with pubchem_search_compounds.',
|
|
141
|
+
]
|
|
142
|
+
: [
|
|
143
|
+
`## CID ${r.cid} — no GHS safety data`,
|
|
144
|
+
'**Status:** no_ghs_data — the compound exists in PubChem but has no deposited GHS classification.',
|
|
145
|
+
]), '');
|
|
117
146
|
continue;
|
|
118
147
|
}
|
|
119
|
-
const lines = [`## GHS Safety Data — CID ${r.cid}`];
|
|
148
|
+
const lines = [`## GHS Safety Data — CID ${r.cid}`, `**Status:** ${r.status}`];
|
|
120
149
|
const g = r.ghs;
|
|
121
150
|
if (g.signalWord)
|
|
122
151
|
lines.push(`**Signal Word:** ${g.signalWord}`);
|
|
@@ -128,9 +157,9 @@ export const getCompoundSafety = tool('pubchem_get_compound_safety', {
|
|
|
128
157
|
lines.push(` ${h.code}: ${inlineData(h.statement)}`);
|
|
129
158
|
}
|
|
130
159
|
if (g.precautionaryStatements.length > 0) {
|
|
131
|
-
lines.push('', '**Precautionary Statements:**');
|
|
160
|
+
lines.push('', '**Precautionary Statements:** (PubChem deposits bare P-codes; any not decoded below is a decoder gap or a code needing label-specific fill text, not an empty statement)');
|
|
132
161
|
for (const p of g.precautionaryStatements) {
|
|
133
|
-
lines.push(p.
|
|
162
|
+
lines.push(p.decoded ? ` ${p.code}: ${inlineData(p.statement)}` : ` ${p.code}: (not decoded)`);
|
|
134
163
|
}
|
|
135
164
|
}
|
|
136
165
|
if (r.source)
|
|
@@ -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;AAExE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,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,KAAK,CACJ,CAAC;SACE,MAAM,CAAC;QACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QAClD,SAAS,EAAE,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;AAExE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,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,I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