Skip to main content
Glama

Get Compound Image

pubchem_get_compound_image
Read-onlyIdempotent

Fetch a 2D structure diagram (PNG) for a compound by providing its PubChem CID. Select small or large image size for your application.

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. Dates show when Glama detected each change.

  1. 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"
      -]
  2. 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\"."
  3. First observedv0.1.11

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, openWorldHint, and idempotentHint, covering the safety profile. The description adds the PNG and 2D format details, but provides no additional behavioral context such as response format nuances or error behavior.

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 a single front-loaded sentence. Every phrase contributes: 'Fetch', '2D structure diagram', 'PNG image', and 'by CID'.

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?

For a simple image-fetch tool, the description plus complete input schema, output schema, and read-only annotations provide all necessary information. There are no major gaps that would prevent an agent from invoking it correctly.

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 cid and size both documented including defaults and enum values. The description only restates 'by CID' and adds no parameter meaning beyond what the input schema already provides.

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 uses a specific verb 'Fetch' and identifies the exact resource: a '2D structure diagram (PNG image)' for a compound by CID. It clearly distinguishes this from siblings like pubchem_get_compound_3d_structure by emphasizing 2D and PNG.

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 use when a 2D image of a compound is needed, and the schema's cid description hints at resolving CID via pubchem_search_compounds. However, it does not explicitly state when to choose this tool over alternatives or provide exclusions.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cyanheads/pubchem-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server