Skip to main content
Glama
pubspro

medterms-mcp

lookup_meddra

Look up MedDRA Preferred Terms to identify System Organ Class, hierarchy level, and synonyms. Essential for adverse event coding and pharmacovigilance.

Instructions

Look up a MedDRA Preferred Term (PT), identify its System Organ Class (SOC), hierarchy level, and related terms. Critical for adverse event coding, pharmacovigilance, and regulatory submissions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
termYesMedDRA term to look up (e.g. 'nausea', 'qt prolongation', 'suicidal ideation')
include_synonymsNoInclude US/UK spelling variants and common synonyms

Implementation Reference

  • index.js:169-254 (registration)
    The tool 'lookup_meddra' is registered using server.tool() from the MCP SDK at line 169. It accepts 'term' (string) and 'include_synonyms' (boolean, default true) and returns formatted MedDRA classification info.
    server.tool(
      "lookup_meddra",
      "Look up a MedDRA Preferred Term (PT), identify its System Organ Class (SOC), hierarchy level, and related terms. Critical for adverse event coding, pharmacovigilance, and regulatory submissions.",
      {
        term: z
          .string()
          .describe("MedDRA term to look up (e.g. 'nausea', 'qt prolongation', 'suicidal ideation')"),
        include_synonyms: z
          .boolean()
          .default(true)
          .describe("Include US/UK spelling variants and common synonyms"),
      },
      async ({ term, include_synonyms }) => {
        const normalized = term.toLowerCase().trim();
    
        // Direct match
        let soc = MEDDRA_PT_SOC[normalized];
    
        // Partial match fallback
        if (!soc) {
          const partialKey = Object.keys(MEDDRA_PT_SOC).find(
            k => k.includes(normalized) || normalized.includes(k)
          );
          if (partialKey) soc = MEDDRA_PT_SOC[partialKey];
        }
    
        // MedDRA hierarchy levels explanation
        const hierarchy = [
          "**SOC** (System Organ Class) — highest level, 27 categories",
          "**HLGT** (High Level Group Term) — groups related HLTs",
          "**HLT** (High Level Term) — groups related PTs",
          "**PT** (Preferred Term) — single medical concept, used in labels & FAERS",
          "**LLT** (Lowest Level Term) — synonyms/variants that map to a PT",
        ];
    
        // Common synonyms for known terms
        const synonymMap = {
          "nausea": ["nausea", "feeling sick", "queasy"],
          "diarrhoea": ["diarrhoea", "diarrhea", "loose stools", "frequent bowel movements"],
          "dizziness": ["dizziness", "vertigo", "lightheadedness", "giddiness"],
          "dyspnoea": ["dyspnoea", "dyspnea", "shortness of breath", "breathlessness", "SOB"],
          "oedema": ["oedema", "edema", "swelling", "fluid retention"],
          "anaemia": ["anaemia", "anemia", "low hemoglobin", "low haemoglobin"],
          "pyrexia": ["pyrexia", "fever", "febrile", "high temperature", "hyperthermia"],
          "pruritus": ["pruritus", "itching", "itch", "itchiness"],
          "somnolence": ["somnolence", "drowsiness", "sleepiness", "sedation"],
          "alopecia": ["alopecia", "hair loss", "hair thinning", "baldness"],
        };
    
        const synonyms = synonymMap[normalized] || [];
    
        let text = `## MedDRA Term: "${term}"\n\n`;
    
        if (soc) {
          text += `### Classification\n`;
          text += `- **Preferred Term (PT):** ${term.charAt(0).toUpperCase() + term.slice(1)}\n`;
          text += `- **System Organ Class (SOC):** ${soc}\n`;
          text += `- **Hierarchy Level:** PT (Preferred Term)\n\n`;
        } else {
          text += `> ⚠️ Term not found in curated PT index. May be an LLT, HLGT, or HLT — verify in official MedDRA browser.\n\n`;
        }
    
        text += `### MedDRA Hierarchy (5 Levels)\n`;
        text += hierarchy.map(h => `- ${h}`).join("\n") + "\n\n";
    
        if (include_synonyms && synonyms.length > 0) {
          text += `### LLT Synonyms / Coding Variants\n`;
          text += `These LLTs map to the same PT:\n`;
          text += synonyms.map(s => `- ${s}`).join("\n") + "\n\n";
        }
    
        text += `### Regulatory Context\n`;
        text += `- PTs are used in **FDA FAERS** adverse event reporting\n`;
        text += `- PTs appear in **clinical trial** adverse event tables\n`;
        text += `- Drug labels use PTs in **Adverse Reactions** section (≥1% frequency threshold)\n`;
        text += `- **ICH E2B** submissions use MedDRA PTs for individual case safety reports (ICSRs)\n\n`;
    
        text += `### All 27 SOCs (for context)\n`;
        text += Object.values(MEDDRA_SOC).map(s => `- ${s}`).join("\n") + "\n\n";
    
        text += `_Source: MedDRA hierarchy documentation (v26.0). Full term browser at meddra.org (subscription required)._\n`;
        text += `_⚠️ Always verify PT assignments in official MedDRA browser before regulatory submission._`;
    
        return { content: [{ type: "text", text }] };
      }
    );
  • The handler function normalizes the input term, looks it up in MEDDRA_PT_SOC (with partial match fallback), builds the hierarchy info, includes LLT synonyms if requested, and returns formatted text with SOC classification and regulatory context.
    async ({ term, include_synonyms }) => {
      const normalized = term.toLowerCase().trim();
    
      // Direct match
      let soc = MEDDRA_PT_SOC[normalized];
    
      // Partial match fallback
      if (!soc) {
        const partialKey = Object.keys(MEDDRA_PT_SOC).find(
          k => k.includes(normalized) || normalized.includes(k)
        );
        if (partialKey) soc = MEDDRA_PT_SOC[partialKey];
      }
    
      // MedDRA hierarchy levels explanation
      const hierarchy = [
        "**SOC** (System Organ Class) — highest level, 27 categories",
        "**HLGT** (High Level Group Term) — groups related HLTs",
        "**HLT** (High Level Term) — groups related PTs",
        "**PT** (Preferred Term) — single medical concept, used in labels & FAERS",
        "**LLT** (Lowest Level Term) — synonyms/variants that map to a PT",
      ];
    
      // Common synonyms for known terms
      const synonymMap = {
        "nausea": ["nausea", "feeling sick", "queasy"],
        "diarrhoea": ["diarrhoea", "diarrhea", "loose stools", "frequent bowel movements"],
        "dizziness": ["dizziness", "vertigo", "lightheadedness", "giddiness"],
        "dyspnoea": ["dyspnoea", "dyspnea", "shortness of breath", "breathlessness", "SOB"],
        "oedema": ["oedema", "edema", "swelling", "fluid retention"],
        "anaemia": ["anaemia", "anemia", "low hemoglobin", "low haemoglobin"],
        "pyrexia": ["pyrexia", "fever", "febrile", "high temperature", "hyperthermia"],
        "pruritus": ["pruritus", "itching", "itch", "itchiness"],
        "somnolence": ["somnolence", "drowsiness", "sleepiness", "sedation"],
        "alopecia": ["alopecia", "hair loss", "hair thinning", "baldness"],
      };
    
      const synonyms = synonymMap[normalized] || [];
    
      let text = `## MedDRA Term: "${term}"\n\n`;
    
      if (soc) {
        text += `### Classification\n`;
        text += `- **Preferred Term (PT):** ${term.charAt(0).toUpperCase() + term.slice(1)}\n`;
        text += `- **System Organ Class (SOC):** ${soc}\n`;
        text += `- **Hierarchy Level:** PT (Preferred Term)\n\n`;
      } else {
        text += `> ⚠️ Term not found in curated PT index. May be an LLT, HLGT, or HLT — verify in official MedDRA browser.\n\n`;
      }
    
      text += `### MedDRA Hierarchy (5 Levels)\n`;
      text += hierarchy.map(h => `- ${h}`).join("\n") + "\n\n";
    
      if (include_synonyms && synonyms.length > 0) {
        text += `### LLT Synonyms / Coding Variants\n`;
        text += `These LLTs map to the same PT:\n`;
        text += synonyms.map(s => `- ${s}`).join("\n") + "\n\n";
      }
    
      text += `### Regulatory Context\n`;
      text += `- PTs are used in **FDA FAERS** adverse event reporting\n`;
      text += `- PTs appear in **clinical trial** adverse event tables\n`;
      text += `- Drug labels use PTs in **Adverse Reactions** section (≥1% frequency threshold)\n`;
      text += `- **ICH E2B** submissions use MedDRA PTs for individual case safety reports (ICSRs)\n\n`;
    
      text += `### All 27 SOCs (for context)\n`;
      text += Object.values(MEDDRA_SOC).map(s => `- ${s}`).join("\n") + "\n\n";
    
      text += `_Source: MedDRA hierarchy documentation (v26.0). Full term browser at meddra.org (subscription required)._\n`;
      text += `_⚠️ Always verify PT assignments in official MedDRA browser before regulatory submission._`;
    
      return { content: [{ type: "text", text }] };
    }
  • Curated dataset mapping MedDRA Preferred Terms (PTs) to their System Organ Class (SOC) for fast lookup. Also includes a synonymMap (lines 205-216) with US/UK spelling variants.
    // Common MedDRA PT → SOC mappings for fast lookup (curated subset)
    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",
    };
  • All 27 MedDRA SOC (System Organ Class) codes and names, used for providing SOC context in the output.
    const MEDDRA_SOC = {
      "10001316": "Blood and lymphatic system disorders",
      "10005329": "Cardiac disorders",
      "10007541": "Congenital, familial and genetic disorders",
      "10010331": "Ear and labyrinth disorders",
      "10014698": "Endocrine disorders",
      "10015919": "Eye disorders",
      "10017947": "Gastrointestinal disorders",
      "10018065": "General disorders and administration site conditions",
      "10019805": "Hepatobiliary disorders",
      "10021428": "Immune system disorders",
      "10021881": "Infections and infestations",
      "10022117": "Injury, poisoning and procedural complications",
      "10022891": "Investigations",
      "10027433": "Metabolism and nutrition disorders",
      "10028395": "Musculoskeletal and connective tissue disorders",
      "10029205": "Neoplasms benign, malignant and unspecified",
      "10029999": "Nervous system disorders",
      "10033371": "Pregnancy, puerperium and perinatal conditions",
      "10036585": "Psychiatric disorders",
      "10038359": "Renal and urinary disorders",
      "10038604": "Reproductive system and breast disorders",
      "10038738": "Respiratory, thoracic and mediastinal disorders",
      "10040785": "Skin and subcutaneous tissue disorders",
      "10041244": "Social circumstances",
      "10042613": "Surgical and medical procedures",
      "10047065": "Vascular disorders",
    };
Behavior3/5

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

No annotations are provided, so the description carries full burden. It implies a read operation via 'look up' but does not explicitly state that it is read-only, nor does it disclose any behavioral traits like authentication needs, rate limits, or error handling. The description is acceptable but lacks extra context beyond basic purpose.

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, direct and front-loaded. The first sentence states the action and outputs, the second provides context. No unnecessary words.

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

Completeness4/5

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

Given the tool has only 2 parameters, no output schema, and no annotations, the description covers the purpose and usage context well. It mentions the key outputs (SOC, hierarchy, related terms) and domain. It could elaborate on edge cases like term not found, but overall is complete enough for a straightforward lookup tool.

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% (both term and include_synonyms are described in the input schema). The description does not add additional parameter semantics beyond what the schema provides, so baseline score of 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?

The description clearly states the verb (look up), resource (MedDRA Preferred Term), and what it returns (SOC, hierarchy, related terms). It also specifies the domain (adverse event coding, pharmacovigilance) which differentiates it from siblings like lookup_icd10 or lookup_ctcae.

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 provides context on when to use this tool (critical for pharmacovigilance and regulatory submissions) but does not explicitly state when not to use it or suggest alternatives like lookup_icd10 for other coding systems. However, the context is clear enough for an experienced agent.

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