Skip to main content
Glama

search_by_inchi

Find chemicals in the SureChEMBL patent database using InChI strings or InChI keys to identify compounds and their patent information.

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 that executes the tool logic for 'search_by_inchi'. It validates the input 'inchi' parameter and returns a standardized response indicating that direct InChI search is not supported by the SureChEMBL API, providing a helpful message and suggestion.
    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 input schema definition for the 'search_by_inchi' tool, including properties for 'inchi' (required string) and optional 'limit' (number between 1-1000). This is part of the tools list returned by ListToolsRequest.
    { 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 CallToolRequest handler that registers and 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