compound-name-retrieval
Retrieve SMILES strings from PubChem database using compound names to obtain molecular structures from common chemical names.
Best use case
compound-name-retrieval is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Retrieve SMILES strings from PubChem database using compound names to obtain molecular structures from common chemical names.
Teams using compound-name-retrieval should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/compound-name-retrieval/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How compound-name-retrieval Compares
| Feature / Agent | compound-name-retrieval | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Retrieve SMILES strings from PubChem database using compound names to obtain molecular structures from common chemical names.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Compound Name to SMILES Retrieval
## Usage
### 1. MCP Server Definition
```python
import asyncio
import json
from contextlib import AsyncExitStack
from mcp.client.streamable_http import streamablehttp_client
from mcp import ClientSession
class DrugSDAClient:
"""DrugSDA-Tool MCP Client"""
def __init__(self, server_url: str, api_key: str):
self.server_url = server_url
self.api_key = api_key
self.session = None
async def connect(self):
"""Establish connection and initialize session"""
try:
self.transport = streamablehttp_client(
url=self.server_url,
headers={"SCP-HUB-API-KEY": self.api_key}
)
self._stack = AsyncExitStack()
await self._stack.__aenter__()
self.read, self.write, self.get_session_id = await self._stack.enter_async_context(self.transport)
self.session_ctx = ClientSession(self.read, self.write)
self.session = await self._stack.enter_async_context(self.session_ctx)
await self.session.initialize()
return True
except Exception as e:
print(f"✗ connect failure: {e}")
return False
async def disconnect(self):
"""Disconnect from server"""
try:
if hasattr(self, '_stack'):
await self._stack.aclose()
print("✓ already disconnect")
except Exception as e:
print(f"✗ disconnect error: {e}")
def parse_result(self, result):
"""Parse MCP tool call result"""
try:
if hasattr(result, 'content') and result.content:
content = result.content[0]
if hasattr(content, 'text'):
return json.loads(content.text)
return str(result)
except Exception as e:
return {"error": f"parse error: {e}", "raw": str(result)}
```
### 2. Compound Name Retrieval Workflow
This workflow retrieves SMILES strings from PubChem using common chemical names.
**Workflow Steps:**
1. **Input Compound Names** - Provide list of chemical names
2. **Query PubChem** - Search for each compound in PubChem database
3. **Extract SMILES** - Retrieve canonical SMILES representations
**Implementation:**
```python
## Initialize client
client = DrugSDAClient(
"https://scp.intern-ai.org.cn/api/v1/mcp/2/DrugSDA-Tool",
"<your-api-key>"
)
if not await client.connect():
print("connection failed")
exit()
## Input: List of compound names
compound_names = ["aspirin", "caffeine", "ibuprofen"]
## Retrieve SMILES from compound names
result = await client.session.call_tool(
"retrieve_smiles_from_name",
arguments={
"compound_names": compound_names
}
)
result_data = client.parse_result(result)
smiles_list = result_data["retrieve_smiles"]
## Display results
print("Retrieved SMILES strings:")
for item in smiles_list:
print(f"Name: {item['compound_name']}")
print(f"SMILES: {item['smiles']}\n")
await client.disconnect()
```
### Tool Descriptions
**DrugSDA-Tool Server:**
- `retrieve_smiles_from_name`: Retrieve SMILES from PubChem by compound name
- Args:
- `compound_names` (list): List of chemical compound names
- Returns:
- `retrieve_smiles` (list): List of name-SMILES pairs
- `compound_name` (str): Input compound name
- `smiles` (str): Canonical SMILES string
### Input/Output
**Input:**
- `compound_names`: List of chemical names (common names, IUPAC names, or synonyms)
**Output:**
- List of results:
- `compound_name`: Query compound name
- `smiles`: Canonical SMILES representation
### Use Cases
- Convert chemical names to machine-readable formats
- Batch retrieve molecular structures
- Validate compound names against PubChem
- Prepare datasets for computational chemistry
- Integration with molecular analysis pipelines
### Performance Notes
- **Data source**: PubChem public database
- **Name matching**: Supports common names, IUPAC names, and synonyms
- **Execution time**: ~1-2 seconds per compound
- **Availability**: Requires internet connection to PubChem APIRelated Skills
uniprot-protein-retrieval
Retrieve protein sequences and functional information from UniProt database by protein name, enabling protein analysis and bioinformatics workflows.
ncbi-gene-retrieval
Retrieve gene information from NCBI Gene database by gene IDs to obtain genomic details, function, and expression data.
lead_compound_optimization
Lead Compound Optimization - Optimize a lead compound: validate SMILES, compute drug-likeness, predict ADMET properties, and check ChEMBL bioactivity. Use this skill for medicinal chemistry tasks involving is valid smiles calculate mol drug chemistry pred molecule admet search activity. Combines 4 tools from 3 SCP server(s).
ensembl-sequence-retrieval
Retrieve genomic sequences from Ensembl database using transcript or gene IDs to obtain nucleotide and protein sequences.
drugsda-compound-retrieve
Retrieve SMILES strings from PubChem using compound names.
disease_compound_pipeline
Disease-Specific Compound Screening - Screen compounds for disease: get DLEPS score for disease relevance, predict ADMET, and check drug-likeness. Use this skill for drug discovery tasks involving calculate dleps score pred molecule admet calculate mol drug chemistry get compound by name. Combines 4 tools from 3 SCP server(s).
compound_to_drug_pipeline
Compound-to-Drug Analysis Pipeline - Full compound-to-drug pipeline: name-to-SMILES conversion, structure analysis, drug-likeness, and FDA drug lookup. Use this skill for drug development tasks involving NameToSMILES ChemicalStructureAnalyzer calculate mol drug chemistry get drug by name. Combines 4 tools from 4 SCP server(s).
compound_database_crossref
Cross-Database Compound Lookup - Cross-reference compound across databases: PubChem, ChEMBL, KEGG, and CAS number lookup. Use this skill for chemical information tasks involving get compound by name get molecule by name kegg find CASToPrice. Combines 4 tools from 4 SCP server(s).
cas_compound_lookup
CAS Number Compound Lookup - Look up compounds by CAS: convert CAS to price/availability, get PubChem data, get ChEMBL info, and structure analysis. Use this skill for chemical information tasks involving CASToPrice get compound by name get molecule by name ChemicalStructureAnalyzer. Combines 4 tools from 4 SCP server(s).
wind-site-assessment
Assess wind energy potential and perform site analysis using atmospheric science calculations.
web_literature_mining
Scientific Literature Mining - Mine scientific literature: PubMed search, arXiv search, web search, and Tavily deep search. Use this skill for scientific informatics tasks involving pubmed search search literature search web tavily search. Combines 4 tools from 2 SCP server(s).
virus_genomics
Virus Genomics Analysis - Analyze virus genomics: NCBI virus dataset, annotation, taxonomy, and literature search. Use this skill for virology tasks involving get virus dataset report get virus annotation report get taxonomy search literature. Combines 4 tools from 2 SCP server(s).