Skip to main content
Glama

analyze_stereochemistry

Analyze stereochemistry, chirality, and isomer information for chemical compounds using PubChem data to identify structural variations and molecular configurations.

Instructions

Analyze stereochemistry, chirality, and isomer information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cidYesPubChem Compound ID (CID)

Implementation Reference

  • The handler function that implements the core logic of the 'analyze_stereochemistry' tool. It validates the input CID, queries the PubChem API for stereochemistry properties (AtomStereoCount, DefinedAtomStereoCount, BondStereoCount, DefinedBondStereoCount, IsomericSMILES), and returns the results as formatted JSON.
    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'}`
        );
      }
    }
  • The JSON schema defining the input parameters for the tool, requiring a 'cid' (PubChem Compound ID) as number or string.
    inputSchema: {
      type: 'object',
      properties: {
        cid: { type: ['number', 'string'], description: 'PubChem Compound ID (CID)' },
      },
      required: ['cid'],
    },
  • src/index.ts:490-500 (registration)
    The tool registration entry in the list of available tools returned by ListToolsRequestSchema, including 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)
    The dispatch case in the CallToolRequestSchema handler's switch statement that routes tool calls to the specific handler function.
    case 'analyze_stereochemistry':
      return await this.handleAnalyzeStereochemistry(args);
  • Helper validation function used by the handler to check if arguments contain a valid CID (number or string), shared across multiple tools.
    const isValidCidArgs = (
      args: any
    ): args is { cid: number | string; format?: string } => {
      return (
        typeof args === 'object' &&
        args !== null &&
        (typeof args.cid === 'number' || typeof args.cid === 'string') &&
        (args.format === undefined || ['json', 'sdf', 'xml', 'asnt', 'asnb'].includes(args.format))
      );
    };
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden but offers minimal behavioral information. It doesn't disclose whether this is a read-only operation, what format the analysis returns, whether it requires specific permissions, or any rate limits. The vague 'analyze' verb provides little insight into actual behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with just one phrase listing three analysis areas. While efficient, it may be too brief given the complexity of stereochemical analysis. Each term earns its place but more context could be helpful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations, no output schema, and operating in a domain with many specialized sibling tools, the description is inadequate. It doesn't explain what kind of analysis is performed, what format results are returned in, or how this differs from other compound information tools.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds no parameter information beyond what the schema provides. With 100% schema description coverage for the single 'cid' parameter, the baseline is 3. The description doesn't explain what stereochemical analysis is performed on the CID or how results might vary by compound type.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool analyzes stereochemistry, chirality, and isomer information, which provides a general purpose but lacks specificity about what resource it operates on or what analysis it performs. It doesn't clearly distinguish from siblings like 'get_compound_properties' or 'calculate_descriptors' that might also provide stereochemical data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. With many sibling tools for compound analysis, the description doesn't indicate whether this is for basic stereochemistry checks versus detailed isomer analysis, or when to prefer it over tools like 'get_compound_info' or 'calculate_descriptors'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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