Skip to main content
Glama

search_by_cas_number

Find chemical compounds in PubChem's database using their CAS Registry Number to access detailed information for research or identification purposes.

Instructions

Search for compounds by CAS Registry Number

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cas_numberYesCAS Registry Number (e.g., 50-78-2)

Implementation Reference

  • The main handler function for the 'search_by_cas_number' tool. It currently returns a placeholder response indicating that CAS search is not yet implemented.
    private async handleSearchByCasNumber(args: any) {
      return { content: [{ type: 'text', text: JSON.stringify({ message: 'CAS search not yet implemented', args }, null, 2) }] };
    }
  • The input schema definition for the 'search_by_cas_number' tool, specifying that it requires a 'cas_number' string parameter.
    {
      name: 'search_by_cas_number',
      description: 'Search for compounds by CAS Registry Number',
      inputSchema: {
        type: 'object',
        properties: {
          cas_number: { type: 'string', description: 'CAS Registry Number (e.g., 50-78-2)' },
        },
        required: ['cas_number'],
      },
    },
  • src/index.ts:748-749 (registration)
    The switch case in the CallToolRequestSchema handler that dispatches to the tool's handler function.
    case 'search_by_cas_number':
      return await this.handleSearchByCasNumber(args);
  • src/index.ts:366-733 (registration)
    The ListToolsRequestSchema handler that registers/declares the 'search_by_cas_number' tool among others, including its schema.
    private setupToolHandlers() {
      this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
        tools: [
          // Chemical Search & Retrieval (6 tools)
          {
            name: 'search_compounds',
            description: 'Search PubChem database for compounds by name, CAS number, formula, or identifier',
            inputSchema: {
              type: 'object',
              properties: {
                query: { type: 'string', description: 'Search query (compound name, CAS, formula, or identifier)' },
                search_type: { type: 'string', enum: ['name', 'smiles', 'inchi', 'sdf', 'cid', 'formula'], description: 'Type of search to perform (default: name)' },
                max_records: { type: 'number', description: 'Maximum number of results (1-10000, default: 100)', minimum: 1, maximum: 10000 },
              },
              required: ['query'],
            },
          },
          {
            name: 'get_compound_info',
            description: 'Get detailed information for a specific compound by PubChem CID',
            inputSchema: {
              type: 'object',
              properties: {
                cid: { type: ['number', 'string'], description: 'PubChem Compound ID (CID)' },
                format: { type: 'string', enum: ['json', 'sdf', 'xml', 'asnt', 'asnb'], description: 'Output format (default: json)' },
              },
              required: ['cid'],
            },
          },
          {
            name: 'search_by_smiles',
            description: 'Search for compounds by SMILES string (exact match)',
            inputSchema: {
              type: 'object',
              properties: {
                smiles: { type: 'string', description: 'SMILES string of the query molecule' },
              },
              required: ['smiles'],
            },
          },
          {
            name: 'search_by_inchi',
            description: 'Search for compounds by InChI or InChI key',
            inputSchema: {
              type: 'object',
              properties: {
                inchi: { type: 'string', description: 'InChI string or InChI key' },
              },
              required: ['inchi'],
            },
          },
          {
            name: 'search_by_cas_number',
            description: 'Search for compounds by CAS Registry Number',
            inputSchema: {
              type: 'object',
              properties: {
                cas_number: { type: 'string', description: 'CAS Registry Number (e.g., 50-78-2)' },
              },
              required: ['cas_number'],
            },
          },
          {
            name: 'get_compound_synonyms',
            description: 'Get all names and synonyms for a compound',
            inputSchema: {
              type: 'object',
              properties: {
                cid: { type: ['number', 'string'], description: 'PubChem Compound ID (CID)' },
              },
              required: ['cid'],
            },
          },
    
          // Structure Analysis & Similarity (5 tools)
          {
            name: 'search_similar_compounds',
            description: 'Find chemically similar compounds using Tanimoto similarity',
            inputSchema: {
              type: 'object',
              properties: {
                smiles: { type: 'string', description: 'SMILES string of the query molecule' },
                threshold: { type: 'number', description: 'Similarity threshold (0-100, default: 90)', minimum: 0, maximum: 100 },
                max_records: { type: 'number', description: 'Maximum number of results (1-10000, default: 100)', minimum: 1, maximum: 10000 },
              },
              required: ['smiles'],
            },
          },
          {
            name: 'substructure_search',
            description: 'Find compounds containing a specific substructure',
            inputSchema: {
              type: 'object',
              properties: {
                smiles: { type: 'string', description: 'SMILES string of the substructure query' },
                max_records: { type: 'number', description: 'Maximum number of results (1-10000, default: 100)', minimum: 1, maximum: 10000 },
              },
              required: ['smiles'],
            },
          },
          {
            name: 'superstructure_search',
            description: 'Find larger compounds that contain the query structure',
            inputSchema: {
              type: 'object',
              properties: {
                smiles: { type: 'string', description: 'SMILES string of the query structure' },
                max_records: { type: 'number', description: 'Maximum number of results (1-10000, default: 100)', minimum: 1, maximum: 10000 },
              },
              required: ['smiles'],
            },
          },
          {
            name: 'get_3d_conformers',
            description: 'Get 3D conformer data and structural information',
            inputSchema: {
              type: 'object',
              properties: {
                cid: { type: ['number', 'string'], description: 'PubChem Compound ID (CID)' },
                conformer_type: { type: 'string', enum: ['3d', '2d'], description: 'Type of conformer data (default: 3d)' },
              },
              required: ['cid'],
            },
          },
          {
            name: 'analyze_stereochemistry',
            description: 'Analyze stereochemistry, chirality, and isomer information',
            inputSchema: {
              type: 'object',
              properties: {
                cid: { type: ['number', 'string'], description: 'PubChem Compound ID (CID)' },
              },
              required: ['cid'],
            },
          },
    
          // Chemical Properties & Descriptors (6 tools)
          {
            name: 'get_compound_properties',
            description: 'Get molecular properties (MW, logP, TPSA, etc.)',
            inputSchema: {
              type: 'object',
              properties: {
                cid: { type: ['number', 'string'], description: 'PubChem Compound ID (CID)' },
                properties: { type: 'array', items: { type: 'string' }, description: 'Specific properties to retrieve (optional)' },
              },
              required: ['cid'],
            },
          },
          {
            name: 'calculate_descriptors',
            description: 'Calculate comprehensive molecular descriptors and fingerprints',
            inputSchema: {
              type: 'object',
              properties: {
                cid: { type: ['number', 'string'], description: 'PubChem Compound ID (CID)' },
                descriptor_type: { type: 'string', enum: ['all', 'basic', 'topological', '3d'], description: 'Type of descriptors (default: all)' },
              },
              required: ['cid'],
            },
          },
          {
            name: 'predict_admet_properties',
            description: 'Predict ADMET properties (Absorption, Distribution, Metabolism, Excretion, Toxicity)',
            inputSchema: {
              type: 'object',
              properties: {
                cid: { type: ['number', 'string'], description: 'PubChem Compound ID (CID)' },
                smiles: { type: 'string', description: 'SMILES string (alternative to CID)' },
              },
              required: [],
            },
          },
          {
            name: 'assess_drug_likeness',
            description: 'Assess drug-likeness using Lipinski Rule of Five, Veber rules, and PAINS filters',
            inputSchema: {
              type: 'object',
              properties: {
                cid: { type: ['number', 'string'], description: 'PubChem Compound ID (CID)' },
                smiles: { type: 'string', description: 'SMILES string (alternative to CID)' },
              },
              required: [],
            },
          },
          {
            name: 'analyze_molecular_complexity',
            description: 'Analyze molecular complexity and synthetic accessibility',
            inputSchema: {
              type: 'object',
              properties: {
                cid: { type: ['number', 'string'], description: 'PubChem Compound ID (CID)' },
              },
              required: ['cid'],
            },
          },
          {
            name: 'get_pharmacophore_features',
            description: 'Get pharmacophore features and binding site information',
            inputSchema: {
              type: 'object',
              properties: {
                cid: { type: ['number', 'string'], description: 'PubChem Compound ID (CID)' },
              },
              required: ['cid'],
            },
          },
    
          // Bioassay & Activity Data (5 tools)
          {
            name: 'search_bioassays',
            description: 'Search for biological assays by target, description, or source',
            inputSchema: {
              type: 'object',
              properties: {
                query: { type: 'string', description: 'General search query' },
                target: { type: 'string', description: 'Target protein or gene name' },
                source: { type: 'string', description: 'Data source (e.g., ChEMBL, NCGC)' },
                max_records: { type: 'number', description: 'Maximum number of results (1-1000, default: 100)', minimum: 1, maximum: 1000 },
              },
              required: [],
            },
          },
          {
            name: 'get_assay_info',
            description: 'Get detailed information for a specific bioassay by AID',
            inputSchema: {
              type: 'object',
              properties: {
                aid: { type: 'number', description: 'PubChem Assay ID (AID)' },
              },
              required: ['aid'],
            },
          },
          {
            name: 'get_compound_bioactivities',
            description: 'Get all bioassay results and activities for a compound',
            inputSchema: {
              type: 'object',
              properties: {
                cid: { type: ['number', 'string'], description: 'PubChem Compound ID (CID)' },
                activity_outcome: { type: 'string', enum: ['active', 'inactive', 'inconclusive', 'all'], description: 'Filter by activity outcome (default: all)' },
              },
              required: ['cid'],
            },
          },
          {
            name: 'search_by_target',
            description: 'Find compounds tested against a specific biological target',
            inputSchema: {
              type: 'object',
              properties: {
                target: { type: 'string', description: 'Target name (gene, protein, or pathway)' },
                activity_type: { type: 'string', description: 'Type of activity (e.g., IC50, EC50, Ki)' },
                max_records: { type: 'number', description: 'Maximum number of results (1-1000, default: 100)', minimum: 1, maximum: 1000 },
              },
              required: ['target'],
            },
          },
          {
            name: 'compare_activity_profiles',
            description: 'Compare bioactivity profiles across multiple compounds',
            inputSchema: {
              type: 'object',
              properties: {
                cids: { type: 'array', items: { type: 'number' }, description: 'Array of PubChem CIDs (2-50)', minItems: 2, maxItems: 50 },
                activity_type: { type: 'string', description: 'Specific activity type for comparison (optional)' },
              },
              required: ['cids'],
            },
          },
    
          // Safety & Toxicity (4 tools)
          {
            name: 'get_safety_data',
            description: 'Get GHS hazard classifications and safety information',
            inputSchema: {
              type: 'object',
              properties: {
                cid: { type: ['number', 'string'], description: 'PubChem Compound ID (CID)' },
              },
              required: ['cid'],
            },
          },
          {
            name: 'get_toxicity_info',
            description: 'Get toxicity data including LD50, carcinogenicity, and mutagenicity',
            inputSchema: {
              type: 'object',
              properties: {
                cid: { type: ['number', 'string'], description: 'PubChem Compound ID (CID)' },
              },
              required: ['cid'],
            },
          },
          {
            name: 'assess_environmental_fate',
            description: 'Assess environmental fate including biodegradation and bioaccumulation',
            inputSchema: {
              type: 'object',
              properties: {
                cid: { type: ['number', 'string'], description: 'PubChem Compound ID (CID)' },
              },
              required: ['cid'],
            },
          },
          {
            name: 'get_regulatory_info',
            description: 'Get regulatory information from FDA, EPA, and international agencies',
            inputSchema: {
              type: 'object',
              properties: {
                cid: { type: ['number', 'string'], description: 'PubChem Compound ID (CID)' },
              },
              required: ['cid'],
            },
          },
    
          // Cross-References & Integration (4 tools)
          {
            name: 'get_external_references',
            description: 'Get links to external databases (ChEMBL, DrugBank, KEGG, etc.)',
            inputSchema: {
              type: 'object',
              properties: {
                cid: { type: ['number', 'string'], description: 'PubChem Compound ID (CID)' },
              },
              required: ['cid'],
            },
          },
          {
            name: 'search_patents',
            description: 'Search for chemical patents and intellectual property information',
            inputSchema: {
              type: 'object',
              properties: {
                cid: { type: ['number', 'string'], description: 'PubChem Compound ID (CID)' },
                query: { type: 'string', description: 'Patent search query (alternative to CID)' },
              },
              required: [],
            },
          },
          {
            name: 'get_literature_references',
            description: 'Get PubMed citations and scientific literature references',
            inputSchema: {
              type: 'object',
              properties: {
                cid: { type: ['number', 'string'], description: 'PubChem Compound ID (CID)' },
              },
              required: ['cid'],
            },
          },
          {
            name: 'batch_compound_lookup',
            description: 'Process multiple compound IDs efficiently',
            inputSchema: {
              type: 'object',
              properties: {
                cids: { type: 'array', items: { type: 'number' }, description: 'Array of PubChem CIDs (1-200)', minItems: 1, maxItems: 200 },
                operation: { type: 'string', enum: ['property', 'synonyms', 'classification', 'description'], description: 'Operation to perform (default: property)' },
              },
              required: ['cids'],
            },
          },
        ],
      }));

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.9/5.0
Behavior2/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 of behavioral disclosure. It states the tool searches for compounds, implying a read-only operation, but doesn't clarify aspects like whether it returns a single compound or multiple matches, error handling for invalid CAS numbers, rate limits, or authentication needs. For a search tool with zero annotation coverage, this is a significant gap in transparency.

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, efficient sentence: 'Search for compounds by CAS Registry Number'. It's front-loaded with the core purpose, has zero wasted words, and is appropriately sized for a simple search tool. Every part of the sentence contributes essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., compound details, a list, or an error for no matches), behavioral traits, or usage context relative to siblings. For a search tool in a complex chemical domain with many alternatives, more guidance is needed to help the agent use 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?

The input schema has 100% description coverage, with the parameter 'cas_number' fully documented in the schema itself. The description adds no additional parameter information beyond what's in the schema. According to the rules, when schema_description_coverage is high (>80%), the baseline is 3 even with no param info in the description, which applies here.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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: 'Search for compounds by CAS Registry Number'. It specifies the verb ('search') and resource ('compounds'), and the CAS Registry Number provides a specific identifier type. However, it doesn't differentiate from sibling tools like 'search_by_inchi' or 'search_by_smiles' that also search compounds by different identifiers, so it doesn't reach the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'search_by_inchi' or 'search_by_smiles' for other identifier types, or 'search_compounds' for broader searches. There's no context on prerequisites, limitations, or typical use cases, leaving the agent to infer usage from the name alone.

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