Skip to main content
Glama

Get Compound Image

pubchem_get_compound_image
Read-onlyIdempotent

Fetch a 2D structure diagram (PNG) for a compound by PubChem CID, with optional small or large size.

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. Changed1 schema field changedv0.7.0
    • changedInput schema / properties / cid / maximum
      Previous value: -9007199254740991New value: +2147483647
  2. Changed2 schema fields changedv0.6.5
    • removedInput schema / properties / cid / exclusiveMinimum
      Removed value: -0
    • addedInput schema / properties / cid / minimum
      Added value: +1
  3. 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."
  4. 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"
      -]
  5. 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\"."
  6. First observedv0.1.11

TDQS

A3.6/5.0
Behavior3/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 the output format (PNG image), which is genuinely useful context, but says nothing about image availability failures, rate limits, or what happens for compounds lacking a depiction.

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?

A single sentence with zero filler; the resource, format, and lookup key are all front-loaded.

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?

For a simple two-parameter image fetch with an output schema and full safety annotations, the description covers what the tool returns well enough to call correctly. The only real gap is the absence of usage guidance relative to sibling compound tools.

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%: both cid and size are fully documented in the schema, including the size enum values and the default. The description adds no parameter meaning beyond that, so the baseline 3 applies.

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?

States a specific verb plus resource ('Fetch a 2D structure diagram') and pins down output format (PNG) and lookup key (CID). The '2D' qualifier implicitly distinguishes it from the sibling pubchem_get_compound_3d_structure, so an agent can route between the two without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description offers no when-to-use guidance, no exclusions, and never names an alternative tool. The one routing hint that exists ('Resolve from name/SMILES with pubchem_search_compounds') is present only in the schema's cid description, not in the tool description itself.

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