Skip to main content
Glama

Get Compound Cross-References

pubchem_get_compound_xrefs
Read-onlyIdempotent

Get external database cross-references for a compound: PubMed citations, patent IDs, gene/protein associations, registry numbers, and taxonomy IDs. Pagination with offset retrieves all IDs.

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.

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

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and openWorldHint, so the safety profile is covered. The description adds behavioral value by explaining pagination semantics: results are paged per type, capped at maxPerType, total counts are always reported, and offset reaches further IDs. This goes beyond the annotations without contradicting them.

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 waste: the first fronts the purpose and lists the xref types, the second packs the pagination behavior. Every clause earns its place, and the most important information appears first.

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?

Given the presence of a detailed input schema, an output schema, and safety annotations, the description is complete enough for an agent to call the tool correctly. It covers how to page through results and how to resolve the compound ID, with the only gap being explicit routing among sibling tools.

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 description coverage is 100%, so the baseline is 3. The description adds meaning beyond the schema by clarifying that pagination is per xref type and that the total count is reported, which illuminates the behavior of offset and maxPerType. It does not repeat parameter formats but reinforces their usage.

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?

The description states a specific verb ('Get') and resource ('external database cross-references for a compound'), and enumerates the types of xrefs it returns (PubMed citations, patent IDs, gene/protein associations, registry numbers, taxonomy IDs). It is clearly distinct from most siblings, but it does not explicitly distinguish itself from the potentially overlapping pubchem_get_compound_details, so it falls short of a 5.

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?

The description provides useful context on pagination and the cid schema field directs users to pubchem_search_compounds for resolving names/SMILES. However, it does not state when to use this tool versus alternatives such as pubchem_get_compound_details or pubchem_get_summary, nor does it give any exclusions.

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