Skip to main content
Glama

Get PubChem compound attributes

get_compound_attributes_from_pubchem
Read-only

Retrieve core PubChem compound attributes by CID, including IUPAC name, molecular formula, weight, SMILES, InChI, IRI, and structure image URL for chemical data lookup.

Instructions

Get core attributes of one PubChem compound: IUPAC name, molecular formula, molecular weight, SMILES, InChI, its identifiers.org IRI and a structure-image URL. Served by a DBCLS SPARQList API over PubChem RDF (https://togodx.dbcls.jp/human/sparqlist/api/metastanza_pubchem_compound).

RETURNS a JSON array string with one object for the CID (keys ID, URL, label, molecular_formula, molecular_weight, SMILES, InChI, formula_img). An unknown CID is NOT an error: it returns the same object with label, molecular_formula, SMILES and InChI as empty strings — treat an empty label as "not found". On upstream/HTTP failure this tool does NOT raise — it returns a plain string beginning with "Error:" (not JSON). check for the "Error:" prefix before parsing.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "pubchem_compound_id": "<pubchem_compound_id>"
    },
    "name": "get_compound_attributes_from_pubchem"
  }
}

Input Schema

NameRequiredDescriptionDefault
pubchem_compound_idYesPubChem Compound ID (CID), e.g. "445154".

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.0.0
    • addedInput schema / properties / pubchem_compound_id / description
      Added value: +"PubChem Compound ID (CID), e.g. \"445154\"."
  2. First observedv0.1.0

TDQS

A4/5.0
Behavior5/5

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

Goes well beyond the readOnlyHint/openWorldHint annotations by disclosing the exact return payload keys, that an unknown CID is not an error but yields empty label/formula/SMILES/InChI fields, and that upstream HTTP failure returns a plain string starting with 'Error:' rather than raising. Those two non-obvious failure modes are precisely the kind of behavior an agent would otherwise get wrong.

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

Conciseness4/5

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

Front-loaded with purpose, then returns, then error handling — a sensible ordering. The enumeration of return keys is somewhat redundant given an output schema exists, but the not-found and 'Error:' guidance earns its space.

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?

For a single-parameter read tool this covers everything an agent needs: what comes back, how to detect a missing compound, and how to detect an upstream failure that bypasses structured error handling. The non-JSON error string is a gap an output schema could not express, so stating it here is essential.

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 gives a CID example ('445154'), so the description adds little about the parameter itself. Its indirect contribution is describing what an unresolvable CID produces, which is helpful but is really return-value semantics rather than parameter semantics.

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

Purpose4/5

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

States a specific verb and resource ('Get core attributes of one PubChem compound') and enumerates exactly which attributes come back (IUPAC name, formula, weight, SMILES, InChI, IRI, image URL). It does not explicitly distinguish itself from the sibling get_pubchem_compound_id, so an agent must infer that this tool takes a CID whereas the sibling likely resolves names to CIDs.

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

Usage Guidelines3/5

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

Usage is implied by the required CID parameter: use this when you already have a PubChem CID and want its chemical attributes. There is no explicit statement of when to prefer a sibling such as get_pubchem_compound_id or search_chembl_molecule, and no prerequisite guidance is given.

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