Skip to main content
Glama

Get Compound 3D Structure

pubchem_get_compound_3d_structure
Read-onlyIdempotent

Retrieve a compound's 3D atomic coordinates and bonds by PubChem CID, selecting its default or named conformer and JSON or SDF output for docking, rendering, or conformer workflows.

Instructions

Get one 3D conformer of a compound — atomic coordinates and bonds — for one CID: its default conformer, or the one conformerId names. format="json" (default) returns atoms and bonds parsed into structured fields; format="sdf" returns the raw V2000 SDF text for passthrough to docking, rendering, or conformer tools. Optionally lists the compound's other conformer IDs, each one a value for conformerId. Not every compound has computed 3D coordinates (large molecules, mixtures, and some salts do not).

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": {
      "cid": "<cid>"
    },
    "name": "pubchem_get_compound_3d_structure"
  }
}

Input Schema

NameRequiredDescriptionDefault
cidYesPubChem Compound ID. Resolve from name/SMILES with pubchem_search_compounds.
formatNoOutput format. "json" (default) returns parsed atoms and bonds. "sdf" returns the raw V2000 SDF text for passthrough to other tools.json
maxAtomsNoCap the atoms returned in the format="json" preview. atomCount always reports the full total; omitted rows are disclosed via the truncated/shownAtoms enrichment. Defaults to the first 200 atoms.
maxBondsNoCap the bonds returned in the format="json" preview. bondCount always reports the full total; omitted rows are disclosed via the truncated/shownBonds enrichment. Defaults to the first 200 bonds.
conformerIdNoFetch this conformer of the compound instead of its default: a conformer ID from alternateConformerIds (includeAlternateConformerIds: true), 16 hexadecimal digits whose first 8 are the CID in hexadecimal (e.g. "000008C40000000B" for CID 2244). Either case is accepted. Omit, or leave blank, for the default conformer.
includeRawSdfNoFor format="sdf", return the complete raw V2000 SDF even when it exceeds the safe line cap. Default false: an SDF longer than 500 lines is line-capped with disclosure. No effect when format="json".
includeAlternateConformerIdsNoList the IDs of the compound's other computed conformers, each one a value for conformerId. Slower than the default response. Default: false.

Output Schema

