Skip to main content
Glama
pubspro

medterms-mcp

crossmap_icd_meddra

Cross-map medical concepts between ICD-10 and MedDRA coding systems for regulatory submissions and pharmacovigilance.

Instructions

Cross-map between ICD-10 and MedDRA terminology. Provides conceptual mapping guidance for translating diagnoses between coding systems — critical for regulatory submissions, REMS, and pharmacovigilance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
termYesMedical concept to cross-map (e.g. 'depression', 'heart failure', 'neutropenia')
directionNoMapping directionboth

Implementation Reference

  • The main handler function for the crossmap_icd_meddra tool. Accepts 'term' and 'direction' params, fetches ICD-10 codes from the NLM API, looks up MedDRA SOC from the curated MEDDRA_PT_SOC dictionary, and returns a formatted cross-map result.
    async ({ term, direction }) => {
      // Fetch ICD-10 codes for the term
      const icdData = await apiFetch(
        `${ICD_BASE}/search?sf=code,name&terms=${encodeURIComponent(term)}&maxList=5`
      ).catch(() => null);
    
      const icdEntries = icdData?.[3] || [];
      const meddra_soc = MEDDRA_PT_SOC[term.toLowerCase()] ||
        Object.entries(MEDDRA_PT_SOC).find(([k]) => k.includes(term.toLowerCase()))?.[1] ||
        "Not found in curated index — verify in MedDRA browser";
    
      let text = `## Cross-Map: "${term}"\n\n`;
      text += `> ⚠️ There is no official 1:1 ICD-10↔MedDRA mapping. These systems use different granularity and purposes. Use this as guidance only.\n\n`;
    
      if (direction !== "meddra_to_icd") {
        text += `### ICD-10-CM Codes (Diagnosis Coding)\n`;
        if (icdEntries.length) {
          text += icdEntries.map(([code, name]) => `- **${code}** — ${name}`).join("\n");
        } else {
          text += `_No ICD-10-CM codes found for this term._`;
        }
        text += "\n\n";
      }
    
      if (direction !== "icd_to_meddra") {
        text += `### MedDRA (Pharmacovigilance Coding)\n`;
        text += `- **Preferred Term (PT):** ${term.charAt(0).toUpperCase() + term.slice(1)}\n`;
        text += `- **System Organ Class (SOC):** ${meddra_soc}\n\n`;
      }
    
      text += `### Key Differences\n`;
      text += `| | ICD-10-CM | MedDRA |\n`;
      text += `|--|-----------|--------|\n`;
      text += `| **Purpose** | Clinical diagnosis billing | Adverse event / safety reporting |\n`;
      text += `| **Owner** | WHO / CMS | ICH / MSSO |\n`;
      text += `| **Used in** | EHR, claims, hospitals | FAERS, EudraVigilance, clinical trials |\n`;
      text += `| **Granularity** | Etiology, site, severity | Clinical manifestation |\n`;
      text += `| **Update cycle** | Annual (Oct 1) | Biannual (March, September) |\n`;
      text += `| **Access** | Free (public) | Subscription required |\n\n`;
    
      text += `### Regulatory Guidance\n`;
      text += `- **ICH E2B(R3):** Use MedDRA for ICSRs (individual case safety reports)\n`;
      text += `- **FDA FAERS:** MedDRA PTs required for adverse event coding\n`;
      text += `- **EMA EudraVigilance:** MedDRA mandatory for EU safety reporting\n`;
      text += `- **Clinical trials (CTCAE):** Use NCI CTCAE grading alongside MedDRA PTs\n\n`;
    
      text += `_Always consult a trained medical coder or pharmacovigilance specialist for regulatory submissions._`;
    
      return { content: [{ type: "text", text }] };
    }
  • Zod schema for the crossmap_icd_meddra tool. Defines 'term' as a required string, 'direction' as an enum (icd_to_meddra, meddra_to_icd, both) with default 'both'.
    {
      term: z
        .string()
        .describe("Medical concept to cross-map (e.g. 'depression', 'heart failure', 'neutropenia')"),
      direction: z
        .enum(["icd_to_meddra", "meddra_to_icd", "both"])
        .default("both")
        .describe("Mapping direction"),
    },
  • index.js:360-422 (registration)
    Tool registration via server.tool('crossmap_icd_meddra', ...) with description about ICD-10 to MedDRA cross-mapping for regulatory submissions, REMS, and pharmacovigilance.
    server.tool(
      "crossmap_icd_meddra",
      "Cross-map between ICD-10 and MedDRA terminology. Provides conceptual mapping guidance for translating diagnoses between coding systems — critical for regulatory submissions, REMS, and pharmacovigilance.",
      {
        term: z
          .string()
          .describe("Medical concept to cross-map (e.g. 'depression', 'heart failure', 'neutropenia')"),
        direction: z
          .enum(["icd_to_meddra", "meddra_to_icd", "both"])
          .default("both")
          .describe("Mapping direction"),
      },
      async ({ term, direction }) => {
        // Fetch ICD-10 codes for the term
        const icdData = await apiFetch(
          `${ICD_BASE}/search?sf=code,name&terms=${encodeURIComponent(term)}&maxList=5`
        ).catch(() => null);
    
        const icdEntries = icdData?.[3] || [];
        const meddra_soc = MEDDRA_PT_SOC[term.toLowerCase()] ||
          Object.entries(MEDDRA_PT_SOC).find(([k]) => k.includes(term.toLowerCase()))?.[1] ||
          "Not found in curated index — verify in MedDRA browser";
    
        let text = `## Cross-Map: "${term}"\n\n`;
        text += `> ⚠️ There is no official 1:1 ICD-10↔MedDRA mapping. These systems use different granularity and purposes. Use this as guidance only.\n\n`;
    
        if (direction !== "meddra_to_icd") {
          text += `### ICD-10-CM Codes (Diagnosis Coding)\n`;
          if (icdEntries.length) {
            text += icdEntries.map(([code, name]) => `- **${code}** — ${name}`).join("\n");
          } else {
            text += `_No ICD-10-CM codes found for this term._`;
          }
          text += "\n\n";
        }
    
        if (direction !== "icd_to_meddra") {
          text += `### MedDRA (Pharmacovigilance Coding)\n`;
          text += `- **Preferred Term (PT):** ${term.charAt(0).toUpperCase() + term.slice(1)}\n`;
          text += `- **System Organ Class (SOC):** ${meddra_soc}\n\n`;
        }
    
        text += `### Key Differences\n`;
        text += `| | ICD-10-CM | MedDRA |\n`;
        text += `|--|-----------|--------|\n`;
        text += `| **Purpose** | Clinical diagnosis billing | Adverse event / safety reporting |\n`;
        text += `| **Owner** | WHO / CMS | ICH / MSSO |\n`;
        text += `| **Used in** | EHR, claims, hospitals | FAERS, EudraVigilance, clinical trials |\n`;
        text += `| **Granularity** | Etiology, site, severity | Clinical manifestation |\n`;
        text += `| **Update cycle** | Annual (Oct 1) | Biannual (March, September) |\n`;
        text += `| **Access** | Free (public) | Subscription required |\n\n`;
    
        text += `### Regulatory Guidance\n`;
        text += `- **ICH E2B(R3):** Use MedDRA for ICSRs (individual case safety reports)\n`;
        text += `- **FDA FAERS:** MedDRA PTs required for adverse event coding\n`;
        text += `- **EMA EudraVigilance:** MedDRA mandatory for EU safety reporting\n`;
        text += `- **Clinical trials (CTCAE):** Use NCI CTCAE grading alongside MedDRA PTs\n\n`;
    
        text += `_Always consult a trained medical coder or pharmacovigilance specialist for regulatory submissions._`;
    
        return { content: [{ type: "text", text }] };
      }
    );
  • Helper apiFetch function used by the handler to call external NIH NLM APIs.
    async function apiFetch(url) {
      const res = await fetch(url, {
        headers: { "Accept": "application/json" }
      });
      if (!res.ok) throw new Error(`API error ${res.status}: ${url}`);
      return res.json();
    }
  • MEDDRA_PT_SOC curated dictionary mapping MedDRA Preferred Terms to System Organ Classes, used for fast lookup in the handler.
    const MEDDRA_PT_SOC = {
      "nausea": "Gastrointestinal disorders",
      "vomiting": "Gastrointestinal disorders",
      "diarrhoea": "Gastrointestinal disorders",
      "diarrhea": "Gastrointestinal disorders",
      "constipation": "Gastrointestinal disorders",
      "abdominal pain": "Gastrointestinal disorders",
      "headache": "Nervous system disorders",
      "dizziness": "Nervous system disorders",
      "tremor": "Nervous system disorders",
      "somnolence": "Nervous system disorders",
      "seizure": "Nervous system disorders",
      "insomnia": "Psychiatric disorders",
      "depression": "Psychiatric disorders",
      "anxiety": "Psychiatric disorders",
      "agitation": "Psychiatric disorders",
      "hallucination": "Psychiatric disorders",
      "suicidal ideation": "Psychiatric disorders",
      "rash": "Skin and subcutaneous tissue disorders",
      "pruritus": "Skin and subcutaneous tissue disorders",
      "alopecia": "Skin and subcutaneous tissue disorders",
      "fatigue": "General disorders and administration site conditions",
      "pyrexia": "General disorders and administration site conditions",
      "oedema": "General disorders and administration site conditions",
      "edema": "General disorders and administration site conditions",
      "dyspnoea": "Respiratory, thoracic and mediastinal disorders",
      "dyspnea": "Respiratory, thoracic and mediastinal disorders",
      "cough": "Respiratory, thoracic and mediastinal disorders",
      "pneumonia": "Infections and infestations",
      "neutropenia": "Blood and lymphatic system disorders",
      "thrombocytopenia": "Blood and lymphatic system disorders",
      "anaemia": "Blood and lymphatic system disorders",
      "anemia": "Blood and lymphatic system disorders",
      "hypertension": "Vascular disorders",
      "hypotension": "Vascular disorders",
      "tachycardia": "Cardiac disorders",
      "qt prolongation": "Cardiac disorders",
      "myocardial infarction": "Cardiac disorders",
      "alanine aminotransferase increased": "Investigations",
      "aspartate aminotransferase increased": "Investigations",
      "weight decreased": "Investigations",
      "weight increased": "Investigations",
      "creatinine increased": "Investigations",
      "renal failure": "Renal and urinary disorders",
      "hepatotoxicity": "Hepatobiliary disorders",
      "liver injury": "Hepatobiliary disorders",
    };
Behavior2/5

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

No annotations are provided, so the description must fully disclose behaviors. It only says 'provides conceptual mapping guidance', which is vague. It fails to clarify whether results are exact, probabilistic, or multiple options, nor does it mention output format or limitations.

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?

Two sentences with no redundant words. The purpose is stated first, followed by context. Every sentence adds value.

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

Completeness3/5

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

The description covers the tool's purpose and context but lacks details about output behavior. Given the absence of an output schema, it should hint at the nature of results (e.g., list of mappings, confidence scores) to ensure completeness.

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?

Input schema already describes both parameters thoroughly (term with examples, direction with enumerated values). The description adds no extra meaning beyond what the schema provides, resulting in baseline performance.

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 'Cross-map between ICD-10 and MedDRA terminology', specifying the verb and resources. It distinguishes from sibling tools (which are lookups of single terminologies) by emphasizing the mapping between two systems.

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?

The description mentions critical use cases: 'regulatory submissions, REMS, and pharmacovigilance'. However, it doesn't explicitly advise when not to use or suggest alternatives, leaving some ambiguity about scope.

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/pubspro/medterms-mcp'

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