Skip to main content
Glama
Augmented-Nature

ChEMBL MCP Server

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);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states the search action but doesn't describe what happens if no matches are found, whether results are paginated, what format they return, or any rate limits or authentication requirements. For a search tool with zero annotation coverage, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose with zero wasted words. It's appropriately sized for a straightforward search operation and front-loads the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a search tool with no annotations and no output schema, the description is incomplete. It doesn't explain what kind of results to expect, their format, or any behavioral aspects like error handling. Given the context of chemical compound searching which could return complex data, more guidance would be helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already fully documents both parameters. The description mentions 'InChI key or InChI string' which aligns with the schema's parameter description but doesn't add meaningful semantic context beyond what's already in the structured data.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'search' and the resource 'compounds', specifying the search criteria as 'by InChI key or InChI string'. This distinguishes it from siblings like 'search_compounds' or 'substructure_search' which likely use different search methods, though it doesn't explicitly name those alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'search_compounds', 'substructure_search', or 'batch_compound_lookup'. It doesn't mention prerequisites, exclusions, or specific scenarios where InChI-based searching is preferred over other methods.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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