# `pubchem__pubchem_get_compound_safety`

**Get Compound Safety**

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.

- Server: [PubChem](https://gateway.mcpharbor.dev/docs/servers/pubchem) (`dev.mcpharbor.gateway/pubchem`)
- Price per call: $0.0001 (100 micro-USD); only tools/call is charged
- Endpoint: `https://gateway.mcpharbor.dev/mcp` or `https://gateway.mcpharbor.dev/mcp/pubchem`
- Upstream tool: exposed by the provider; called through this gateway as `pubchem__pubchem_get_compound_safety`
- Provider terms: <https://www.ncbi.nlm.nih.gov/home/about/policies/> (verified 2026-09-19)
- Upstream API documentation: <https://pubchem.ncbi.nlm.nih.gov/docs/pug-rest>
- Rate limit: 350 requests per minute
- Attribution required: Attribution to source recommended, not mandatory

## Parameters

- `cids` (array, required): PubChem Compound IDs to fetch safety data for (1-25). Resolve from names/SMILES with pubchem_search_compounds.

## Example call

Request headers and body:

```http
POST /mcp HTTP/1.1
Host: gateway.mcpharbor.dev
Authorization: Bearer <your gateway API key>
Content-Type: application/json
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
Mcp-Method: tools/call
Mcp-Name: pubchem__pubchem_get_compound_safety
```

```json
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "_meta": {
      "io.modelcontextprotocol/clientCapabilities": {},
      "io.modelcontextprotocol/clientInfo": {
        "name": "example-agent",
        "version": "1.0.0"
      },
      "io.modelcontextprotocol/protocolVersion": "2026-07-28"
    },
    "arguments": {
      "cids": []
    },
    "name": "pubchem__pubchem_get_compound_safety"
  }
}
```

A successful response:

```json
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "_meta": {
      "dev.mcpharbor.gateway/call": {
        "chargedMicroUsd": 100,
        "id": "<the id of this charge>"
      }
    },
    "content": [
      {
        "text": "<whatever the upstream tool returned>",
        "type": "text"
      }
    ],
    "resultType": "complete"
  }
}
```

This call costs $0.0001 (100 micro-USD). Reading this page and listing the tool cost nothing.
The `dev.mcpharbor.gateway/call` record in the result is the receipt for that charge. Each
POST is metered separately, so sending the same call again buys another one: see
[agent.txt](https://gateway.mcpharbor.dev/agent.txt), section 7, before retrying.

## Attribution

This provider requires the attribution below wherever you use results from its tools.
Reproduce it verbatim:

> Attribution to source recommended, not mandatory

## Tool definition

Exactly as `tools/list` returns it (free):

```json
{
  "_meta": {
    "dev.mcpharbor.gateway/pricing": {
      "currency": "USD",
      "pricePerCallMicroUsd": 100
    }
  },
  "annotations": {
    "idempotentHint": true,
    "openWorldHint": true,
    "readOnlyHint": true
  },
  "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.",
  "inputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "additionalProperties": false,
    "properties": {
      "cids": {
        "description": "PubChem Compound IDs to fetch safety data for (1-25). Resolve from names/SMILES with pubchem_search_compounds.",
        "items": {
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991,
          "type": "integer"
        },
        "maxItems": 25,
        "minItems": 1,
        "type": "array"
      }
    },
    "required": [
      "cids"
    ],
    "type": "object"
  },
  "name": "pubchem__pubchem_get_compound_safety",
  "outputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "additionalProperties": false,
    "anyOf": [
      {
        "not": {
          "required": [
            "error"
          ]
        },
        "required": [
          "results",
          "requestedCount",
          "withDataCount"
        ]
      },
      {
        "required": [
          "error"
        ]
      }
    ],
    "properties": {
      "error": {
        "additionalProperties": {},
        "description": "Present when the call failed. Absent on success.",
        "properties": {
          "code": {
            "description": "JSON-RPC error code for this failure.",
            "maximum": 9007199254740991,
            "minimum": -9007199254740991,
            "type": "integer"
          },
          "data": {
            "additionalProperties": {},
            "properties": {
              "reason": {
                "description": "Machine-readable failure mode.",
                "type": "string"
              },
              "recovery": {
                "additionalProperties": {},
                "description": "Actionable next step for the caller.",
                "properties": {
                  "hint": {
                    "type": "string"
                  }
                },
                "required": [
                  "hint"
                ],
                "type": "object"
              },
              "retryable": {
                "description": "Whether retrying may succeed.",
                "type": "boolean"
              }
            },
            "type": "object"
          },
          "message": {
            "description": "Human-readable description of what went wrong.",
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "type": "object"
      },
      "notice": {
        "description": "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.",
        "type": "string"
      },
      "requestedCount": {
        "description": "CIDs requested.",
        "type": "number"
      },
      "results": {
        "description": "Safety results, one per requested CID (input order preserved).",
        "items": {
          "additionalProperties": false,
          "description": "Per-CID safety result.",
          "properties": {
            "cid": {
              "description": "PubChem Compound ID.",
              "type": "number"
            },
            "ghs": {
              "additionalProperties": false,
              "description": "GHS classification data.",
              "properties": {
                "hazardStatements": {
                  "description": "GHS hazard statements.",
                  "items": {
                    "additionalProperties": false,
                    "description": "GHS hazard statement entry.",
                    "properties": {
                      "code": {
                        "description": "H-code (e.g. \"H225\").",
                        "type": "string"
                      },
                      "statement": {
                        "description": "Hazard statement text.",
                        "type": "string"
                      }
                    },
                    "required": [
                      "code",
                      "statement"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "pictograms": {
                  "description": "GHS pictogram labels (e.g. \"Flammable\", \"Toxic\").",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "precautionaryStatements": {
                  "description": "GHS precautionary statements.",
                  "items": {
                    "additionalProperties": false,
                    "description": "GHS precautionary statement entry.",
                    "properties": {
                      "code": {
                        "description": "P-code (e.g. \"P210\").",
                        "type": "string"
                      },
                      "decoded": {
                        "description": "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.",
                        "type": "boolean"
                      },
                      "statement": {
                        "description": "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.",
                        "type": "string"
                      }
                    },
                    "required": [
                      "code",
                      "statement",
                      "decoded"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "signalWord": {
                  "description": "GHS signal word: \"Danger\" or \"Warning\".",
                  "type": "string"
                }
              },
              "required": [
                "pictograms",
                "hazardStatements",
                "precautionaryStatements"
              ],
              "type": "object"
            },
            "hasData": {
              "description": "Whether GHS safety data is available for this compound.",
              "type": "boolean"
            },
            "source": {
              "description": "Data source attribution.",
              "type": "string"
            },
            "status": {
              "description": "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.",
              "enum": [
                "ok",
                "no_ghs_data",
                "cid_not_found"
              ],
              "type": "string"
            }
          },
          "required": [
            "cid",
            "hasData",
            "status"
          ],
          "type": "object"
        },
        "type": "array"
      },
      "withDataCount": {
        "description": "CIDs with GHS safety data available.",
        "type": "number"
      }
    },
    "type": "object"
  },
  "title": "Get Compound Safety"
}
```
