Skip to main content
Glama

Get Compound Image

pubchem_get_compound_image
Read-onlyIdempotent

Retrieve a 2D structure diagram as a PNG image for any PubChem compound by providing its CID. Choose small or large image size for documentation or analysis.

Instructions

Fetch a 2D structure diagram (PNG image) for a compound by CID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cidYesPubChem Compound ID. Resolve from name/SMILES with pubchem_search_compounds.
sizeNoImage size: "small" (100x100) or "large" (300x300). Default: "large".large

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
cidNoPubChem Compound ID.
errorNoPresent when the call failed. Absent on success.
widthNoImage width in pixels.
heightNoImage height in pixels.
mimeTypeNoMIME type — always "image/png".
imageBase64NoBase64-encoded PNG image data.

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. 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: `cid_not_found`: PubChem returned 404 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: `cid_not_found`: PubChem returned 404 for the requested CID. Other values are possible when a failure originates below the handler."
  3. 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",
      +      "imageBase64",
      +      "mimeType",
      +      "width",
      +      "height"
      +    ]
      +  },
      +  {
      +    "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: `cid_not_found`: PubChem returned 404 for the requested CID Other values are possible when a failure originates below the handler.",
      +          "examples": [
      +            "cid_not_found"
      +          ],
      +          "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",
      -  "imageBase64",
      -  "mimeType",
      -  "width",
      -  "height"
      -]
  4. Changed2 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."
    • changedOutput schema / properties / mimeType / description
      Previous value: -"Image MIME type."New value: +"MIME type — always \"image/png\"."
  5. First observedv0.1.11

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, so the safety profile is covered. The description adds that the result is a PNG image, but it does not disclose additional behavioral context such as output size constraints beyond the schema or any limitations of the 2D rendering. This is acceptable but not rich.

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?

The description is one short sentence with no filler. The core action and output type are front-loaded, making it immediately scannable, and every word contributes to meaning.

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?

This is a simple read-only tool with one required parameter, a fully documented optional enum, and an output schema present. The description plus schema fully specify how to invoke it correctly. It only misses explicit sibling routing, but that gap is already captured under usage_guidelines.

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%, with both cid and size fully documented and size's enum values described. The description adds only the redundant 'by CID' phrase, providing no meaningful parameter semantics beyond what the schema already gives. Baseline 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 names a specific verb ('Fetch'), a specific resource ('2D structure diagram (PNG image)'), and the required input ('by CID'). The '2D' qualifier explicitly distinguishes it from the sibling tool pubchem_get_compound_3d_structure, so an agent can identify the correct tool immediately.

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 implies the usage context: an agent should call this when a 2D PNG image of a compound is needed. However, it does not explicitly state when to prefer this tool over siblings like pubchem_get_compound_details or pubchem_get_compound_3d_structure. The cid parameter description does provide a useful prerequisite by pointing to pubchem_search_compounds.

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