Skip to main content
Glama

search_chemicals_by_name

Find chemical compounds in the SureChEMBL patent database using names, synonyms, or common terms to identify relevant patent information.

Instructions

Search for chemicals by name, synonym, or common name

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesChemical name or synonym to search for
limitNoNumber of results to return (1-1000, default: 25)

Implementation Reference

  • The handler function that validates the input, calls the SureChEMBL API /chemical/name/{name} endpoint, and returns the search results as JSON.
    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:388-398 (registration)
    Tool registration in the MCP server's listTools response, defining the tool 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'], }, },
  • JSON schema for tool inputs: requires 'name' string, optional 'limit' number (1-1000). Note: handler does not use 'limit'.
    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'], },
  • Switch case in CallToolRequestSchema handler that dispatches to the tool's handler function.
    case 'search_chemicals_by_name': return await this.handleSearchChemicalsByName(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/SureChEMBL-MCP-Server'

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