Skip to main content
Glama

search_by_inchi

Identify chemicals in the SureChEMBL patent database using InChI or InChI key queries, with adjustable result limits for precise chemical patent research.

Instructions

Search for chemicals by InChI or InChI key

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inchiYesInChI string or InChI key
limitNoNumber of results to return (1-1000, default: 25)

Implementation Reference

  • The handler function for the 'search_by_inchi' tool. Validates the input arguments, notes that direct InChI search is not supported by the SureChEMBL API, and returns a helpful message with suggestions.
    private async handleSearchByInchi(args: any) { if (!args || typeof args.inchi !== 'string') { throw new McpError(ErrorCode.InvalidParams, 'Invalid InChI string'); } try { // SureChEMBL doesn't have direct InChI search, so we'll return a helpful message return { content: [ { type: 'text', text: JSON.stringify({ message: 'InChI search not directly supported by SureChEMBL API', inchi: args.inchi, suggestion: 'Try converting InChI to chemical name or use chemical ID lookup' }, null, 2), }, ], }; } catch (error) { throw new McpError( ErrorCode.InternalError, `Failed to search by InChI: ${error instanceof Error ? error.message : 'Unknown error'}` ); } }
  • The tool definition including name, description, and input schema for 'search_by_inchi' registered in the ListToolsRequestSchema handler.
    name: 'search_by_inchi', description: 'Search for chemicals by InChI or InChI key', inputSchema: { type: 'object', properties: { inchi: { type: 'string', description: 'InChI string or InChI key' }, limit: { type: 'number', description: 'Number of results to return (1-1000, default: 25)', minimum: 1, maximum: 1000 }, }, required: ['inchi'], }, },
  • src/index.ts:559-560 (registration)
    The switch case in the CallToolRequestSchema handler that dispatches 'search_by_inchi' calls to the handleSearchByInchi method.
    case 'search_by_inchi': return await this.handleSearchByInchi(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