Skip to main content
Glama

Look up PubChem compound ID

get_pubchem_compound_id
Read-only

Look up PubChem compound IDs (CIDs) from a compound name using PubChem synonym matching, including common, IUPAC, and trade names; one name may return multiple CIDs.

Instructions

Get the PubChem compound ID(s) (CID) for a compound name, via the PubChem PUG-REST name lookup (https://pubchem.ncbi.nlm.nih.gov/rest/pug/). The name is matched against PubChem synonyms (common, IUPAC, trade names), so one name can map to more than one CID.

RETURNS PubChem's JSON verbatim as a string: {"IdentifierList": {"CID": [445154, ...]}}. 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": {
      "compound_name": "<compound_name>"
    },
    "name": "get_pubchem_compound_id"
  }
}

Input Schema

NameRequiredDescriptionDefault
compound_nameYesCompound name, e.g. "resveratrol".

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.0.0
    • addedInput schema / properties / compound_name / description
      Added value: +"Compound name, e.g. \"resveratrol\"."
  2. First observedv0.1.0

TDQS

A4.1/5.0
Behavior5/5

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

With readOnlyHint and openWorldHint already supplied, the description adds high-value behavior: a single name may map to multiple CIDs, output is raw PubChem JSON as a string with a concrete shape, and failures do not raise but return an "Error:"-prefixed string. That error contract is exactly the kind of non-obvious behavior an agent must know.

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 the operation, then the matching semantics, then the return/error contract. The content earns its place, but embedded line breaks inside sentences (e.g., "PubChem\nPUG-REST") slightly hurt readability.

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 simple one-parameter lookup, the description covers input semantics, result variability, return format, and the critical non-raising error behavior. Even with an output schema present, the explicit error-prefix warning makes the definition complete for correct invocation and parsing.

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

Parameters4/5

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

Schema coverage is 100%, so the single compound_name parameter is already documented with an example. The description adds meaning beyond the schema by explaining that the name is matched against PubChem synonyms including common, IUPAC, and trade names, which affects what inputs are valid and why multiple CIDs can result.

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 PubChem compound ID(s) for a compound name via the PUG-REST name lookup. The mechanism and the one-to-many synonym mapping are clear, though no sibling is named explicitly for differentiation.

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: use when you have a compound name and need its PubChem CID(s). It does not say when to prefer this over get_compound_attributes_from_pubchem or other identifier-search tools, nor does it state exclusions.

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