Skip to main content
Glama
Augmented-Nature

SureChEMBL MCP Server

search_similar_structures

Find chemically similar compounds in patent databases by comparing molecular structures to a reference chemical, enabling discovery of related substances and prior art.

Instructions

Find structurally similar chemicals using similarity search

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
reference_idYesReference chemical ID for similarity search
thresholdNoSimilarity threshold (0.0-1.0, default: 0.7)
limitNoNumber of results to return (1-100, default: 25)

Implementation Reference

  • The handler function executing the tool logic. It fetches the reference chemical and returns a mock similarity search result with suggestions since direct similarity search is not supported.
    private async handleSearchSimilarStructures(args: any) {
      if (!args || typeof args.reference_id !== 'string') {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid reference chemical ID');
      }
    
      try {
        // Get the reference chemical first
        const refResponse = await this.apiClient.get(`/chemical/id/${args.reference_id}`);
        const refChemical = refResponse.data.data?.[0];
    
        if (!refChemical) {
          throw new Error('Reference chemical not found');
        }
    
        // Since SureChEMBL doesn't have direct similarity search, we'll provide a mock implementation
        // that explains the limitation and suggests alternatives
        const similarityResult = {
          reference_chemical: {
            id: args.reference_id,
            name: refChemical.name,
            smiles: refChemical.smiles,
            molecular_weight: refChemical.mol_weight
          },
          search_parameters: {
            threshold: args.threshold || 0.7,
            limit: args.limit || 25
          },
          message: 'Direct similarity search not available in SureChEMBL API',
          suggestions: [
            'Use chemical name variations to find related compounds',
            'Search by molecular weight ranges',
            'Use external cheminformatics tools for similarity search',
            'Try searching by chemical class or functional groups'
          ],
          alternative_searches: {
            by_name_fragments: `Try searching for fragments of "${refChemical.name}"`,
            by_molecular_weight: `Search for compounds with molecular weight around ${refChemical.mol_weight}`,
            by_chemical_class: 'Search for compounds in the same chemical class'
          }
        };
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(similarityResult, null, 2),
            },
          ],
        };
      } catch (error) {
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to search similar structures: ${error instanceof Error ? error.message : 'Unknown error'}`
        );
      }
    }
  • Input schema defining parameters for the search_similar_structures tool.
    inputSchema: {
      type: 'object',
      properties: {
        reference_id: { type: 'string', description: 'Reference chemical ID for similarity search' },
        threshold: { type: 'number', description: 'Similarity threshold (0.0-1.0, default: 0.7)', minimum: 0.0, maximum: 1.0 },
        limit: { type: 'number', description: 'Number of results to return (1-100, default: 25)', minimum: 1, maximum: 100 },
      },
      required: ['reference_id'],
    },
  • src/index.ts:510-522 (registration)
    Tool registration object including name, description, and schema in the tools array.
    {
      name: 'search_similar_structures',
      description: 'Find structurally similar chemicals using similarity search',
      inputSchema: {
        type: 'object',
        properties: {
          reference_id: { type: 'string', description: 'Reference chemical ID for similarity search' },
          threshold: { type: 'number', description: 'Similarity threshold (0.0-1.0, default: 0.7)', minimum: 0.0, maximum: 1.0 },
          limit: { type: 'number', description: 'Number of results to return (1-100, default: 25)', minimum: 1, maximum: 100 },
        },
        required: ['reference_id'],
      },
    },
  • src/index.ts:574-575 (registration)
    Switch case in the request handler dispatching to the tool handler.
    case 'search_similar_structures':
      return await this.handleSearchSimilarStructures(args);
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 mentions 'similarity search' but doesn't specify what similarity metric is used (e.g., Tanimoto, Euclidean), whether results are paginated, rate limits, authentication needs, or what the output format looks like. This leaves significant gaps for an AI agent to understand how to invoke it effectively.

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 that front-loads the core action ('Find structurally similar chemicals') without unnecessary words. Every part earns its place by specifying the method ('using similarity search'), making it appropriately sized and well-structured.

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 no annotations and no output schema, the description is incomplete for a tool with 3 parameters and behavioral complexity. It lacks details on the similarity metric, result format, error handling, or performance characteristics, which are crucial for an AI agent to use this tool correctly in a chemical search context.

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, clearly documenting all three parameters with types, ranges, and defaults. The description adds no additional parameter semantics beyond what's in the schema, such as explaining what 'reference_id' refers to (e.g., a database ID, SMILES string) or how 'threshold' impacts results. Baseline 3 is appropriate since the schema does the heavy lifting.

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 verb 'Find' and resource 'structurally similar chemicals' with the method 'using similarity search', making the purpose evident. However, it doesn't explicitly differentiate from sibling tools like 'search_by_smiles' or 'search_chemicals_by_name', which might also involve chemical searching but with different criteria.

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. With sibling tools like 'search_by_smiles' or 'search_chemicals_by_name' available, there's no indication of when structural similarity search is preferred over other search methods, nor any prerequisites or exclusions mentioned.

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/Augmented-Nature/SureChEMBL-MCP-Server'

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