Skip to main content
Glama

search_drugs

Find approved drugs and clinical candidates by name, development phase, or therapeutic area using the ChEMBL database.

Instructions

Search for approved drugs and clinical candidates

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesDrug name or search query
development_phaseNoDevelopment phase filter (e.g., Approved, Phase III)
therapeutic_areaNoTherapeutic area filter
limitNoNumber of results to return (1-1000, default: 25)

Implementation Reference

  • The main handler function that implements the logic for the 'search_drugs' tool. It performs input validation, queries the ChEMBL molecule search API, filters results for approved drugs and clinical candidates (max_phase >= 1), and returns formatted JSON results.
    private async handleSearchDrugs(args: any) { if (!args || typeof args.query !== 'string') { throw new McpError(ErrorCode.InvalidParams, 'Invalid drug search arguments'); } try { // Search for drugs using molecule endpoint with max_phase filter const params: any = { q: args.query, limit: args.limit || 25, }; const response = await this.apiClient.get('/molecule/search.json', { params }); const molecules = response.data.molecules || []; // Filter for drugs (molecules with max_phase >= 1) const drugs = molecules.filter((m: any) => m.max_phase && m.max_phase >= 1); return { content: [ { type: 'text', text: JSON.stringify({ query: args.query, total_results: drugs.length, drugs: drugs, }, null, 2), }, ], }; } catch (error) { throw new McpError( ErrorCode.InternalError, `Failed to search drugs: ${error instanceof Error ? error.message : 'Unknown error'}` ); } }
  • The input schema definition for the 'search_drugs' tool, specifying parameters like query (required), development_phase, therapeutic_area, and limit.
    name: 'search_drugs', description: 'Search for approved drugs and clinical candidates', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Drug name or search query' }, development_phase: { type: 'string', description: 'Development phase filter (e.g., Approved, Phase III)' }, therapeutic_area: { type: 'string', description: 'Therapeutic area filter' }, limit: { type: 'number', description: 'Number of results to return (1-1000, default: 25)', minimum: 1, maximum: 1000 }, }, required: ['query'], }, },
  • src/index.ts:778-779 (registration)
    The registration that maps the tool name 'search_drugs' to its handler function in the CallToolRequestSchema switch statement.
    case 'search_drugs': return await this.handleSearchDrugs(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/ChEMBL-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server