Skip to main content
Glama

get_chemical_by_id

Retrieve detailed chemical information from the SureChEMBL database by entering a specific SureChEMBL chemical ID. Useful for accessing patent-related chemical data efficiently.

Instructions

Get detailed chemical information by SureChEMBL chemical ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chemical_idYesSureChEMBL chemical ID (numeric)

Implementation Reference

  • The main execution logic for the 'get_chemical_by_id' tool. Validates the chemical_id input, fetches data from the SureChEMBL API endpoint `/chemical/id/{chemical_id}`, formats the response as JSON text content, and handles errors.
    private async handleGetChemicalById(args: any) { if (!args || typeof args.chemical_id !== 'string') { throw new McpError(ErrorCode.InvalidParams, 'Invalid chemical ID'); } try { const response = await this.apiClient.get(`/chemical/id/${args.chemical_id}`); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { throw new McpError( ErrorCode.InternalError, `Failed to get chemical: ${error instanceof Error ? error.message : 'Unknown error'}` ); } }
  • src/index.ts:399-409 (registration)
    Registers the 'get_chemical_by_id' tool in the MCP server's list of available tools, including its description and input schema definition.
    { name: 'get_chemical_by_id', description: 'Get detailed chemical information by SureChEMBL chemical ID', inputSchema: { type: 'object', properties: { chemical_id: { type: 'string', description: 'SureChEMBL chemical ID (numeric)' }, }, required: ['chemical_id'], }, },
  • src/index.ts:555-556 (registration)
    Switch case in the CallToolRequestSchema handler that routes calls to the specific tool handler method.
    case 'get_chemical_by_id': return await this.handleGetChemicalById(args);
  • Input schema definition specifying that the tool requires a 'chemical_id' string parameter.
    inputSchema: { type: 'object', properties: { chemical_id: { type: 'string', description: 'SureChEMBL chemical ID (numeric)' }, }, required: ['chemical_id'], },

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