Skip to main content
Glama

search_by_inchi

Find chemical compounds using InChI keys or strings to retrieve detailed information from the ChEMBL database.

Instructions

Search for compounds by InChI key or InChI string

Input Schema

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

Implementation Reference

  • Handler function that implements the core logic of the 'search_by_inchi' tool by querying the ChEMBL molecule search API with the provided InChI string or key.
    private async handleSearchByInchi(args: any) { if (!args || typeof args.inchi !== 'string') { throw new McpError(ErrorCode.InvalidParams, 'Invalid InChI arguments'); } try { // ChEMBL supports InChI and InChI key searches const response = await this.apiClient.get('/molecule/search.json', { params: { q: args.inchi, limit: args.limit || 25, }, }); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { throw new McpError( ErrorCode.InternalError, `Failed to search by InChI: ${error instanceof Error ? error.message : 'Unknown error'}` ); } }
  • Input schema definition for the 'search_by_inchi' tool, specifying parameters 'inchi' (required string) and optional 'limit'.
    name: 'search_by_inchi', description: 'Search for compounds by InChI key or InChI string', inputSchema: { type: 'object', properties: { inchi: { type: 'string', description: 'InChI key or InChI string' }, limit: { type: 'number', description: 'Number of results to return (1-1000, default: 25)', minimum: 1, maximum: 1000 }, }, required: ['inchi'], }, },
  • src/index.ts:749-750 (registration)
    Registration/dispatch of the 'search_by_inchi' tool handler in the main tool execution switch statement.
    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/ChEMBL-MCP-Server'

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