Skip to main content
Glama
Augmented-Nature

ChEMBL MCP Server

get_assay_info

Retrieve detailed assay information from ChEMBL database using the assay ID to access experimental data and metadata.

Instructions

Get detailed information for a specific assay by ChEMBL assay ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chembl_idYesChEMBL assay ID (e.g., CHEMBL1217643)

Implementation Reference

  • The core handler function that implements the logic for the 'get_assay_info' tool. It validates the input chembl_id and fetches detailed assay information from the ChEMBL API.
    private async handleGetAssayInfo(args: any) {
      if (!isValidChemblIdArgs(args)) {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid arguments');
      }
    
      try {
        const response = await this.apiClient.get(`/assay/${args.chembl_id}.json`);
        return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }] };
      } catch (error) {
        throw new McpError(ErrorCode.InternalError, `Failed to get assay info: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    }
  • The tool's metadata including name, description, and input schema definition, provided in response to ListToolsRequest.
      name: 'get_assay_info',
      description: 'Get detailed information for a specific assay by ChEMBL assay ID',
      inputSchema: {
        type: 'object',
        properties: {
          chembl_id: { type: 'string', description: 'ChEMBL assay ID (e.g., CHEMBL1217643)' },
        },
        required: ['chembl_id'],
      },
    },
  • src/index.ts:769-770 (registration)
    Dispatches calls to the 'get_assay_info' tool handler within the CallToolRequestSchema request handler.
    case 'get_assay_info':
      return await this.handleGetAssayInfo(args);
  • Type guard and validation function for chembl_id arguments, used by get_assay_info and similar tools.
    const isValidChemblIdArgs = (
      args: any
    ): args is { chembl_id: string } => {
      return (
        typeof args === 'object' &&
        args !== null &&
        typeof args.chembl_id === 'string' &&
        args.chembl_id.length > 0
      );
    };
  • src/index.ts:309-330 (registration)
    Related resource handler for assay data (chembl://assay/{id}), which performs identical API fetch as the tool.
    // Handle assay info requests
    const assayMatch = uri.match(/^chembl:\/\/assay\/([A-Z0-9]+)$/);
    if (assayMatch) {
      const chemblId = assayMatch[1];
      try {
        const response = await this.apiClient.get(`/assay/${chemblId}.json`);
        return {
          contents: [
            {
              uri: request.params.uri,
              mimeType: 'application/json',
              text: JSON.stringify(response.data, null, 2),
            },
          ],
        };
      } catch (error) {
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to fetch assay ${chemblId}: ${error instanceof Error ? error.message : 'Unknown error'}`
        );
      }
    }

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