search_targets
Search for biological targets by name, type, or organism using the ChEMBL MCP Server to streamline research and data retrieval.
Instructions
Search for biological targets by name or type
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of results to return (1-1000, default: 25) | |
| organism | No | Organism filter | |
| query | Yes | Target name or search query | |
| target_type | No | Target type filter (e.g., SINGLE PROTEIN, PROTEIN COMPLEX) |
Implementation Reference
- src/index.ts:965-974 (handler)The handler function that implements the core logic of the 'search_targets' tool. It makes an API call to ChEMBL's target search endpoint and returns the JSON results.private async handleSearchTargets(args: any) { try { const response = await this.apiClient.get('/target/search.json', { params: { q: args.query, 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 targets: ${error instanceof Error ? error.message : 'Unknown error'}`); } }
- src/index.ts:459-470 (schema)The input schema for the 'search_targets' tool, defining parameters like query, target_type, organism, and limit. Registered in the ListTools response.name: 'search_targets', description: 'Search for biological targets by name or type', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Target name or search query' }, target_type: { type: 'string', description: 'Target type filter (e.g., SINGLE PROTEIN, PROTEIN COMPLEX)' }, organism: { type: 'string', description: 'Organism filter' }, limit: { type: 'number', description: 'Number of results to return (1-1000, default: 25)', minimum: 1, maximum: 1000 }, }, required: ['query'], },
- src/index.ts:756-757 (registration)Registration of the tool handler in the central CallToolRequestSchema switch statement, dispatching calls to handleSearchTargets.case 'search_targets': return await this.handleSearchTargets(args);