Skip to main content
Glama

get_mesh_tree

Retrieve the MeSH hierarchy for a descriptor to understand its classification, identify parent categories, and determine appropriate specificity for subject analysis.

Instructions

Retrieve the MeSH tree hierarchy for a descriptor: its tree numbers, the full name of each top-level category, and its immediate broader (parent) descriptors.

Use this to understand where a heading sits within the MeSH hierarchy, helping to determine whether the heading is specific enough for the work or whether a broader heading would be more appropriate.

MeSH tree number top-level categories: A Anatomy B Organisms C Diseases D Chemicals and Drugs E Analytical, Diagnostic and Therapeutic Techniques and Equipment F Psychiatry and Psychology G Phenomena and Processes H Disciplines and Occupations I Anthropology, Education, Sociology and Social Phenomena J Technology, Industry, and Agriculture K Humanities L Information Science M Named Groups N Health Care V Publication Characteristics Z Geographicals

Parameters

descriptor : str The MeSH UI code (e.g. "D003920") or full URI returned by search_mesh.

Returns

dict Contains: - ui : MeSH unique identifier - label : Preferred heading label - treeNumbers : List of tree number strings - categories : List of {letter, name} dicts for top-level categories - broader : List of {label, ui} dicts for parent descriptors

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptorYes

Implementation Reference

  • The get_mesh_tree tool implementation, which retrieves the MeSH tree hierarchy for a given descriptor UI.
    @mcp.tool()
    def get_mesh_tree(descriptor: str) -> dict:
        """
        Retrieve the MeSH tree hierarchy for a descriptor: its tree numbers,
        the full name of each top-level category, and its immediate broader
        (parent) descriptors.
    
        Use this to understand where a heading sits within the MeSH hierarchy,
        helping to determine whether the heading is specific enough for the work
        or whether a broader heading would be more appropriate.
    
        MeSH tree number top-level categories:
          A  Anatomy
          B  Organisms
          C  Diseases
          D  Chemicals and Drugs
          E  Analytical, Diagnostic and Therapeutic Techniques and Equipment
          F  Psychiatry and Psychology
          G  Phenomena and Processes
          H  Disciplines and Occupations
          I  Anthropology, Education, Sociology and Social Phenomena
          J  Technology, Industry, and Agriculture
          K  Humanities
          L  Information Science
          M  Named Groups
          N  Health Care
          V  Publication Characteristics
          Z  Geographicals
    
        Parameters
        ----------
        descriptor : str
            The MeSH UI code (e.g. "D003920") or full URI returned by search_mesh.
    
        Returns
        -------
        dict
            Contains:
              - ui          : MeSH unique identifier
              - label       : Preferred heading label
              - treeNumbers : List of tree number strings
              - categories  : List of {letter, name} dicts for top-level categories
              - broader     : List of {label, ui} dicts for parent descriptors
        """
        _CATEGORY_NAMES = {
            "A": "Anatomy",
            "B": "Organisms",
            "C": "Diseases",
            "D": "Chemicals and Drugs",
            "E": "Analytical, Diagnostic and Therapeutic Techniques and Equipment",
            "F": "Psychiatry and Psychology",
            "G": "Phenomena and Processes",
            "H": "Disciplines and Occupations",
            "I": "Anthropology, Education, Sociology and Social Phenomena",
            "J": "Technology, Industry, and Agriculture",
            "K": "Humanities",
            "L": "Information Science",
            "M": "Named Groups",
            "N": "Health Care",
            "V": "Publication Characteristics",
            "Z": "Geographicals",
        }
    
        record = get_mesh_record(descriptor)
        if "error" in record:
            return record
    
        return {
            "ui":          record["ui"],
            "label":       record.get("label", ""),
            "treeNumbers": record.get("treeNumbers", []),
            "categories": [
                {"letter": c, "name": _CATEGORY_NAMES.get(c, "Unknown")}
                for c in record.get("treeCategories", [])
            ],
            "broader": record.get("broader", []),
        }
Behavior4/5

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

No annotations are provided, so the description carries full disclosure burden. It excellently documents the return structure (ui, label, treeNumbers, categories, broader) and provides the complete MeSH category taxonomy (A-Z), which is crucial behavioral context. Lacks explicit mention of read-only/idempotent nature, though implied by 'Retrieve' and tool name.

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 comprehensive and well-structured with clear headers. While lengthy due to the 16-line MeSH category reference list, this domain-specific reference material earns its place by enabling the agent to interpret returned category codes. No redundant or wasted sentences.

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?

Despite having no output schema and 0% input schema coverage, the description achieves completeness by documenting the full return structure (including nested object shapes) and parameter semantics. The inclusion of MeSH category mappings provides essential domain context for interpreting results.

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

Parameters5/5

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

With 0% schema description coverage, the description fully compensates by documenting the 'descriptor' parameter with type (str), format (MeSH UI code), concrete example ('D003920'), and provenance context ('returned by search_mesh'), enabling correct invocation.

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 explicitly states what the tool retrieves (MeSH tree hierarchy, tree numbers, top-level categories, parent descriptors) using specific verbs. It clearly distinguishes this from sibling tools by focusing on hierarchical relationships rather than searching (search_mesh) or record details (get_mesh_record).

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?

Provides clear when-to-use guidance ('Use this to understand where a heading sits... helping to determine whether the heading is specific enough'). While it doesn't explicitly state when NOT to use it or name sibling alternatives, it implies the workflow by referencing that the descriptor parameter comes from 'search_mesh'.

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/msuicaut/mesh-mcp'

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