Skip to main content
Glama

get_chemical_by_id

Retrieve detailed chemical information from the SureChEMBL patent database using a specific chemical identifier.

Instructions

Get detailed chemical information by SureChEMBL chemical ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chemical_idYesSureChEMBL chemical ID (numeric)

Implementation Reference

  • The main handler function that executes the tool logic: validates the chemical_id input, fetches data from SureChEMBL API (/chemical/id/{id}), and returns the JSON response.
    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'}` ); } }
  • Tool schema definition in the ListTools response, specifying the input parameters and requirements.
    { 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)
    Tool dispatch registration in the CallToolRequestSchema handler switch statement, routing calls to the handler function.
    case 'get_chemical_by_id': return await this.handleGetChemicalById(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