Infrastructure for AI-assisted clinical research with EHR datasets, exposing tools for clinical database querying, cohort building, and note retrieval via MCP protocol
The M4 server has 11 tools with reasonable naming conventions (verb-first: list_, get_, execute_, search_, etc.) and moderate description quality. However, there are significant gaps in parameter descriptions, schema completeness, and error handling guidance. Most tools accept dataset and query parameters with minimal constraint documentation. The deprecated `set_dataset` tool undermines clarity. Output schemas are not documented in the source. Error handling lacks recovery guidance. The cohort_builder UI integration (tools #9-10) relies on MCP Apps extension, which is present but not yet standard.
Return the M4 capability manifest as JSON.
Launch the interactive cohort builder UI. Filter patients by age, gender, and other criteria with live counts. Requires a host that supports MCP Apps (like Claude Desktop).
🔍 Execute a SQL query against the database.
📚 Discover what data is available in the database.
📄 Retrieve the full text of a clinical note.
📊 Get detailed schema and sample data for a specific table.
Missing output schemas for all tools. No documented return types, field names, or structures. LLMs cannot infer what data to expect or how to chain results to downstream tools.
Parameter descriptions are minimal or missing context. E.g., 'dataset_name' has no constraint on format, length, or valid values; 'query' parameter lacks guidance on SQL dialect, size limits, or timeout behavior.
set_dataset is marked deprecated but still exposed. Deprecated tools should be removed or clearly marked with migration guidance. Leaving it live confuses LLMs about whether to use it.
Inferred effective spec: 2026-07-28+.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | C | 65 | 2026-07-28+ | v2 |
| 2026-03-09 | C | 65 | - | v1 |
📋 List all available datasets and their status.
📋 List all notes for a specific patient.
Query cohort counts and demographics based on filtering criteria. Used by the cohort builder UI for live updates.
🔎 Full-text search across clinical notes.
Deprecated: M4 no longer keeps a global active dataset.
execute_query tool accepts arbitrary SQL with no validation, size limits, or timeout constraints documented. LLMs may inadvertently craft expensive queries or cause resource exhaustion.
No pagination support documented. Tools like list_datasets, list_patient_notes, and search_notes lack offset/limit parameters or next_cursor fields. Large result sets risk blowing context windows.
Error handling lacks recovery guidance. No documentation on what errors can occur, how to classify them (retryable vs. fatal), or what the LLM should do next.
cohort_builder and query_cohort depend on MCP Apps (SEP-1865) UI extension, which is opt-in. Clients that do not support Apps will fail silently or with unclear error.
No constraints on dataset parameter format or valid values. LLMs cannot know which dataset names are valid without calling list_datasets first, forcing discovery overhead.