Skip to main content
Glama

search_by_inchi

Identify chemical compounds using InChI keys or strings, with customizable result limits, on the ChEMBL MCP Server for precise compound searches.

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

  • The handler function that executes the 'search_by_inchi' tool. It validates the input, queries the ChEMBL API's molecule/search endpoint using the provided InChI as the search query 'q', and returns the JSON response.
    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'}` ); } }
  • The input schema definition for the 'search_by_inchi' tool as returned by ListToolsRequestSchema. Defines required 'inchi' string parameter 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)
    The switch case in the CallToolRequestSchema handler that routes calls to 'search_by_inchi' 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/ChEMBL-MCP-Server'

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