Skip to main content
Glama

Get Compound Safety

pubchem_get_compound_safety
Read-onlyIdempotent

Retrieve GHS hazard classifications and safety data for compounds by PubChem CID, including signal words, pictograms, hazard (H) and precautionary (P) statements 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.

  1. Changed2 schema fields changedv0.6.5
    • removedInput schema / properties / cids / items / exclusiveMinimum
      Removed value: -0
    • addedInput schema / properties / cids / items / minimum
      Added value: +1
  2. 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"
      -]
  3. 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"
      +]
  4. 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"
      +]
  5. 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."
  6. First observedv0.1.11

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and idempotentHint, so no contradiction exists. The description adds valuable behavioral context by stating the data is sourced from PubChem depositors and that source attribution is included, which informs the agent about data provenance and potential variability without contradicting the openWorldHint.

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?

Three sentences with no filler: the first states the action and resource, the second enumerates the returned data types, and the third notes provenance. The most important scoping information is front-loaded.

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

Completeness5/5

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

This is a simple one-parameter, read-only, idempotent tool with a full output schema and annotations covering side effects and openness. The description supplies enough operational context—input format, output contents, and data source—so an agent can select and invoke it correctly without missing information.

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% and the schema already explains cids semantics, including the 1-25 range and the resolution workflow via pubchem_search_compounds. The description adds no additional parameter-level meaning beyond 'by CID', so a 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?

The description uses a specific verb ('Get') and resource ('GHS hazard classification and safety data') and specifies the input mechanism ('by CID'). It clearly distinguishes this tool from siblings like pubchem_get_compound_details and pubchem_get_compound_image by focusing on safety/H-codes/P-codes.

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?

The description clearly scopes the tool to GHS safety data, which implies when it should be used, and the input schema reinforces that names/SMILES must be resolved via pubchem_search_compounds first. It does not explicitly name alternatives or exclusions, but the uniqueness of the safety-data purpose makes the intended usage unambiguous.

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