MeNTi: Bridging Medical Calculator and LLM Agent with Nested Tool Calling

Yakun Zhu, Shaohang Wei, Xu Wang, Kui Xue, Shaoting Zhang, Xiaofan Zhang

Introduction

In clinical medicine, quantitative assessment is vital. Physicians frequently use specialized medical calculators—ranging from the Framingham Risk Score to Body Mass Index (BMI)—to make informed decisions. While Large Language Models (LLMs) excel at text summarization, they often lack the precision required for these mathematical tools.

Researchers from Shanghai Jiao Tong University have developed MeNTi, an agent architecture designed to bridge the gap between unstructured clinical narratives and precise medical computation. This work is set to be presented at NAACL 2025.

Medical calculators are essential for quantitative patient assessment.

The Challenge: Bottlenecks in Clinical Tool Use

The transition from raw patient data to a calculated clinical score faces three primary hurdles:

  1. Tool Selection Overload: With over 700 medical calculators available, standard retrieval methods struggle with nuanced medical terminology.
  2. Slot Filling Complexity: Extracting specific parameters from long, unstructured clinical notes is error-prone.
  3. The Unit Conversion Trap: Calculators often require specific units (e.g., mg/dL) while records may use others (e.g., mmol/L). Standard LLMs often fail or hallucinate during these conversions.
MeNTi aims to streamline the flow from Electronic Medical Records (EMR) to physician-ready quantitative insights.

Methodology: The MeNTi Architecture

MeNTi (Medical Nested Tool calling) introduces two core mechanisms:

1. Meta-Tool for Selection

Instead of basic keyword searches, MeNTi employs a four-step pipeline:

  • Classifier: Identifies the task type.
  • Query Rewriter: Expands queries into specific search terms based on the case.
  • Retrieval & Reranker: Uses a multi-key strategy and Reciprocal Rank Fusion to find the best tool.
  • Dispatcher: A final LLM validation step to ensure the tool matches the clinical scenario.

2. Nested Tool Calling

This is the framework's defining feature. When a unit mismatch is detected during parameter extraction, the agent recursively calls specialized unit conversion tools. It integrates the converted value and then resumes the primary calculation, preventing the "math hallucinations" common in standard LLMs.

The CalcQA Benchmark

To evaluate MeNTi, the researchers introduced CalcQA, a physician-verified benchmark:

  • Toolkit: 44 medical calculators and 237 unit conversion tools.
  • Cases: 100 patient case-calculator pairs.
  • Metrics: Selection Accuracy (CSA), Slot Filling Accuracy (SFA), Unit Converting Accuracy (UCA), and end-to-end Calculation Accuracy (CCA).

Key Results and Insights

Using GPT-4o as a backbone, MeNTi significantly outperformed existing frameworks:

  • End-to-End Accuracy (CCA): MeNTi achieved 49%, more than double the performance of Chain-of-Thought (22%) and the CRAFT framework (19%).
  • Unit Conversion (UCA): MeNTi reached 69.4%, while all baseline methods scored 0%.
  • Selection Accuracy (CSA): MeNTi hit 86%, demonstrating the effectiveness of the Meta-Tool approach in a complex multi-tool environment.

The study highlights that unit conversion is a "silent killer" of accuracy in medical AI. While MeNTi makes significant strides, challenges remain in interpreting complex medical histories, where subtle reasoning errors can still occur.

Conclusion

MeNTi demonstrates that recursive tool use is essential for specialized domains like medicine. By nesting unit conversion within the broader calculation workflow, MeNTi provides a robust framework for turning messy clinical data into precise, actionable insights. Future work will focus on scaling the dataset and refining the "Dispatcher" to further reduce medical hallucinations.

Summary updated

BibTeX
@inproceedings{zhu2025menti,
  author = {Yakun Zhu and Shaohang Wei and Xu Wang and Kui Xue and Shaoting Zhang and Xiaofan Zhang},
  title = {{MeNTi: Bridging Medical Calculator and LLM Agent with Nested Tool Calling}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2025},
  doi = {10.18653/v1/2025.naacl-long.263},
}
Figure