Skip to main content
Glama

RadMeasure

A medical imaging measurement agent with geometric verification, bounded repair, and human review.

CI License: MIT

RadMeasure coordinates measurement of hallux valgus angle (HVA) and intermetatarsal angle (IMA) in foot radiographs. A constrained planner selects registered protocols; measurement tools produce the angles; a controller checks geometry and decides whether to keep, repair, or stop a result.

Quick start · Architecture · Results · Usage

Demo

RadMeasure dashboard showing a synthetic measurement workflow

The offline demo runs the planning, measurement, and verification path on synthetic geometry without model downloads. Uploaded-image inference uses separately configured weights and always requires review. Run the web interface.

Related MCP server: MCP Human Approval Gateway

Architecture

Agent execution and review workflow

Registered-case analysis and uploaded-image inference are distinct paths. An optional LLM selects protocols and tools; it does not directly invent measured angles or grant itself new tool permissions.

Engineering decision

Implementation

Constrain tool selection

Protocol registry and validation of planner JSON; unsupported plans stop

Make correction explicit

KEEP / REPAIR / STOP controller, repair budgets, and independent-proposal checks

Preserve review decisions

Uploaded predictions require review; approvals, rejections, and corrected angles are recorded

Trace execution

Per-tool records, persisted jobs, worker leases, and replay lineage

Expose measurement tools

CLI, FastAPI dashboard, job API, and MCP

Source map and execution paths

Evaluation

Historical selective-repair study on 176 archived cases, with three saved base-model predictions per case (528 case-records):

Measure

Result

Case-records selected for intervention

106/528 (20.1%)

Mean angular error, before → after

2.678° → 2.540°

Mean error reduction among intervened records

0.69°

These results evaluate an archived learned selection policy, not the default runtime controller or fresh end-to-end image inference. The mean is over case-level HVA/IMA errors. Protocol, aggregate provenance, and failure analysis keep this study separate from software checks and live-model evaluation.

Quick start

Requires Python 3.10+:

git clone https://github.com/jianghongcheng/radmeasure-agent.git
cd radmeasure-agent
python -m venv .venv
source .venv/bin/activate
pip install -e .
radmeasure --question "Measure HVA and IMA"

The synthetic example returns HVA 15.0°, IMA 8.0°, verification results, and a tool trace. To enable a local LLM planner or image inference, follow model setup.

pip install -e '.[dev]'
python -m pytest -q
python scripts/evaluate_agent_decisions.py

Stack: Python, PyTorch image adapters, FastAPI, SQLite, MCP, Docker, GitHub Actions.

Research use

Research prototype, not validated for diagnosis or patient care. Geometry checks do not establish anatomical correctness. Use synthetic or authorized research data; do not upload patient information to the demo. Weights and private per-image artifacts are not distributed. Data policy.

Usage · Evaluation · Contributing · MIT license

Available Tools

3 tools
analyze_radiographB

Run geometry checks, retrieval, citations, and tool traces for a configured case ID.

ParametersJSON Schema
NameRequiredDescriptionDefault
top_kNo
image_idYes
questionNo

TDQS

B3/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure, and it does add some value by enumerating the four things the tool executes (geometry checks, retrieval, citations, tool traces). However, it leaves key behavior undisclosed: the output/response format, whether this is purely read-only analysis or if it has side effects (the word 'tool traces' hints at instrumentation without explaining it), and any dependency on the case/image already existing.

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?

A single sentence with zero filler, front-loaded with the verb and the resource scope. Every word contributes to meaning, and there is no redundant repetition of the tool name or schema contents.

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

Completeness2/5

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

For a tool with three parameters, no annotations, no output schema, and 0% schema description coverage, this minimal description is inadequate. It omits parameter explanations, output expectations, side effects, prerequisites, and sibling differentiation — an agent gets the gist of what the tool runs but cannot reliably predict results or call it correctly in varied contexts.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate, but it only loosely maps to one parameter ('case ID' ≈ 'image_id', using different terminology). It never explains 'top_k' as a result-count knob or 'question' as the query string, even though 'retrieval' and 'citations' hint at plausible meanings. Two of three parameters are left to inference.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Run') with a concrete resource list ('geometry checks, retrieval, citations, and tool traces'), which clearly states what the tool does. However, it introduces terminology ('case ID') that doesn't match the schema's 'image_id' parameter, and it doesn't explicitly differentiate itself from the sibling listing tools, though the analytical framing ('checks, retrieval') does imply a contrast with the list-oriented siblings.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus list_geomed_capabilities or list_available_cases. The distinction from siblings must be inferred from the verb choices (analyze/run vs. list), and there are no stated prerequisites, preconditions, or explicit exclusions. There is no sentence anywhere telling an agent when to invoke it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_available_casesC

