Skip to main content
Glama

rxnorm_ingredients

Read-onlyIdempotent

Identify the active ingredients in a medication by providing its RxCUI. Returns ingredient names and RxCUIs for single or multi-ingredient drugs.

Instructions

Get active ingredients for a drug by RxCUI.

Use this tool to:

  • Find the active ingredients in a medication

  • Check for single vs. multiple ingredient products

  • Identify the generic components of brand drugs

Returns ingredient RxCUIs and names.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rxcuiYesRxCUI of the drug

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
rxcuiYes
ingredientsYes

Implementation Reference

  • Main handler function for rxnorm_ingredients. Parses params using RxNormByRxcuiParamsSchema, calls client.getIngredients(), and returns both a text-formatted response and structured data (RxNormIngredientsOutput).
    async function handleRxNormIngredients(args: Record<string, unknown>): Promise<CallToolResult> {
      try {
        const params = RxNormByRxcuiParamsSchema.parse(args);
        const client = getRxNormClient();
        const ingredients = await client.getIngredients(params.rxcui);
    
        const structured: RxNormIngredientsOutput = {
          rxcui: params.rxcui,
          ingredients: ingredients.map((ing) => ({
            rxcui: ing.rxcui,
            name: ing.name,
            tty: ing.tty,
            is_multiple: ing.isMultiple,
          })),
        };
    
        return {
          content: [{ type: 'text', text: formatIngredients(params.rxcui, ingredients) }],
          structuredContent: structured,
        };
      } catch (error) {
        return handleToolError(error);
      }
    }
  • Registration of rxnormIngredientsTool and its handler (handleRxNormIngredients) via toolRegistry.register().
    toolRegistry.register(rxnormSearchTool, handleRxNormSearch);
    toolRegistry.register(rxnormConceptTool, handleRxNormConcept);
    toolRegistry.register(rxnormIngredientsTool, handleRxNormIngredients);
    toolRegistry.register(rxnormClassesTool, handleRxNormClasses);
    toolRegistry.register(rxnormNDCTool, handleRxNormNDC);
  • Output schema (RxNormIngredientsOutputSchema): defines the structured shape with rxcui and an array of ingredients (each having rxcui, name, tty, is_multiple).
    export const RxNormIngredientsOutputSchema = z.object({
      rxcui: z.string(),
      ingredients: z.array(
        z.object({
          rxcui: z.string(),
          name: z.string(),
          tty: z.string(),
          is_multiple: z.boolean(),
        }),
      ),
    });
  • Input schema (RxNormByRxcuiParamsSchema): accepts a single 'rxcui' parameter.
    /** Shared shape for rxnorm_ingredients / rxnorm_classes */
    export const RxNormByRxcuiParamsSchema = z.object({
      rxcui: RxCUISchema.describe('RxCUI of the drug'),
    });
  • Helper function formatIngredients() that renders the ingredients data as a Markdown table for text output.
    function formatIngredients(rxcui: string, ingredients: RxNormIngredient[]): string {
      const lines: string[] = [];
    
      lines.push(`# Ingredients for RxCUI ${rxcui}`);
      lines.push('');
    
      if (ingredients.length === 0) {
        lines.push('No ingredients found for this concept.');
        lines.push('');
        lines.push('This may mean:');
        lines.push('- The RxCUI is already an ingredient');
        lines.push('- The concept does not have defined ingredients');
      } else {
        lines.push(`Found ${ingredients.length} ingredient(s):`);
        lines.push('');
        lines.push('| RxCUI | Name | Type |');
        lines.push('|-------|------|------|');
    
        for (const ing of ingredients) {
          const type = ing.isMultiple ? 'Multiple Ingredient' : 'Single Ingredient';
          lines.push(`| ${ing.rxcui} | ${ing.name} | ${type} |`);
        }
      }
    
      return lines.join('\n');
    }
Behavior4/5

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

Annotations already declare readOnlyHint, destructiveHint, idempotentHint, and openWorldHint. Description adds that the tool returns ingredient RxCUIs and names, providing additional behavioral context beyond annotations.

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

Conciseness5/5

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

Description is concise with a clear opening statement and bullet points. No unnecessary words, and each sentence adds value. Front-loaded with the core purpose.

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

Completeness5/5

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

Given low complexity (single required parameter, output schema exists, rich annotations), the description fully covers the tool's purpose, usage, and return format. No gaps identified.

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?

Schema coverage is 100%, including a description for the 'rxcui' parameter. Description reinforces the parameter's role ('by RxCUI') but adds minimal extra meaning beyond the schema. Baseline 3 is appropriate.

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

Purpose5/5

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

Description clearly states it retrieves active ingredients for a drug by RxCUI, listing specific use cases like finding ingredients, checking single vs. multiple, and identifying generic components. This distinguishes it from sibling tools like rxnorm_concept or rxnorm_search.

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

Usage Guidelines4/5

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

Description provides explicit use cases in bullet points, but does not explicitly state when not to use or suggest alternatives. However, the use cases are clear and help the agent decide when to invoke this tool over siblings.

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/SidneyBissoli/medical-terminologies-mcp'

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