Skip to main content
Glama
Augmented-Nature

ChEMBL MCP Server

get_target_info

Retrieve detailed biological target information using ChEMBL target IDs to support drug discovery research and analysis.

Instructions

Get detailed information for a specific target by ChEMBL target ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chembl_idYesChEMBL target ID (e.g., CHEMBL2095173)

Implementation Reference

  • The main handler function that implements the get_target_info tool. It validates input, fetches target data from ChEMBL API endpoint /target/{chembl_id}.json, and returns formatted JSON response.
    private async handleGetTargetInfo(args: any) {
      if (!isValidChemblIdArgs(args)) {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid arguments');
      }
    
      try {
        const response = await this.apiClient.get(`/target/${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 target info: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    }
  • src/index.ts:472-482 (registration)
    Tool registration in ListToolsRequestSchema handler, defining name, description, and input schema.
    {
      name: 'get_target_info',
      description: 'Get detailed information for a specific target by ChEMBL target ID',
      inputSchema: {
        type: 'object',
        properties: {
          chembl_id: { type: 'string', description: 'ChEMBL target ID (e.g., CHEMBL2095173)' },
        },
        required: ['chembl_id'],
      },
    },
  • src/index.ts:758-759 (registration)
    Dispatch/registration in CallToolRequestSchema switch statement, routing calls to the handler.
    case 'get_target_info':
      return await this.handleGetTargetInfo(args);
  • Input validation helper function used by the handler to check chembl_id parameter.
    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
      );
    };
  • TypeScript interface defining the structure of target information returned by ChEMBL API.
    interface TargetInfo {
      target_chembl_id: string;
      pref_name: string;
      target_type: string;
      organism: string;
      species_group_flag: boolean;
      target_components?: Array<{
        component_id: number;
        component_type: string;
        accession?: string;
        sequence?: string;
      }>;
    }

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