Skip to main content
Glama

Get Compound Cross-References

pubchem_get_compound_xrefs
Read-onlyIdempotent

Retrieve external database cross-references for a compound: PubMed, patents, gene/protein, registry numbers, taxonomy IDs. Paginate with offset and maxPerType.

Instructions

Get external database cross-references for a compound: PubMed citations, patent IDs, gene/protein associations, registry numbers, and taxonomy IDs. Results are paged per type — capped at maxPerType with the total count reported; reach the IDs past a page with offset.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cidYesPubChem Compound ID. Resolve from name/SMILES with pubchem_search_compounds.
offsetNoZero-based index of the first ID to return within each xref type. The same offset is applied to every requested type. Pass the nextOffset from a previous call to read the following page. Default: 0.
xrefTypesYesCross-reference types to retrieve. String IDs: RegistryID (DSSTox/EPA registry numbers), RN (CAS numbers), PatentID. Numeric IDs: PubMedID, GeneID (NCBI Gene), ProteinGI (legacy NCBI Protein GI), TaxonomyID.
maxPerTypeNoMax IDs to return per xref type per page (1-500). A compound may have thousands of PubMed references; use offset to reach the ones past this page. Total count always reported. Default: 50.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
cidNoPubChem Compound ID.
errorNoPresent when the call failed. Absent on success.
xrefsNoCross-references grouped by type.
noticeNoRecovery guidance when every requested xref type returned zero IDs, when the offset runs past every type, or when further pages remain. Absent when this page is complete and non-empty.
offsetNoZero-based index of the first ID returned within each type.
truncatedNoTrue when at least one requested type has IDs remaining past this page. Which types, and how many IDs each holds in total, is in xrefs[].truncated / xrefs[].totalAvailable.
nextOffsetNoOffset to pass on the next call to continue past this page. Omitted when no requested type has further IDs.