NameRequiredDescriptionDefault
cidNoPubChem Compound ID.
sdfNoRaw V2000 SDF text. Populated when format="sdf".
atomsNoParsed atoms. Populated when format="json".
bondsNoParsed bonds. Populated when format="json".
errorNoPresent when the call failed. Absent on success.
noticeNoGuidance naming which lists were capped and how to widen them.
atomCapNoThe atom cap applied (explicit maxAtoms or the safe default), when the atom list was capped.
bondCapNoThe bond cap applied (explicit maxBonds or the safe default), when the bond list was capped.
atomCountNoNumber of atoms in the conformer.
bondCountNoNumber of bonds in the conformer.
truncatedNoTrue when the atom list, bond list, or raw SDF was capped below its total. atomCount/bondCount always report the full totals.
shownAtomsNoAtoms returned after the cap, when fewer than atomCount. Raise maxAtoms for more.
shownBondsNoBonds returned after the cap, when fewer than bondCount. Raise maxBonds for more.
conformerIdNoID of the conformer returned: the requested conformerId, or the compound's default conformer. Read from the record's PUBCHEM_CONFORMER_ID data item; omitted when the record carries none.
shownSdfLinesNoSDF lines returned when format="sdf" and the raw text was line-capped. Set includeRawSdf for the full record.
alternateConformerIdsNoThe compound's other conformer IDs — every listed ID except the one returned, the default included when another was requested. Pass one as conformerId to fetch that conformer. Present when includeAlternateConformerIds is set and other conformers exist.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.9.0
    • addedInput schema / properties / conformerId
      Added value: +{
      +  "description": "Fetch this conformer of the compound instead of its default: a conformer ID from alternateConformerIds (includeAlternateConformerIds: true), 16 hexadecimal digits whose first 8 are the CID in hexadecimal (e.g. \"000008C40000000B\" for CID 2244). Either case is accepted. Omit, or leave blank, for the default conformer.",
      +  "type": "string"
      +}
    • changedInput schema / properties / includeAlternateConformerIds / description
      Previous value: -"List the IDs of additional computed conformers beyond the default. Slower than the default response. Default: false."New value: +"List the IDs of the compound's other computed conformers, each one a value for conformerId. Slower than the default response. Default: false."
    • changedOutput schema / properties / alternateConformerIds / description
      Previous value: -"Conformer IDs beyond the default. Present when includeAlternateConformerIds is set and alternates exist."New value: +"The compound's other conformer IDs — every listed ID except the one returned, the default included when another was requested. Pass one as conformerId to fetch that conformer. Present when includeAlternateConformerIds is set and other conformers exist."
    • changedOutput schema / properties / conformerId / description
      Previous value: -"Default (primary) conformer ID. Present when includeAlternateConformerIds is set."New value: +"ID of the conformer returned: the requested conformerId, or the compound's default conformer. Read from the record's PUBCHEM_CONFORMER_ID data item; omitted when the record carries none."
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `no_3d_structure`: PubChem returned 404 for the CID's 3D record, its answer both when the compound has no computed 3D conformer (common for very large molecules, mixtures, and undefined salts) and when no compound has the CID. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `no_3d_structure`: PubChem returned 404 for the CID's 3D record, its answer both when the compound has no computed 3D conformer (common for very large molecules, mixtures, and undefined salts) and when no compound has the CID. `invalid_conformer_id`: conformerId is not 16 hexadecimal digits whose first 8 name a CID, or the CID they name is not cid. `conformer_not_found`: PubChem returned 404 for the requested conformerId, its answer both for an ID the compound has no conformer under and for any ID of a compound with no computed 3D conformer. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "no_3d_structure"
      -]New value: +[
      +  "no_3d_structure",
      +  "invalid_conformer_id",
      +  "conformer_not_found"
      +]
  2. Changed2 schema fields changedv0.7.0
    • changedInput schema / properties / cid / maximum
      Previous value: -9007199254740991New value: +2147483647
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `no_3d_structure`: PubChem has no computed 3D conformer for the requested CID. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `no_3d_structure`: PubChem returned 404 for the CID's 3D record, its answer both when the compound has no computed 3D conformer (common for very large molecules, mixtures, and undefined salts) and when no compound has the CID. Other values are possible when a failure originates below the handler."
  3. Changed6 schema fields changedv0.6.5
    • removedInput schema / properties / cid / exclusiveMinimum
      Removed value: -0
    • addedInput schema / properties / cid / minimum
      Added value: +1
    • removedInput schema / properties / maxAtoms / exclusiveMinimum
      Removed value: -0
    • addedInput schema / properties / maxAtoms / minimum
      Added value: +1
    • removedInput schema / properties / maxBonds / exclusiveMinimum
      Removed value: -0
    • addedInput schema / properties / maxBonds / minimum
      Added value: +1
  4. Changed1 schema field changedv0.6.3
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `no_3d_structure`: PubChem has no computed 3D conformer for the requested CID Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `no_3d_structure`: PubChem has no computed 3D conformer for the requested CID. Other values are possible when a failure originates below the handler."
  5. 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": [
      +      "cid",
      +      "atomCount",
      +      "bondCount"
      +    ]
      +  },
      +  {
      +    "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. Declared by this tool: `no_3d_structure`: PubChem has no computed 3D conformer for the requested CID Other values are possible when a failure originates below the handler.",
      +          "examples": [
      +            "no_3d_structure"
      +          ],
      +          "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: -[
      -  "cid",
      -  "atomCount",
      -  "bondCount"
      -]
  6. Changed1 schema field changedv0.6.0
    • changedInput schema / properties / includeAlternateConformerIds / description
      Previous value: -"List the IDs of additional computed conformers beyond the default. Adds one extra API call. Default: false."New value: +"List the IDs of additional computed conformers beyond the default. Slower than the default response. Default: false."
  7. Changed10 schema fields changedv0.2.5
    • addedInput schema / properties / includeRawSdf
      Added value: +{
      +  "default": false,
      +  "description": "For format=\"sdf\", return the complete raw V2000 SDF even when it exceeds the safe line cap. Default false: an SDF longer than 500 lines is line-capped with disclosure. No effect when format=\"json\".",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / maxAtoms
      Added value: +{
      +  "description": "Cap the atoms returned in the format=\"json\" preview. atomCount always reports the full total; omitted rows are disclosed via the truncated/shownAtoms enrichment. Defaults to the first 200 atoms.",
      +  "exclusiveMinimum": 0,
      +  "maximum": 9007199254740991,
      +  "type": "integer"
      +}
    • addedInput schema / properties / maxBonds
      Added value: +{
      +  "description": "Cap the bonds returned in the format=\"json\" preview. bondCount always reports the full total; omitted rows are disclosed via the truncated/shownBonds enrichment. Defaults to the first 200 bonds.",
      +  "exclusiveMinimum": 0,
      +  "maximum": 9007199254740991,
      +  "type": "integer"
      +}
    • addedOutput schema / properties / atomCap
      Added value: +{
      +  "description": "The atom cap applied (explicit maxAtoms or the safe default), when the atom list was capped.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / bondCap
      Added value: +{
      +  "description": "The bond cap applied (explicit maxBonds or the safe default), when the bond list was capped.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / notice
      Added value: +{
      +  "description": "Guidance naming which lists were capped and how to widen them.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / shownAtoms
      Added value: +{
      +  "description": "Atoms returned after the cap, when fewer than atomCount. Raise maxAtoms for more.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / shownBonds
      Added value: +{
      +  "description": "Bonds returned after the cap, when fewer than bondCount. Raise maxBonds for more.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / shownSdfLines
      Added value: +{
      +  "description": "SDF lines returned when format=\"sdf\" and the raw text was line-capped. Set includeRawSdf for the full record.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / truncated
      Added value: +{
      +  "description": "True when the atom list, bond list, or raw SDF was capped below its total. atomCount/bondCount always report the full totals.",
      +  "type": "boolean"
      +}
  8. Addedv0.2.2

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, openWorld), yet the description adds real behavior: the availability caveat for large molecules, mixtures, and salts, the intent behind the two formats, and that listing alternate conformers is slower. It does not restate pagination/truncation mechanics beyond pointing at them, and leaves the actual response shape to the output schema, which is reasonable.

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?

Three sentences, front-loaded with what the tool returns before format branches and caveats. Some clauses are packed (format behavior, conformer enumeration, availability caveat in a single sentence) but no sentence is redundant.

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?

Given an output schema that defines the return payload and 100% schema coverage for seven parameters, the description covers everything else an agent needs: format tradeoffs, conformer selection, the slower alternate-ID listing, and the possibility of missing 3D data. Nothing required for a correct first call is absent.

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%, so baseline is 3. The description reinforces format semantics and clarifies that conformerId values come from the alternate-conformer list, but the atom/bond caps and the SDF line-cap behavior are explained in the schema, not elaborated here. Value added is modest rather than transformative.

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 one 3D conformer of a compound — atomic coordinates and bonds — for one CID.' It scopes the output precisely (default conformer or a named conformerId) and is unmistakable against siblings like get_compound_details or get_compound_image.

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?

It gives clear operational choices: format="json" for parsed structured fields versus format="sdf" for raw V2000 passthrough to docking, rendering, or conformer tools, plus includeAlternateConformerIds for discovering other conformers. It also sets a boundary condition — not every compound has computed coordinates. The only gap is that it never names a sibling to use instead when 3D data is unavailable (e.g., falling back to details).

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