Skip to main content
Glama

Get Compound Interactions

pubchem_get_compound_interactions
Read-onlyIdempotent

Retrieve drug-drug, drug-food, and target interactions for a PubChem compound, with source details and pagination to access all records.

Instructions

Get a compound's interaction data: drug-drug interactions (DrugBank), drug-food interactions, and chemical-target interactions (binding/activity from BindingDB, ChEMBL, and others). Each entry carries its originating source. Results are paged per kind, with the source-record total and the next offset reported for each. Richest for approved drugs; many compounds have no deposited interaction records.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cidYesPubChem Compound ID. Resolve from name/SMILES with pubchem_search_compounds.
kindsNoInteraction kinds to fetch. "drug-drug" (interactions with other drugs), "drug-food" (dietary interactions), "target" (binding/activity against molecular targets). Default: ["drug-drug"].
offsetNoZero-based start position within each requested kind, counted in source records rather than returned entries. The same offset applies to every kind in the call, and the kinds advance at different rates — when paging past the first page, request one kind per call and pass that kind's nextOffset. Default: 0.
maxEntriesNoMax entries per kind per page (1-50). Well-studied drugs have a long tail of interactions; use offset to reach the ones past this page. Default: 10.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
cidNoPubChem Compound ID.
errorNoPresent when the call failed. Absent on success.
noticeNoGuidance when a kind failed, when no interaction data was found, when the offset runs past every requested kind, or when further pages remain. Absent when this page is complete and every kind resolved.
offsetNoZero-based start position read within each requested kind.
pagingNoPer-kind page position, one entry per requested kind that was retrieved. A kind listed in failedKinds is absent — its position is unknown, not exhausted.
entriesNoInteraction entries across the requested kinds.
truncatedNoTrue when at least one requested kind has source records remaining past this page. Which kinds, and how many records each holds, is in paging[].truncated / paging[].totalRecords.
nextOffsetNoOffset to pass on the next call, reported when exactly one requested kind has records remaining. Omitted when none do, and when several do — those advance to different positions, so read paging[].nextOffset instead.
failedKindsNoInteraction kinds that could not be retrieved (comma-separated). The returned entries cover the kinds that succeeded; retry to re-attempt the failed ones.
returnedCountNoTotal interaction entries returned across all kinds.
requestedKindsNoInteraction kinds requested (comma-separated).

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed7 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",
      +      "entries",
      +      "paging",
      +      "requestedKinds",
      +      "returnedCount",
      +      "truncated",
      +      "offset"
      +    ]
      +  },
      +  {
      +    "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.",
      +          "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"
      +}
    • addedOutput schema / properties / truncated
      Added value: +{
      +  "description": "True when at least one requested kind has source records remaining past this page. Which kinds, and how many records each holds, is in paging[].truncated / paging[].totalRecords.",
      +  "type": "boolean"
      +}
    • removedOutput schema / required
      Removed value: -[
      -  "cid",
      -  "entries",
      -  "paging",
      -  "requestedKinds",
      -  "returnedCount",
      -  "offset"
      -]
  2. Changed8 schema fields changedv0.6.0
    • changedInput schema / properties / maxEntries / description
      Previous value: -"Max entries per kind (1-50). Well-studied drugs have a long tail of interactions. Default: 10."New value: +"Max entries per kind per page (1-50). Well-studied drugs have a long tail of interactions; use offset to reach the ones past this page. Default: 10."
    • addedInput schema / properties / offset
      Added value: +{
      +  "default": 0,
      +  "description": "Zero-based start position within each requested kind, counted in source records rather than returned entries. The same offset applies to every kind in the call, and the kinds advance at different rates — when paging past the first page, request one kind per call and pass that kind's nextOffset. Default: 0.",
      +  "maximum": 2147483646,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • removedOutput schema / properties / entries / items / properties / severity
      Removed value: -{
      -  "description": "Raw severity as the source reports it — not normalized across sources, and frequently unset (most sources embed severity in the statement text).",
      -  "type": "string"
      -}
    • addedOutput schema / properties / nextOffset
      Added value: +{
      +  "description": "Offset to pass on the next call, reported when exactly one requested kind has records remaining. Omitted when none do, and when several do — those advance to different positions, so read paging[].nextOffset instead.",
      +  "type": "number"
      +}
    • changedOutput schema / properties / notice / description
      Previous value: -"Guidance when no interaction data was found for the requested kinds."New value: +"Guidance when a kind failed, when no interaction data was found, when the offset runs past every requested kind, or when further pages remain. Absent when this page is complete and every kind resolved."
    • addedOutput schema / properties / offset
      Added value: +{
      +  "description": "Zero-based start position read within each requested kind.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / paging
      Added value: +{
      +  "description": "Per-kind page position, one entry per requested kind that was retrieved. A kind listed in failedKinds is absent — its position is unknown, not exhausted.",
      +  "items": {
      +    "additionalProperties": false,
      +    "description": "Page position for one interaction kind.",
      +    "properties": {
      +      "kind": {
      +        "description": "Interaction category this page covers.",
      +        "enum": [
      +          "drug-drug",
      +          "drug-food",
      +          "target"
      +        ],
      +        "type": "string"
      +      },
      +      "nextOffset": {
      +        "description": "Offset to pass on the next call to continue this kind past the current page. Omitted when no records remain.",
      +        "type": "number"
      +      },
      +      "returnedCount": {
      +        "description": "Interaction entries returned for this kind.",
      +        "type": "number"
      +      },
      +      "totalRecords": {
      +        "description": "Source records available for this kind, across all pages. Entries are derived from these records and can be fewer: a \"target\" record naming no molecular target and a \"drug-drug\" record carrying no statement both yield nothing, and duplicate measurements collapse within a page. Pages divide the records, not the entries, so a duplicate split across two pages is reported on both.",
      +        "type": "number"
      +      },
      +      "truncated": {
      +        "description": "True when source records remain for this kind past the current page.",
      +        "type": "boolean"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "returnedCount",
      +      "totalRecords",
      +      "truncated"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "cid",
      -  "entries",
      -  "requestedKinds",
      -  "returnedCount"
      -]New value: +[
      +  "cid",
      +  "entries",
      +  "paging",
      +  "requestedKinds",
      +  "returnedCount",
      +  "offset"
      +]
  3. Addedv0.2.2

TDQS

A4.2/5.0
Behavior5/5

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

Annotations already declare readOnly, openWorld, and idempotent behavior. The description adds meaningful behavior beyond that: results are paged per kind, each page reports source-record totals and next offsets, each entry carries its source, and coverage varies by drug approval status. No contradiction with annotations.

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?

Four dense sentences with no filler: the action is front-loaded, followed by categories and sources, then pagination behavior, then coverage caveat. Every sentence contributes operational or selection-relevant information.

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?

With a complete input schema, an output schema, and readOnly/openWorld/idempotent annotations, the description supplies the missing context: originating sources, pagination contract, and expected data sparsity. The only notable gap is explicit differentiation from the closely related bioactivity tool.

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 the schema already documents cid, kinds, offset, and maxEntries in detail. The description reinforces the per-kind paging concept but does not add parameter-level meaning beyond what the schema 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?

States a specific action ('Get a compound's interaction data') and enumerates the exact interaction categories and source databases (DrugBank, BindingDB, ChEMBL). This distinguishes it from sibling tools focused on details, images, safety, or bioactivity.

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 when to use it: when interaction records are needed, and it contextualizes expectations with 'Richest for approved drugs; many compounds have no deposited interaction records.' However, it never explicitly names alternatives or says when not to use it, especially relative to pubchem_get_bioactivity, which overlaps on target binding/activity.

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