Schema Changelog

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

  1. Changed7 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": [
      +      "cid",
      +      "xrefs",
      +      "offset",
      +      "truncated"
      +    ]
      +  },
      +  {
      +    "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"
      +}
    • addedOutput schema / properties / truncated
      Added value: +{
      +  "description": "True when at least one requested type has IDs remaining past this page. Which types, and how many IDs each holds in total, is in xrefs[].truncated / xrefs[].totalAvailable.",
      +  "type": "boolean"
      +}
    • removedOutput schema / required
      Removed value: -[
      -  "cid",
      -  "xrefs",
      -  "offset"
      -]
  2. Changed10 schema fields changedv0.6.0
    • changedInput schema / properties / maxPerType / description
      Previous value: -"Max IDs to return per xref type (1-500). A compound may have thousands of PubMed references. Total count always reported. Default: 50."New value: +"Max IDs to return per xref type per page (1-500). A compound may have thousands of PubMed references; use offset to reach the ones past this page. Total count always reported. Default: 50."
    • changedInput schema / properties / maxPerType / type
      Previous value: -"number"New value: +"integer"
    • addedInput schema / properties / offset
      Added value: +{
      +  "default": 0,
      +  "description": "Zero-based index of the first ID to return within each xref type. The same offset is applied to every requested type. Pass the nextOffset from a previous call to read the following page. Default: 0.",
      +  "maximum": 9007199254740991,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedOutput schema / properties / nextOffset
      Added value: +{
      +  "description": "Offset to pass on the next call to continue past this page. Omitted when no requested type has further IDs.",
      +  "type": "number"
      +}
    • changedOutput schema / properties / notice / description
      Previous value: -"Recovery guidance when every requested xref type returned zero IDs — hints to verify the CID. Absent when any cross-references were found."New value: +"Recovery guidance when every requested xref type returned zero IDs, when the offset runs past every type, or when further pages remain. Absent when this page is complete and non-empty."
    • addedOutput schema / properties / offset
      Added value: +{
      +  "description": "Zero-based index of the first ID returned within each type.",
      +  "type": "number"
      +}
    • changedOutput schema / properties / xrefs / items / properties / ids / description
      Previous value: -"Cross-reference IDs (capped by maxPerType)."New value: +"Cross-reference IDs on this page (window of offset + maxPerType)."
    • changedOutput schema / properties / xrefs / items / properties / totalAvailable / description
      Previous value: -"Total IDs available before truncation."New value: +"Total IDs available for this type, across all pages."
    • changedOutput schema / properties / xrefs / items / properties / truncated / description
      Previous value: -"Whether results were truncated."New value: +"True when IDs for this type remain past the current page."
    • changedOutput schema / required
      Previous value: -[
      -  "cid",
      -  "xrefs"
      -]New value: +[
      +  "cid",
      +  "xrefs",
      +  "offset"
      +]
  3. Changed1 schema field changedv0.2.5
    • addedOutput schema / properties / notice
      Added value: +{
      +  "description": "Recovery guidance when every requested xref type returned zero IDs — hints to verify the CID. Absent when any cross-references were found.",
      +  "type": "string"
      +}
  4. Changed7 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."
    • changedInput schema / properties / maxPerType / description
      Previous value: -"Max IDs to return per xref type (1-500). A compound may have thousands of PubMed references — this cap prevents bloat. Total count always reported. Default: 50."New value: +"Max IDs to return per xref type (1-500). A compound may have thousands of PubMed references. Total count always reported. Default: 50."
    • changedInput schema / properties / xrefTypes / description
      Previous value: -"Cross-reference types to retrieve. Options: RegistryID, RN (CAS numbers), PubMedID, PatentID, GeneID, ProteinGI, TaxonomyID."New value: +"Cross-reference types to retrieve. String IDs: RegistryID (DSSTox/EPA registry numbers), RN (CAS numbers), PatentID. Numeric IDs: PubMedID, GeneID (NCBI Gene), ProteinGI (legacy NCBI Protein GI), TaxonomyID."
    • addedOutput schema / properties / xrefs / items / description
      Added value: +"Cross-reference group for one type."
    • changedOutput schema / properties / xrefs / items / properties / ids / items / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "number"
      -  }
      -]New value: +[
      +  {
      +    "description": "String-form cross-reference ID (e.g. CAS number, patent).",
      +    "type": "string"
      +  },
      +  {
      +    "description": "Numeric cross-reference ID (e.g. PubMed ID, Gene ID).",
      +    "type": "number"
      +  }
      +]
    • addedOutput schema / properties / xrefs / items / properties / ids / items / description
      Added value: +"Cross-reference identifier — string or number depending on type."
    • changedOutput schema / properties / xrefs / items / properties / type / description
      Previous value: -"Cross-reference type."New value: +"Cross-reference type: RegistryID, RN, PubMedID, PatentID, GeneID, ProteinGI, or TaxonomyID."
  5. First observedv0.1.11

TDQS

A4.5/5.0
Behavior5/5

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

The description transparently discloses pagination behavior: results are paged per type, capped at maxPerType, total counts are reported, and offset advances past the current page. This adds valuable behavioral detail beyond the annotations' readOnly, idempotent, and openWorld hints.

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 communicate the core purpose first and then the essential paging behavior. Every clause adds information, with no repetition of schema content or filler.

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 read-only, idempotent tool with a full input schema, an output schema, and clear paging rules in the description, nothing needed for correct invocation is missing. The cid resolution pointer is already present in the schema, and the output schema handles return-value details.

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?

The input schema already provides 100% parameter coverage with detailed descriptions for cid, offset, xrefTypes, and maxPerType. The description adds a helpful human-readable gloss of the xref type categories, but most parameter meaning is already carried by the schema, so the baseline 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 opens with a specific verb and resource: 'Get external database cross-references for a compound,' then enumerates the covered reference types (PubMed, patents, genes, registry numbers, taxonomy). This clearly distinguishes it from sibling compound tools like details, image, and safety.

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 establishes this tool's context as fetching external cross-references, which implicitly tells an agent when to select it over sibling tools that handle details, images, or bioactivity. It does not explicitly name alternatives or exclusion conditions, but the resource-specific language gives adequate directional 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