Skip to main content
Glama

Get Compound Safety

pubchem_get_compound_safety
Read-onlyIdempotent

Retrieve GHS hazard classifications and safety data for PubChem compounds by CID, including signal words, pictograms, H-codes, and P-codes with source attribution.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cidsYesPubChem Compound IDs to fetch safety data for (1-25). Resolve from names/SMILES with pubchem_search_compounds.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNoPresent when the call failed. Absent on success.
noticeNoRecovery 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.
resultsNoSafety results, one per requested CID (input order preserved).
withDataCountNoCIDs with GHS safety data available.
requestedCountNoCIDs requested.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed6 schema fields changedv0.6.1
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / additionalProperties
      Added value: +false
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedOutput schema / anyOf
      Added value: +[
      +  {
      +    "not": {
      +      "required": [
      +        "error"
      +      ]
      +    },
      +    "required": [
      +      "results",
      +      "requestedCount",
      +      "withDataCount"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "error"
      +    ]
      +  }
      +]
    • addedOutput schema / properties / error
      Added value: +{
      +  "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"
      +}
    • removedOutput schema / required
      Removed value: -[
      -  "results",
      -  "requestedCount",
      -  "withDataCount"
      -]
  2. Changed6 schema fields changedv0.6.0
    • changedOutput schema / properties / notice / description
      Previous value: -"Cross-tool guidance when one or more CIDs have no GHS data, pointing to an alternative source."New value: +"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."
    • addedOutput schema / properties / results / items / properties / ghs / properties / precautionaryStatements / items / properties / decoded
      Added value: +{
      +  "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"
      +}
    • changedOutput schema / properties / results / items / properties / ghs / properties / precautionaryStatements / items / properties / statement / description
      Previous value: -"Precautionary statement text."New value: +"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."
    • changedOutput schema / properties / results / items / properties / ghs / properties / precautionaryStatements / items / required
      Previous value: -[
      -  "code",
      -  "statement"
      -]New value: +[
      +  "code",
      +  "statement",
      +  "decoded"
      +]
    • addedOutput schema / properties / results / items / properties / status
      Added value: +{
      +  "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"
      +}
    • changedOutput schema / properties / results / items / required
      Previous value: -[
      -  "cid",
      -  "hasData"
      -]New value: +[
      +  "cid",
      +  "hasData",
      +  "status"
      +]
  3. Changed12 schema fields changedv0.2.2
    • removedInput schema / properties / cid
      Removed value: -{
      -  "description": "PubChem Compound ID. Resolve from name/SMILES with pubchem_search_compounds.",
      -  "exclusiveMinimum": 0,
      -  "maximum": 9007199254740991,
      -  "type": "integer"
      -}
    • addedInput schema / properties / cids
      Added value: +{
      +  "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"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "cid"
      -]New value: +[
      +  "cids"
      +]
    • removedOutput schema / properties / cid
      Removed value: -{
      -  "description": "PubChem Compound ID.",
      -  "type": "number"
      -}
    • removedOutput schema / properties / ghs
      Removed value: -{
      -  "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"
      -          },
      -          "statement": {
      -            "description": "Precautionary statement text.",
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "code",
      -          "statement"
      -        ],
      -        "type": "object"
      -      },
      -      "type": "array"
      -    },
      -    "signalWord": {
      -      "description": "GHS signal word: \"Danger\" or \"Warning\".",
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "pictograms",
      -    "hazardStatements",
      -    "precautionaryStatements"
      -  ],
      -  "type": "object"
      -}
    • removedOutput schema / properties / hasData
      Removed value: -{
      -  "description": "Whether GHS safety data is available for this compound.",
      -  "type": "boolean"
      -}
    • addedOutput schema / properties / notice
      Added value: +{
      +  "description": "Cross-tool guidance when one or more CIDs have no GHS data, pointing to an alternative source.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / requestedCount
      Added value: +{
      +  "description": "CIDs requested.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / results
      Added value: +{
      +  "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"
      +                },
      +                "statement": {
      +                  "description": "Precautionary statement text.",
      +                  "type": "string"
      +                }
      +              },
      +              "required": [
      +                "code",
      +                "statement"
      +              ],
      +              "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"
      +      }
      +    },
      +    "required": [
      +      "cid",
      +      "hasData"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • removedOutput schema / properties / source
      Removed value: -{
      -  "description": "Data source attribution.",
      -  "type": "string"
      -}
    • addedOutput schema / properties / withDataCount
      Added value: +{
      +  "description": "CIDs with GHS safety data available.",
      +  "type": "number"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "cid",
      -  "hasData"
      -]New value: +[
      +  "results",
      +  "requestedCount",
      +  "withDataCount"
      +]
  4. Changed3 schema fields changedv0.1.22
    • changedInput schema / properties / cid / description
      Previous value: -"PubChem Compound ID."New value: +"PubChem Compound ID. Resolve from name/SMILES with pubchem_search_compounds."
    • addedOutput schema / properties / ghs / properties / hazardStatements / items / description
      Added value: +"GHS hazard statement entry."
    • addedOutput schema / properties / ghs / properties / precautionaryStatements / items / description
      Added value: +"GHS precautionary statement entry."
  5. First observedv0.1.11

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare the operation read-only, idempotent, and open-world. The description adds useful context by stating data comes from PubChem depositors and that source attribution is included, which helps set expectations about provenance and potential incompleteness. No behavioral claims contradict the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with no wasted wording. The first sentence front-loads the purpose and input; the second concisely covers output contents and data provenance. Every clause earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter tool with full schema coverage, read-only annotations, and an output schema, the description provides enough information to select and invoke the tool correctly: purpose, input method, expected outputs, and source context. A minor gap is the absence of explicit routing guidance between safety data and the other compound-focused sibling tools, but this is not essential for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already fully documents the cids parameter, including the 1-25 count and the resolution pointer to pubchem_search_compounds. The tool description itself adds no additional parameter-level meaning, so the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific action ('Get'), a specific resource ('GHS hazard classification and safety data for one or more compounds by CID'), and enumerates the concrete return contents (signal word, pictograms, H-codes, P-codes). This clearly differentiates it from sibling tools like pubchem_get_compound_details or pubchem_get_summary.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides clear context for when to use the tool: when GHS safety data for known CIDs is needed. It does not explicitly name sibling alternatives or state exclusions, but the domain-specific focus makes the intended use evident. The schema-level hint to resolve CIDs via pubchem_search_compounds adds further guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cyanheads/pubchem-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server