Skip to main content
  1. ChemMCP Tools/

PubchemSearch (search_pubchem)

Molecule PubChem Molecular Information Molecular Properties SMILES IUPAC Molecular Names APIs
Table of Contents
Version: 0.1.1 Last Update: 2025/06/05 No MCP Support Python Calling Support
Search for molecule/compound information on PubChem, one of the most comprehensive database of chemical molecules and their activities. You can get authoritative information about molecular names, properties, activities, and more.

Example 3

Input:

representation_name: 'Name'
representation: 'alcohol'

Text Input (used for the run_text function in the Python calling mode):

representation_name_and_representation: 'Name: alcohol'

Output:

"""# 1 Names and Identifiers
Section Description: Chemical names, synonyms, identifiers, and descriptors.

## 1.1 Record Description
Section Description: Summary Information

Ethanol with a small amount of an adulterant added so as to be unfit for use as a beverage. [...]"""

Usage

The tool supports Python calling mode.

MCP Mode

This tool does not support MCP mode.

Python Calling Mode

import os
from chemmcp.tools import PubchemSearch

# Initialize the tool
tool = PubchemSearch()

# The tool has two alternative ways to run:
# 1. Run with separate input domains (recommended)
output = tool.run_code(
    representation_name='SMILES'
    representation='CCO'
)
# 2. Run with text-only input
output = tool.run_text(
    representation_name_and_representation='SMILES: CCO'
)

Each tool in ChemMCP has two ways to run:

  • run_code (recommended): The inputs contain one or more domains, each of which can be a str, an int, a float, etc.
  • run_text: The inputs are a single string in a specific format. The tool will parse the string to extract the input domains. This is useful in scenarios where an agent framework calls tools only with text input. The output is the same in both cases.

For the input and output domains, please refer to the tool’s signature.

Tool Signature

Input

Used in the MCP mode, as well as the run_code function in the Python calling mode.

NameTypeDefaultDescription
representation_namestrN/AThe representation name, can be “SMILES”, “IUPAC”, or “Name” (chemical’s common name).
representationstrN/AThe representation of the molecule/compound, corresponding to the representation_name used.

Text Input

Used in the run_text function in the Python calling mode.

NameTypeDefaultDescription
representation_name_and_representationstrN/AThe representation name and representation of the molecule/compound, e.g., “SMILES: ”, “IUPAC: ”, or “Name: ”.

Output

The output is the same in both input cases.

NameTypeDescription
compound_docstrThe document of the molecule/compound in a markdown format.

Envs

No required environment variables for this tool.

Implementation Details

  • Implementation Description: Uses the PubChem API to search for molecular information using various identifiers (SMILES, IUPAC name, or common name). Filters out unuseful sections and returns markdown formatted information about the molecule including properties, safety data, and other relevant information.
  • Open-source dependencies (code source or required libraries): None
  • Hosted services and software (required for running the tool):