Skip to main content
Glama
shomechakraborty

Scientific Tools MCP Server

compound_lookup

Retrieve chemical compound properties from PubChem and ChEMBL including molecular weight, SMILES, LogP, and drug-likeness assessment. Optionally fetch bioactivity and clinical trial phase data.

Instructions

Look up chemical compound properties from PubChem and ChEMBL. Returns molecular weight, SMILES, LogP, TPSA, H-bond donors/acceptors, Lipinski rule-of-5 drug-likeness assessment, synonyms, and optionally bioactivity and clinical trial phase data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
identifierYesCompound identifier: name, CID, SMILES, InChI, or CAS number
id_typeNoType of identifier provided (default: name)name
include_bioactivityNoInclude bioactivity data from ChEMBL (slower, default: false)
propertiesNoSpecific properties to return (default: all)

Implementation Reference

  • The main handler function compound_lookup_handler that executes the compound lookup logic. Accepts identifier, id_type, include_bioactivity, and optionally properties. Calls _lookup_pubchem and optionally _lookup_chembl, returning combined results.
    async def compound_lookup_handler(arguments: dict) -> dict:
        identifier         = arguments.get("identifier", "")
        id_type            = arguments.get("id_type", "name")
        include_bioactivity = arguments.get("include_bioactivity", False)
    
        if not identifier:
            return {"error": "identifier parameter is required"}
    
        async with aiohttp.ClientSession() as session:
            pubchem_result = await _lookup_pubchem(session, identifier, id_type)
    
            chembl_result = {}
            if include_bioactivity and "error" not in pubchem_result:
                chembl_result = await _lookup_chembl(
                    session,
                    inchikey=pubchem_result.get("inchikey"),
                    compound_name=identifier if id_type == "name" else None,
                )
    
        result = {
            "identifier": identifier,
            "id_type": id_type,
            "fetched_at": datetime.now(timezone.utc).isoformat(),
            "pubchem": pubchem_result,
        }
        if chembl_result:
            result["chembl"] = chembl_result
    
        return result
  • Input schema (TOOL_SCHEMA) defining the compound_lookup tool parameters: identifier (string, required), id_type (enum: name/cid/smiles/inchi/cas), include_bioactivity (boolean), properties (array of strings).
    TOOL_SCHEMA = {
        "type": "object",
        "properties": {
            "identifier": {
                "type": "string",
                "description": "Compound identifier: name, CID, SMILES, InChI, or CAS number",
            },
            "id_type": {
                "type": "string",
                "enum": ["name", "cid", "smiles", "inchi", "cas"],
                "description": "Type of identifier provided (default: name)",
                "default": "name",
            },
            "include_bioactivity": {
                "type": "boolean",
                "description": "Include bioactivity data from ChEMBL (slower, default: false)",
                "default": False,
            },
            "properties": {
                "type": "array",
                "items": {"type": "string"},
                "description": "Specific properties to return (default: all)",
            },
        },
        "required": ["identifier"],
    }
  • The register() function that registers compound_lookup with the tool registry, including name, description, input_schema, price, stripe_price_id, handler, and category.
    def register(registry) -> None:
        from server import ToolDefinition
        registry.register(ToolDefinition(
            name=TOOL_NAME,
            description=(
                "Look up chemical compound properties from PubChem and ChEMBL. "
                "Returns molecular weight, SMILES, LogP, TPSA, H-bond donors/acceptors, "
                "Lipinski rule-of-5 drug-likeness assessment, synonyms, and optionally "
                "bioactivity and clinical trial phase data."
            ),
            input_schema=TOOL_SCHEMA,
            price_per_call_usd=TOOL_PRICE_USD,
            stripe_price_id=TOOL_STRIPE_PRICE,
            handler=compound_lookup_handler,
            category="chemistry",
        ))
  • Main handler function for compound_lookup tool.
    async def compound_lookup_handler(arguments: dict) -> dict:
        identifier         = arguments.get("identifier", "")
        id_type            = arguments.get("id_type", "name")
        include_bioactivity = arguments.get("include_bioactivity", False)
    
        if not identifier:
            return {"error": "identifier parameter is required"}
    
        async with aiohttp.ClientSession() as session:
            pubchem_result = await _lookup_pubchem(session, identifier, id_type)
    
            chembl_result = {}
            if include_bioactivity and "error" not in pubchem_result:
                chembl_result = await _lookup_chembl(
                    session,
                    inchikey=pubchem_result.get("inchikey"),
                    compound_name=identifier if id_type == "name" else None,
                )
    
        result = {
            "identifier": identifier,
            "id_type": id_type,
            "fetched_at": datetime.now(timezone.utc).isoformat(),
            "pubchem": pubchem_result,
        }
        if chembl_result:
            result["chembl"] = chembl_result
    
        return result
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses data sources (PubChem, ChEMBL), lists returned properties, and notes that including bioactivity data is slower. This is good transparency for a read-only tool, though it does not mention rate limits or authorization requirements.

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, well-structured paragraph that front-loads the core purpose and lists key outputs efficiently. Every sentence adds value without redundancy.

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?

Given the absence of an output schema, the description adequately explains what properties and data the tool returns. However, it does not describe the exact output structure or format, which would be helpful for full contextual completeness. The mention of optional bioactivity and clinical trial phase data adds necessary context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The parameter descriptions in the schema are detailed, with 100% coverage. The description adds value by explaining the output context (e.g., Lipinski rule-of-5 drug-likeness assessment, synonyms, clinical trial phase data) which is not in the schema, enriching the understanding of what the tool returns.

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 clearly states the tool's purpose: looking up chemical compound properties from PubChem and ChEMBL, and lists specific outputs like molecular weight, SMILES, LogP, etc. This distinguishes it from sibling tools (e.g., literature_search, patent_prior_art_search) which focus on different domains.

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 usage for retrieving compound properties but does not explicitly state when to use this tool versus alternatives, nor does it provide conditions for use or exclusions. The context from sibling names suggests differentiation but is not explicit.

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

Install Server

Other Tools

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/shomechakraborty/mcp-scientific-tools'

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