Skip to main content
Glama

search_by_smiles

Search the SureChEMBL chemical patent database by entering a SMILES string to identify relevant chemical structures and retrieve related patent data.

Instructions

Search for chemicals by SMILES structure notation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of results to return (1-1000, default: 25)
smilesYesSMILES string of the chemical structure

Implementation Reference

  • The handler function that implements the core logic for the 'search_by_smiles' tool. It validates the input SMILES string and returns a response indicating that direct SMILES search is not supported by the SureChEMBL API, with suggestions for alternatives.
    private async handleSearchBySmiles(args: any) { if (!args || typeof args.smiles !== 'string') { throw new McpError(ErrorCode.InvalidParams, 'Invalid SMILES string'); } try { // SureChEMBL doesn't have direct SMILES search, so we'll return a helpful message return { content: [ { type: 'text', text: JSON.stringify({ message: 'SMILES search not directly supported by SureChEMBL API', smiles: args.smiles, suggestion: 'Try converting SMILES to chemical name or use structure-based search tools' }, null, 2), }, ], }; } catch (error) { throw new McpError( ErrorCode.InternalError, `Failed to search by SMILES: ${error instanceof Error ? error.message : 'Unknown error'}` ); } }
  • Input schema definition for the 'search_by_smiles' tool, specifying the required 'smiles' parameter and optional 'limit'.
    inputSchema: { type: 'object', properties: { smiles: { type: 'string', description: 'SMILES string of the chemical structure' }, limit: { type: 'number', description: 'Number of results to return (1-1000, default: 25)', minimum: 1, maximum: 1000 }, }, required: ['smiles'], },
  • src/index.ts:410-421 (registration)
    The tool registration object in the tools array passed to server.setTools(), defining the tool's name, description, and input schema.
    { name: 'search_by_smiles', description: 'Search for chemicals by SMILES structure notation', inputSchema: { type: 'object', properties: { smiles: { type: 'string', description: 'SMILES string of the chemical structure' }, limit: { type: 'number', description: 'Number of results to return (1-1000, default: 25)', minimum: 1, maximum: 1000 }, }, required: ['smiles'], }, },
  • src/index.ts:557-558 (registration)
    Dispatch case in the MCP request handler (setRequestHandler) that routes 'search_by_smiles' tool calls to the handleSearchBySmiles method.
    case 'search_by_smiles': return await this.handleSearchBySmiles(args);

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