Skip to main content
Glama
Augmented-Nature

ChEMBL MCP Server

batch_compound_lookup

Look up multiple ChEMBL compound IDs simultaneously to retrieve chemical data efficiently. Process up to 50 IDs in a single request.

Instructions

Process multiple ChEMBL IDs efficiently

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chembl_idsYesArray of ChEMBL compound IDs (1-50)

Implementation Reference

  • The primary handler function that implements the batch_compound_lookup tool logic. It validates the input arguments, iterates over the provided ChEMBL IDs (limited to 10 for demo), fetches compound data from the ChEMBL API for each, and compiles results including success status and any errors.
    private async handleBatchCompoundLookup(args: any) {
      if (!isValidBatchArgs(args)) {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid batch arguments');
      }
    
      try {
        const results = [];
        for (const chemblId of args.chembl_ids.slice(0, 10)) { // Limit to 10 for demo
          try {
            const response = await this.apiClient.get(`/molecule/${chemblId}.json`);
            results.push({ chembl_id: chemblId, data: response.data, success: true });
          } catch (error) {
            results.push({ chembl_id: chemblId, error: error instanceof Error ? error.message : 'Unknown error', success: false });
          }
        }
    
        return { content: [{ type: 'text', text: JSON.stringify({ batch_results: results }, null, 2) }] };
      } catch (error) {
        throw new McpError(ErrorCode.InternalError, `Batch lookup failed: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    }
  • src/index.ts:697-707 (registration)
    Tool registration entry in the ListTools response, defining the tool name, description, and JSON input schema for validation.
    {
      name: 'batch_compound_lookup',
      description: 'Process multiple ChEMBL IDs efficiently',
      inputSchema: {
        type: 'object',
        properties: {
          chembl_ids: { type: 'array', items: { type: 'string' }, description: 'Array of ChEMBL compound IDs (1-50)', minItems: 1, maxItems: 50 },
        },
        required: ['chembl_ids'],
      },
    },
  • src/index.ts:798-799 (registration)
    Dispatch registration in the CallToolRequestSchema switch statement that routes calls to the handler function.
    case 'batch_compound_lookup':
      return await this.handleBatchCompoundLookup(args);
  • Type guard and validation function specifically for batch_compound_lookup input arguments, ensuring chembl_ids is a valid array of 1-50 non-empty strings.
    const isValidBatchArgs = (
      args: any
    ): args is { chembl_ids: string[] } => {
      return (
        typeof args === 'object' &&
        args !== null &&
        Array.isArray(args.chembl_ids) &&
        args.chembl_ids.length > 0 &&
        args.chembl_ids.length <= 50 &&
        args.chembl_ids.every((id: any) => typeof id === 'string' && id.length > 0)
      );
    };
  • Error handling within the batch handler, but primarily covered in handler. Additional helper note.
      throw new McpError(ErrorCode.InternalError, `Batch lookup failed: ${error instanceof Error ? error.message : 'Unknown error'}`);
    }
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 mentions 'efficiently' which suggests performance characteristics but doesn't specify rate limits, authentication requirements, error handling, or what 'process' actually entails (e.g., returns compound data, validates IDs). The description is too vague about the actual behavior.

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 extremely concise at just 5 words, with zero wasted language. It's front-loaded with the core purpose and includes a performance hint ('efficiently'). Every word earns its place in this minimal description.

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 tool with no annotations and no output schema, the description is inadequate. It doesn't explain what 'process' means (what data is returned), doesn't mention the 1-50 item limit that's only in the schema, and provides no context about authentication, rate limits, or error conditions that would be important for an AI agent to use this tool correctly.

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%, with the parameter 'chembl_ids' well-documented in the schema (array of strings, 1-50 items). The description adds minimal value beyond what's in the schema - it mentions 'multiple ChEMBL IDs' which aligns with the array parameter but doesn't provide additional context about ID format or processing specifics.

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 action ('process multiple ChEMBL IDs') and resource ('ChEMBL IDs'), making the purpose understandable. However, it doesn't differentiate this batch lookup tool from its sibling 'get_compound_info' which appears to handle individual compound lookups, missing an opportunity for clear sibling distinction.

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 'get_compound_info' for single lookups or 'search_compounds' for broader searches. The word 'efficiently' hints at performance benefits for batch operations but doesn't explicitly state this is for multiple IDs versus single ones.

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