search_by_uniprot
Find ChEMBL targets using UniProt accession numbers to identify relevant biological targets in drug discovery research.
Instructions
Find ChEMBL targets by UniProt accession
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"uniprot_id": "<uniprot_id>"
},
"name": "search_by_uniprot"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uniprot_id | Yes | UniProt accession number | |
| limit | No | Number of results to return (1-1000, default: 25) |
Implementation Reference
- src/index.ts:1033-1059 (handler)The handler function for the 'search_by_uniprot' tool. It validates the uniprot_id argument, queries the ChEMBL target/search API with the UniProt ID, and returns the JSON response.
private async handleSearchByUniprot(args: any) { if (!args || typeof args.uniprot_id !== 'string') { throw new McpError(ErrorCode.InvalidParams, 'Invalid UniProt arguments'); } try { const response = await this.apiClient.get('/target/search.json', { params: { q: args.uniprot_id, 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 by UniProt: ${error instanceof Error ? error.message : 'Unknown error'}` ); } - src/index.ts:499-506 (schema)Input schema definition for the 'search_by_uniprot' tool, specifying uniprot_id as required string and optional limit.
inputSchema: { type: 'object', properties: { uniprot_id: { type: 'string', description: 'UniProt accession number' }, limit: { type: 'number', description: 'Number of results to return (1-1000, default: 25)', minimum: 1, maximum: 1000 }, }, required: ['uniprot_id'], }, - src/index.ts:496-507 (registration)Registration of the 'search_by_uniprot' tool in the ListTools response, including name, description, and input schema.
{ name: 'search_by_uniprot', description: 'Find ChEMBL targets by UniProt accession', inputSchema: { type: 'object', properties: { uniprot_id: { type: 'string', description: 'UniProt accession number' }, limit: { type: 'number', description: 'Number of results to return (1-1000, default: 25)', minimum: 1, maximum: 1000 }, }, required: ['uniprot_id'], }, }, - src/index.ts:762-763 (registration)Dispatch/registration in the CallToolRequestSchema switch statement that routes to the handler.
case 'search_by_uniprot': return await this.handleSearchByUniprot(args);