Skip to main content
Glama

get_3d_conformers

Retrieve 3D or 2D conformer data and structural details for chemical compounds using PubChem Compound ID (CID) for analysis and visualization.

Instructions

Get 3D conformer data and structural information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cidYesPubChem Compound ID (CID)
conformer_typeNoType of conformer data (default: 3d)

Implementation Reference

  • The main execution function for the 'get_3d_conformers' tool. Validates input using isValidConformerArgs, queries PubChem API for 3D conformer properties (Volume3D, ConformerCount3D), and returns formatted JSON response.
    private async handleGet3dConformers(args: any) { if (!isValidConformerArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid 3D conformer arguments'); } try { const response = await this.apiClient.get(`/compound/cid/${args.cid}/property/Volume3D,ConformerCount3D/JSON`); return { content: [ { type: 'text', text: JSON.stringify({ cid: args.cid, conformer_type: args.conformer_type || '3d', properties: response.data, }, null, 2), }, ], }; } catch (error) { throw new McpError( ErrorCode.InternalError, `Failed to get 3D conformers: ${error instanceof Error ? error.message : 'Unknown error'}` ); } }
  • Input schema defining parameters for the tool: required 'cid' (number or string), optional 'conformer_type' enum ['3d','2d']. Used in tool registration.
    inputSchema: { type: 'object', properties: { cid: { type: ['number', 'string'], description: 'PubChem Compound ID (CID)' }, conformer_type: { type: 'string', enum: ['3d', '2d'], description: 'Type of conformer data (default: 3d)' }, }, required: ['cid'],
  • src/index.ts:760-761 (registration)
    Switch case in CallToolRequestSchema handler that registers and dispatches 'get_3d_conformers' tool calls to its handler method.
    case 'get_3d_conformers': return await this.handleGet3dConformers(args);
  • Helper type guard function that validates tool arguments matching the input schema, used in the handler.
    const isValidConformerArgs = ( args: any ): args is { cid: number | string; conformer_type?: string } => { return ( typeof args === 'object' && args !== null && (typeof args.cid === 'number' || typeof args.cid === 'string') && (args.conformer_type === undefined || ['3d', '2d'].includes(args.conformer_type)) ); };
  • src/index.ts:478-489 (registration)
    Tool metadata registration in ListToolsRequestSchema response, including name, description, and input schema.
    { name: 'get_3d_conformers', description: 'Get 3D conformer data and structural information', inputSchema: { type: 'object', properties: { cid: { type: ['number', 'string'], description: 'PubChem Compound ID (CID)' }, conformer_type: { type: 'string', enum: ['3d', '2d'], description: 'Type of conformer data (default: 3d)' }, }, required: ['cid'], }, },

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/PubChem-MCP-Server'

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