# `pubchem__pubchem_get_compound_3d_structure`

**Get Compound 3D Structure**

Get a compound's default 3D conformer — atomic coordinates and bonds — for one CID. 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 alternate conformer IDs. Not every compound has computed 3D coordinates (large molecules, mixtures, and some salts do not).

- Server: [PubChem](https://gateway.mcpharbor.dev/docs/servers/pubchem) (`dev.mcpharbor.gateway/pubchem`)
- Price per call: $0.0001 (100 micro-USD); only tools/call is charged
- Endpoint: `https://gateway.mcpharbor.dev/mcp` or `https://gateway.mcpharbor.dev/mcp/pubchem`
- Upstream tool: exposed by the provider; called through this gateway as `pubchem__pubchem_get_compound_3d_structure`
- Provider terms: <https://www.ncbi.nlm.nih.gov/home/about/policies/> (verified 2026-09-19)
- Upstream API documentation: <https://pubchem.ncbi.nlm.nih.gov/docs/pug-rest>
- Rate limit: 350 requests per minute
- Attribution required: Attribution to source recommended, not mandatory

## Parameters

- `cid` (integer, required): PubChem Compound ID. Resolve from name/SMILES with pubchem_search_compounds.
- `format` (string, optional): Output format. "json" (default) returns parsed atoms and bonds. "sdf" returns the raw V2000 SDF text for passthrough to other tools. One of: `sdf`, `json`. Default: `json`.
- `includeAlternateConformerIds` (boolean, optional): List the IDs of additional computed conformers beyond the default. Slower than the default response. Default: false. Default: `false`.
- `includeRawSdf` (boolean, optional): 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". Default: `false`.
- `maxAtoms` (integer, optional): 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.
- `maxBonds` (integer, optional): 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.

## Example call

Request headers and body:

```http
POST /mcp HTTP/1.1
Host: gateway.mcpharbor.dev
Authorization: Bearer <your gateway API key>
Content-Type: application/json
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
Mcp-Method: tools/call
Mcp-Name: pubchem__pubchem_get_compound_3d_structure
```

```json
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "_meta": {
      "io.modelcontextprotocol/clientCapabilities": {},
      "io.modelcontextprotocol/clientInfo": {
        "name": "example-agent",
        "version": "1.0.0"
      },
      "io.modelcontextprotocol/protocolVersion": "2026-07-28"
    },
    "arguments": {
      "cid": 1
    },
    "name": "pubchem__pubchem_get_compound_3d_structure"
  }
}
```

A successful response:

```json
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "_meta": {
      "dev.mcpharbor.gateway/call": {
        "chargedMicroUsd": 100,
        "id": "<the id of this charge>"
      }
    },
    "content": [
      {
        "text": "<whatever the upstream tool returned>",
        "type": "text"
      }
    ],
    "resultType": "complete"
  }
}
```

This call costs $0.0001 (100 micro-USD). Reading this page and listing the tool cost nothing.
The `dev.mcpharbor.gateway/call` record in the result is the receipt for that charge. Each
POST is metered separately, so sending the same call again buys another one: see
[agent.txt](https://gateway.mcpharbor.dev/agent.txt), section 7, before retrying.

## Attribution

This provider requires the attribution below wherever you use results from its tools.
Reproduce it verbatim:

> Attribution to source recommended, not mandatory

## Tool definition

Exactly as `tools/list` returns it (free):

```json
{
  "_meta": {
    "dev.mcpharbor.gateway/pricing": {
      "currency": "USD",
      "pricePerCallMicroUsd": 100
    }
  },
  "annotations": {
    "idempotentHint": true,
    "openWorldHint": true,
    "readOnlyHint": true
  },
  "description": "Get a compound's default 3D conformer — atomic coordinates and bonds — for one CID. 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 alternate conformer IDs. Not every compound has computed 3D coordinates (large molecules, mixtures, and some salts do not).",
  "inputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "additionalProperties": false,
    "properties": {
      "cid": {
        "description": "PubChem Compound ID. Resolve from name/SMILES with pubchem_search_compounds.",
        "exclusiveMinimum": 0,
        "maximum": 9007199254740991,
        "type": "integer"
      },
      "format": {
        "default": "json",
        "description": "Output format. \"json\" (default) returns parsed atoms and bonds. \"sdf\" returns the raw V2000 SDF text for passthrough to other tools.",
        "enum": [
          "sdf",
          "json"
        ],
        "type": "string"
      },
      "includeAlternateConformerIds": {
        "default": false,
        "description": "List the IDs of additional computed conformers beyond the default. Slower than the default response. Default: false.",
        "type": "boolean"
      },
      "includeRawSdf": {
        "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"
      },
      "maxAtoms": {
        "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"
      },
      "maxBonds": {
        "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"
      }
    },
    "required": [
      "cid"
    ],
    "type": "object"
  },
  "name": "pubchem__pubchem_get_compound_3d_structure",
  "outputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "additionalProperties": false,
    "anyOf": [
      {
        "not": {
          "required": [
            "error"
          ]
        },
        "required": [
          "cid",
          "atomCount",
          "bondCount"
        ]
      },
      {
        "required": [
          "error"
        ]
      }
    ],
    "properties": {
      "alternateConformerIds": {
        "description": "Conformer IDs beyond the default. Present when includeAlternateConformerIds is set and alternates exist.",
        "items": {
          "type": "string"
        },
        "type": "array"
      },
      "atomCap": {
        "description": "The atom cap applied (explicit maxAtoms or the safe default), when the atom list was capped.",
        "type": "number"
      },
      "atomCount": {
        "description": "Number of atoms in the conformer.",
        "type": "number"
      },
      "atoms": {
        "description": "Parsed atoms. Populated when format=\"json\".",
        "items": {
          "additionalProperties": false,
          "description": "Atom with 3D Cartesian coordinates.",
          "properties": {
            "element": {
              "description": "Element symbol (e.g. \"C\", \"O\", \"N\").",
              "type": "string"
            },
            "x": {
              "description": "X coordinate (Angstroms).",
              "type": "number"
            },
            "y": {
              "description": "Y coordinate (Angstroms).",
              "type": "number"
            },
            "z": {
              "description": "Z coordinate (Angstroms).",
              "type": "number"
            }
          },
          "required": [
            "element",
            "x",
            "y",
            "z"
          ],
          "type": "object"
        },
        "type": "array"
      },
      "bondCap": {
        "description": "The bond cap applied (explicit maxBonds or the safe default), when the bond list was capped.",
        "type": "number"
      },
      "bondCount": {
        "description": "Number of bonds in the conformer.",
        "type": "number"
      },
      "bonds": {
        "description": "Parsed bonds. Populated when format=\"json\".",
        "items": {
          "additionalProperties": false,
          "description": "Bond between two atoms.",
          "properties": {
            "a1": {
              "description": "First atom index (1-based).",
              "type": "number"
            },
            "a2": {
              "description": "Second atom index (1-based).",
              "type": "number"
            },
            "order": {
              "description": "Bond order (1=single, 2=double, 3=triple, 4=aromatic).",
              "type": "number"
            }
          },
          "required": [
            "a1",
            "a2",
            "order"
          ],
          "type": "object"
        },
        "type": "array"
      },
      "cid": {
        "description": "PubChem Compound ID.",
        "type": "number"
      },
      "conformerId": {
        "description": "Default (primary) conformer ID. Present when includeAlternateConformerIds is set.",
        "type": "string"
      },
      "error": {
        "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"
      },
      "notice": {
        "description": "Guidance naming which lists were capped and how to widen them.",
        "type": "string"
      },
      "sdf": {
        "description": "Raw V2000 SDF text. Populated when format=\"sdf\".",
        "type": "string"
      },
      "shownAtoms": {
        "description": "Atoms returned after the cap, when fewer than atomCount. Raise maxAtoms for more.",
        "type": "number"
      },
      "shownBonds": {
        "description": "Bonds returned after the cap, when fewer than bondCount. Raise maxBonds for more.",
        "type": "number"
      },
      "shownSdfLines": {
        "description": "SDF lines returned when format=\"sdf\" and the raw text was line-capped. Set includeRawSdf for the full record.",
        "type": "number"
      },
      "truncated": {
        "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"
      }
    },
    "type": "object"
  },
  "title": "Get Compound 3D Structure"
}
```
