search_chemicals_by_name
Find chemicals by name or synonym within the SureChEMBL chemical patent database. Specify a chemical identifier and limit results for precise search outcomes.
Instructions
Search for chemicals by name, synonym, or common name
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of results to return (1-1000, default: 25) | |
| name | Yes | Chemical name or synonym to search for |
Implementation Reference
- src/index.ts:702-723 (handler)Executes the tool by querying the SureChEMBL API endpoint `/chemical/name/{name}` and returns the JSON response.private async handleSearchChemicalsByName(args: any) { if (!args || typeof args.name !== 'string') { throw new McpError(ErrorCode.InvalidParams, 'Invalid chemical name'); } try { const response = await this.apiClient.get(`/chemical/name/${encodeURIComponent(args.name)}`); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { throw new McpError( ErrorCode.InternalError, `Failed to search chemicals: ${error instanceof Error ? error.message : 'Unknown error'}` ); } }
- src/index.ts:390-397 (schema)Defines the input schema for the tool, specifying 'name' as required string and optional 'limit' number.inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Chemical name or synonym to search for' }, limit: { type: 'number', description: 'Number of results to return (1-1000, default: 25)', minimum: 1, maximum: 1000 }, }, required: ['name'], },
- src/index.ts:388-398 (registration)Registers the tool in the list returned by ListToolsRequestHandler, including name, description, and input schema.name: 'search_chemicals_by_name', description: 'Search for chemicals by name, synonym, or common name', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Chemical name or synonym to search for' }, limit: { type: 'number', description: 'Number of results to return (1-1000, default: 25)', minimum: 1, maximum: 1000 }, }, required: ['name'], }, },