List case identifiers accepted by the configured backend.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo

TDQS

C2.9/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It implies a read-only listing operation, which is non-destructive and simple, but it does not explicitly state side-effect-free behavior, pagination, or any filtering semantics beyond the optional limit. For a low-risk read operation, this is adequate but minimal.

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 a single, focused sentence with no redundant words. It is appropriately concise for a simple list operation, though it could have usefully incorporated parameter semantics without bloating.

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?

Given the tool's low complexity (one optional parameter, no output schema), the description conveys the primary purpose but omits return format details (e.g., how identifiers are presented) and does not clarify the effect of the limit parameter. It is minimally sufficient but leaves the agent guessing about output structure and parameter usage.

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

Parameters1/5

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

The schema has a single parameter 'limit' with no description (0% coverage), and the tool description does not mention limits or how they affect results. The description adds no meaning to the parameter, leaving the agent without any guidance on what 'limit' controls or its practical effect.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a clear action ('list') and a specific resource ('case identifiers accepted by the configured backend'). It is distinct from siblings like list_geomed_capabilities and analyze_radiograph, though it does not explicitly differentiate itself. The verb and object are precise enough for an agent to understand the core function.

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

Usage Guidelines2/5

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

There is no guidance on when to use this tool versus its siblings, nor any context about prerequisites or typical use cases. The description only states what the tool does without any direction on selection among alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_geomed_capabilitiesA

Describe the GeoMed backend, measurements, and limitations.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It does signal that this is a read-only, informational operation ('describe') with no side effects, which is appropriate for a zero-parameter capability query. However, it does not disclose what the returned content looks like or whether results are static configuration or computed at call time.

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?

A single, front-loaded sentence that names its scope in three compact items. No fluff, no repetition of the tool name, and appropriately sized for a parameterless informational tool.

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?

For a zero-parameter, no-annotation, no-output-schema tool, the description states its scope (backend, measurements, limitations) and is largely adequate. A minor enhancement would be noting that it should be consulted before analyze_radiograph to inform measurement choices, but the tool is simple enough that nothing critical is missing.

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

Parameters4/5

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

There are zero parameters, and the schema is an empty object, so the description has nothing to clarify beyond the schema. Per the rubric, a zero-parameter tool warrants a baseline of 4; nothing is missing since the tool takes no input.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('describe') plus a named resource with explicit scope ('GeoMed backend, measurements, and limitations'). It reads as an informational/capability-discovery tool and is distinguishable from siblings list_available_cases (enumeration) and analyze_radiograph (analysis). Slightly vague on what 'backend' or 'limitations' concretely covers, but the purpose is clear enough.

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

Usage Guidelines2/5

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

There is no guidance on when to invoke this tool versus its siblings, nor any when-not-to-use statement. Given that it clearly pairs with analyze_radiograph (understand capabilities before analyzing), explaining that call order would have been valuable, but it is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv0.4.0
    • First observedanalyze_radiograph
    • First observedlist_available_cases
    • First observedlist_geomed_capabilities

TDQS

A3.6/5.0

Scored across 3 tools

Disambiguation5/5

Each tool serves a clearly distinct purpose: describing backend capabilities, listing available cases, and analyzing a specific radiograph. There is no overlap in functionality, making misselection unlikely.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern: list_geomed_capabilities, list_available_cases, analyze_radiograph. The naming is uniform and predictable.

Tool Count5/5

With only 3 tools, the set is tightly scoped for the stated purpose of interacting with a GeoMed backend for case analysis. Each tool earns its place, and the count is appropriate—neither too sparse nor excessive.

Completeness5/5

The tool surface covers the full expected workflow: understanding the backend's capabilities, selecting a case, and performing the analysis (which includes retrieval and citations). No additional operations seem necessary for the apparent read-only analysis domain.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers