Skip to main content
Glama
pubspro

medterms-mcp

search_medical_concept

Search a medical term across multiple ontology systems (SNOMED CT, MeSH, LOINC, NCI Thesaurus) to retrieve concept definitions and cross-system identifiers.

Instructions

Search for a medical concept across terminology systems (SNOMED CT, MeSH, LOINC, NCI Thesaurus) using the NIH UMLS Metathesaurus. Returns concept definitions and cross-system identifiers.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
termYesMedical term to search (e.g. 'schizophrenia', 'EGFR mutation', 'HbA1c')
vocabularyNoTerminology system to search withinall

Implementation Reference

  • index.js:426-493 (registration)
    Registration of the 'search_medical_concept' tool via server.tool() with name, description, Zod schema for parameters, and the async handler function.
    server.tool(
      "search_medical_concept",
      "Search for a medical concept across terminology systems (SNOMED CT, MeSH, LOINC, NCI Thesaurus) using the NIH UMLS Metathesaurus. Returns concept definitions and cross-system identifiers.",
      {
        term: z
          .string()
          .describe("Medical term to search (e.g. 'schizophrenia', 'EGFR mutation', 'HbA1c')"),
        vocabulary: z
          .enum(["all", "SNOMEDCT_US", "MSH", "NCI", "LNC", "ICD10CM"])
          .default("all")
          .describe("Terminology system to search within"),
      },
      async ({ term, vocabulary }) => {
        // Use NLM clinical tables for broad concept search
        const icdUrl = `${ICD_BASE}/search?sf=code,name&terms=${encodeURIComponent(term)}&maxList=5`;
        const rxUrl = `${RXNAV_BASE}/approximateTerm.json?term=${encodeURIComponent(term)}&maxEntries=3`;
    
        const [icdData, rxData] = await Promise.all([
          apiFetch(icdUrl).catch(() => null),
          apiFetch(rxUrl).catch(() => null),
        ]);
    
        const icdResults = icdData?.[3] || [];
        const rxCandidates = rxData?.approximateGroup?.candidate || [];
        const meddra = MEDDRA_PT_SOC[term.toLowerCase()];
    
        let text = `## Medical Concept: "${term}"\n\n`;
    
        text += `### ICD-10-CM (Diagnosis Coding)\n`;
        if (icdResults.length) {
          text += icdResults.map(([c, n]) => `- **${c}** — ${n}`).join("\n") + "\n\n";
        } else {
          text += `_No direct ICD-10-CM match found._\n\n`;
        }
    
        text += `### MedDRA (Safety Reporting)\n`;
        if (meddra) {
          text += `- **PT:** ${term.charAt(0).toUpperCase() + term.slice(1)}\n`;
          text += `- **SOC:** ${meddra}\n\n`;
        } else {
          text += `_Not in curated MedDRA index. Verify at meddra.org._\n\n`;
        }
    
        text += `### RxNorm (Drug Concepts)\n`;
        if (rxCandidates.length) {
          text += rxCandidates.slice(0, 3).map(
            c => `- **RxCUI ${c.rxcui}** (score: ${c.score})`
          ).join("\n") + "\n\n";
        } else {
          text += `_Not a drug concept or no RxNorm match found._\n\n`;
        }
    
        text += `### Terminology System Reference\n`;
        text += `| System | Domain | Use Case |\n`;
        text += `|--------|--------|----------|\n`;
        text += `| **ICD-10-CM** | Diagnoses | Billing, epidemiology, EHR |\n`;
        text += `| **MedDRA** | AEs & conditions | Pharmacovigilance, regulatory |\n`;
        text += `| **RxNorm** | Drugs | Prescribing, interoperability |\n`;
        text += `| **SNOMED CT** | Clinical concepts | EHR, clinical decision support |\n`;
        text += `| **LOINC** | Lab & obs | Lab results, vital signs |\n`;
        text += `| **NCI Thesaurus** | Oncology | Cancer trials, FDA submissions |\n`;
        text += `| **CTCAE** | AE grading | Oncology trial safety |\n\n`;
    
        text += `_Source: NIH NLM APIs (ICD-10-CM, RxNav). Full UMLS access at uts.nlm.nih.gov._`;
    
        return { content: [{ type: "text", text }] };
      }
    );
  • Input schema defining 'term' (string) and 'vocabulary' (enum: all, SNOMEDCT_US, MSH, NCI, LNC, ICD10CM, default: 'all') parameters.
    {
      term: z
        .string()
        .describe("Medical term to search (e.g. 'schizophrenia', 'EGFR mutation', 'HbA1c')"),
      vocabulary: z
        .enum(["all", "SNOMEDCT_US", "MSH", "NCI", "LNC", "ICD10CM"])
        .default("all")
        .describe("Terminology system to search within"),
    },
  • Handler function that fetches ICD-10-CM codes from NLM clinical tables and RxNorm candidates from RxNav API, looks up MedDRA PT-to-SOC mapping, and compiles a cross-terminology result with ICD-10, MedDRA, RxNorm plus a terminology reference table.
    async ({ term, vocabulary }) => {
      // Use NLM clinical tables for broad concept search
      const icdUrl = `${ICD_BASE}/search?sf=code,name&terms=${encodeURIComponent(term)}&maxList=5`;
      const rxUrl = `${RXNAV_BASE}/approximateTerm.json?term=${encodeURIComponent(term)}&maxEntries=3`;
    
      const [icdData, rxData] = await Promise.all([
        apiFetch(icdUrl).catch(() => null),
        apiFetch(rxUrl).catch(() => null),
      ]);
    
      const icdResults = icdData?.[3] || [];
      const rxCandidates = rxData?.approximateGroup?.candidate || [];
      const meddra = MEDDRA_PT_SOC[term.toLowerCase()];
    
      let text = `## Medical Concept: "${term}"\n\n`;
    
      text += `### ICD-10-CM (Diagnosis Coding)\n`;
      if (icdResults.length) {
        text += icdResults.map(([c, n]) => `- **${c}** — ${n}`).join("\n") + "\n\n";
      } else {
        text += `_No direct ICD-10-CM match found._\n\n`;
      }
    
      text += `### MedDRA (Safety Reporting)\n`;
      if (meddra) {
        text += `- **PT:** ${term.charAt(0).toUpperCase() + term.slice(1)}\n`;
        text += `- **SOC:** ${meddra}\n\n`;
      } else {
        text += `_Not in curated MedDRA index. Verify at meddra.org._\n\n`;
      }
    
      text += `### RxNorm (Drug Concepts)\n`;
      if (rxCandidates.length) {
        text += rxCandidates.slice(0, 3).map(
          c => `- **RxCUI ${c.rxcui}** (score: ${c.score})`
        ).join("\n") + "\n\n";
      } else {
        text += `_Not a drug concept or no RxNorm match found._\n\n`;
      }
    
      text += `### Terminology System Reference\n`;
      text += `| System | Domain | Use Case |\n`;
      text += `|--------|--------|----------|\n`;
      text += `| **ICD-10-CM** | Diagnoses | Billing, epidemiology, EHR |\n`;
      text += `| **MedDRA** | AEs & conditions | Pharmacovigilance, regulatory |\n`;
      text += `| **RxNorm** | Drugs | Prescribing, interoperability |\n`;
      text += `| **SNOMED CT** | Clinical concepts | EHR, clinical decision support |\n`;
      text += `| **LOINC** | Lab & obs | Lab results, vital signs |\n`;
      text += `| **NCI Thesaurus** | Oncology | Cancer trials, FDA submissions |\n`;
      text += `| **CTCAE** | AE grading | Oncology trial safety |\n\n`;
    
      text += `_Source: NIH NLM APIs (ICD-10-CM, RxNav). Full UMLS access at uts.nlm.nih.gov._`;
    
      return { content: [{ type: "text", text }] };
    }
  • Utility function apiFetch() used by the handler to make HTTP GET requests to 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 lookup table used by the handler to map MedDRA Preferred Terms to System Organ Classes.
    // 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",
    };
Behavior3/5

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

No annotations are provided, so the description must carry full weight for behavioral cues. It states the tool returns concept definitions and cross-system identifiers. However, it does not disclose potential behaviors like multiple matches, pagination, rate limits, or authentication requirements, leaving some ambiguity for a search tool.

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?

The description is two concise sentences without fluff. It front-loads the core action and lists key systems, then succinctly states return type. Every sentence earns its place.

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's moderate complexity (multi-system search) and full schema coverage, the description adequately explains that it returns definitions and identifiers. It does not mention result ordering or size limits, but for a search tool this is reasonably complete.

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% with both parameters described (term and vocabulary with enum). The description adds context about supported systems (SNOMED CT, MeSH, LOINC, NCI Thesaurus) and the UMLS source, but does not cover all enum values (e.g., ICD10CM is missing). This adds marginal value beyond the schema.

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 tool's purpose: 'Search for a medical concept across terminology systems' using specific sources (SNOMED CT, MeSH, LOINC, NCI Thesaurus) via NIH UMLS Metathesaurus. It explicitly distinguishes from sibling lookup tools that target single systems.

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

Usage Guidelines3/5

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

The description does not provide explicit when-to-use or when-not-to-use guidance relative to sibling tools. It implies cross-system search but lacks a clear directive like 'use for multi-terminology searches; use lookup_* for single system lookups.' Usage context is only inferred.

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