analyze_stereochemistry
Identify and analyze stereochemistry, chirality, and isomer details for chemical compounds using PubChem CIDs. Designed for chemical structure evaluation and research purposes.
Instructions
Analyze stereochemistry, chirality, and isomer information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cid | Yes | PubChem Compound ID (CID) |
Implementation Reference
- src/index.ts:1048-1073 (handler)Executes the tool by validating CID input and fetching stereochemistry properties (AtomStereoCount, DefinedAtomStereoCount, BondStereoCount, DefinedBondStereoCount, IsomericSMILES) from PubChem API, returning formatted JSON response.private async handleAnalyzeStereochemistry(args: any) { if (!isValidCidArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid stereochemistry arguments'); } try { const response = await this.apiClient.get(`/compound/cid/${args.cid}/property/AtomStereoCount,DefinedAtomStereoCount,BondStereoCount,DefinedBondStereoCount,IsomericSMILES/JSON`); return { content: [ { type: 'text', text: JSON.stringify({ cid: args.cid, stereochemistry: response.data, }, null, 2), }, ], }; } catch (error) { throw new McpError( ErrorCode.InternalError, `Failed to analyze stereochemistry: ${error instanceof Error ? error.message : 'Unknown error'}` ); } }
- src/index.ts:493-499 (schema)Defines the input schema requiring a PubChem CID (number or string).inputSchema: { type: 'object', properties: { cid: { type: ['number', 'string'], description: 'PubChem Compound ID (CID)' }, }, required: ['cid'], },
- src/index.ts:490-500 (registration)Registers the tool in the ListTools response with name, description, and input schema.{ name: 'analyze_stereochemistry', description: 'Analyze stereochemistry, chirality, and isomer information', inputSchema: { type: 'object', properties: { cid: { type: ['number', 'string'], description: 'PubChem Compound ID (CID)' }, }, required: ['cid'], }, },
- src/index.ts:762-763 (registration)Dispatches tool calls to the specific handler in the CallToolRequest switch statement.case 'analyze_stereochemistry': return await this.handleAnalyzeStereochemistry(args);