The HMS4all MCP Server exposes 48 tools that AI agents can use to interact with the hospital management platform. It follows the Model Context Protocol specification.
import { Client } from '@modelcontextprotocol/sdk/client';
import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse';
const transport = new SSEClientTransport(
new URL('https://your-api.hms4all.com/sse'),
{ headers: { Authorization: 'Bearer hms4all_sk_...' } }
);
const client = new Client({ name: 'my-app', version: '1.0' });
await client.connect(transport);
const result = await client.callTool('search-patients', {
query: 'John Doe'
});
Tool Reference
48 tools organized by category. Each tool requires appropriate API key scopes. Tools marked null scope are public (no scope check).
Billing (3 tools)
Tool
Description
Scope
billing-health-check
Run a billing and subscription health check across all tenants. Identifies payment issues and subscription anomalies.
agents:billing:write
estimate-cost
Estimate the cost of a medical procedure based on service catalog and historical data. Considers comorbidities for cost adjustments.
agents:billing:read
get-billing-summary
Get billing summary for the tenant — today's revenue, pending bills, and breakdown by type.
agents:billing:read
Clinical (4 tools)
Tool
Description
Scope
analyze-lab-results
Analyze laboratory test results and provide clinical interpretation with reference ranges and flags.
agents:clinical:read
check-radiology-report
QA-check a radiology report by analyzing findings and impression for consistency, completeness, and clinical accuracy.
agents:clinical:read
clinical-decision-support
Get AI-powered clinical decision support based on symptoms, diagnosis, and current medications. Checks for contraindications and suggests next steps.
agents:clinical:read
generate-soap-note
Generate a structured SOAP (Subjective, Objective, Assessment, Plan) clinical note from a consultation transcript.
agents:clinical:read
General (11 tools)
Tool
Description
Scope
analyze-patient-flow
Real-time patient flow analysis — OPD wait times, lab TAT, pharmacy TAT, and bottleneck detection with severity levels.
public
analyze-vitals
Simplified NEWS2-style early-warning score from vital signs (rule-based), for patients aged 18 years or more. Give patientId (a patient of your hospital) or ageDays (whole days of life), never both; without either the result is NOT_SCORED (age unknown). Omit any parameter that was not measured, never estimate one. The result has status COMPLETE (score + riskLevel), PARTIAL (partialScore is only a lower bound; missing parameters are named) or NOT_SCORED (reason NO_INPUTS, AGE_UNKNOWN or OUTSIDE_POPULATION).
public
compliance-audit
Run NABH compliance audit — checks credentials, quarantine, lab delays, ER response, stale admissions. Returns score 0-100.
public
generate-discharge-summary
Generate a discharge summary for an IPD admission. Aggregates diagnosis, medications, lab results, and follow-up plan into a structured document.
public
get-training-guide
Get role-specific training walkthrough for a hospital staff member. Returns step-by-step guide with routes and tips.
public
import-data
Map CSV headers and import data for hospital migration. Supports patients, staff, medicines, and investigations.
public
inventory-forecast
Predict medicine stockout dates based on 30-day consumption rate. Returns CRITICAL/WARNING/LOW alerts with suggested order quantities.
public
reconcile-billing
Pre-discharge billing reconciliation — checks for missing lab charges, room charges, and procedure charges.
Suggest the optimal next appointment slot for a doctor-patient pair based on queue, availability, and follow-up history.
public
verify-ot-protocol
Verify a surgical safety checklist (WHO Safe Surgery) for a given phase (Sign In, Time Out, Sign Out).
public
Hr (5 tools)
Tool
Description
Scope
generate-roster
Auto-generate a staff duty roster for a given date range. Creates shift assignments based on staff availability.
agents:hr:write
get-burnout-summary
Staff burnout snapshot — latest burnout metric per staff member over the last 30 days, counts by risk level, and the HIGH/CRITICAL list. Read-only.
agents:hr:read
get-credential-compliance
Credential compliance snapshot — counts by status plus expired and soon-to-expire credentials for the authenticated tenant. Read-only.
agents:hr:read
get-staff-availability
Eligible staff (active, valid credentials, not in CRITICAL burnout) grouped by role for the authenticated tenant. Read-only.
agents:hr:read
get-staff-coverage
Staffing coverage gaps (Roster vs shift requirements) over the next N days for the authenticated tenant. Read-only; proposing fills is a separate HITL action.
agents:hr:read
Human-in-the-Loop (5 tools)
Tool
Description
Scope
propose-admission
Propose a patient admission for human review. Creates a pending action that must be approved before execution.
agents:clinical:write
propose-discharge
Propose a patient discharge for human review. Creates a pending action that must be approved before execution.
agents:clinical:write
propose-lab-order
Propose lab test orders for human review. Creates a pending action that must be approved before execution.
agents:clinical:write
propose-prescription
Propose a prescription for human review. Creates a pending action that must be approved by a clinician before execution.
agents:clinical:write
propose-radiology-order
Propose a radiology study order for human review. Creates a pending action that must be approved before execution.
agents:clinical:write
Monitoring (1 tool)
Tool
Description
Scope
system-monitor
Run a system monitoring cycle to detect anomalies such as brute-force attacks or unusual data exports.
agents:monitoring:read
Onboarding (1 tool)
Tool
Description
Scope
onboarding-chat
Chat with the hospital onboarding assistant. Guides new tenants through hospital setup including department planning and ward configuration.
agents:onboarding:read
Operations (2 tools)
Tool
Description
Scope
get-bed-availability
Get real-time bed availability across wards, optionally filtered by ward type or department.
agents:operations:read
get-queue-status
Get current OPD queue status — waiting, in-progress, and completed counts for today.
agents:operations:read
Pharmacy (2 tools)
Tool
Description
Scope
get-pharmacy-stock
Check pharmacy stock levels. Search by medicine name or filter low-stock items.
agents:pharmacy:read
pharmacy-expiry-scan
Scan pharmacy inventory for medicines nearing expiry within the authenticated tenant. No parameters required — tenant is resolved from auth context.
agents:pharmacy:read
Planning (2 tools)
Tool
Description
Scope
design-hospital
Generate a complete hospital design with departments, workflows, and architecture based on a natural language prompt.
agents:planning:read
suggest-departments
Suggest hospital departments based on hospital type, bed count, and context. Returns structured department recommendations.
agents:planning:read
Reception (8 tools)
Tool
Description
Scope
book-appointment
Book an appointment for a patient with a doctor. Returns the created appointment with token number.
agents:reception:write
cancel-appointment
Cancel a scheduled appointment by ID. A structured reasonCode from the tenant cancel-reason master is REQUIRED (call with an invalid/missing code to be told the valid codes). PAID tokens are routed to the billing desk for a deliberate refund — money never moves automatically.
agents:reception:write
check-doctor-availability
Check a doctor's available time slots for a given date. Returns booked slots and free windows.
agents:reception:read
get-patient
Get full patient details by patient ID, including demographics and allergies.
agents:reception:read
list-appointments
List appointments for a given date range, optionally filtered by doctor or patient. Returns up to 50 appointments.
agents:reception:read
parse-registration
Parse a natural language transcript (e.g., voice input) into structured patient registration data.
agents:reception:read
register-patient
Register a new patient. Creates a User + Patient record. Returns the created patient with UHID.
agents:reception:write
search-patients
Search patients by name, phone, or UHID within the tenant. Returns up to 20 matching patients.
agents:reception:read
Simulation (1 tool)
Tool
Description
Scope
generate-demo-data
Generate simulated ER walk-in patients for testing and demo purposes. Creates patient records with realistic profiles.
agents:simulation:write
Support (3 tools)
Tool
Description
Scope
get-fix-proposal
Retrieve a pending CODE_FIX proposal by ticket ID or action ID. Returns the file, before/after code, and reasoning for the proposed fix. Use this from your IDE to pull fix proposals.
agents:support:read
support-query
Get L1 support assistance. Answers questions about HMS4all features, troubleshoots common issues, and provides guidance.
agents:support:read
triage-support-ticket
Analyze a support ticket and provide structured triage including module classification, root cause analysis, fix suggestion, and effort estimate.
agents:support:write
Resources
The MCP server also provides read-only resources:
URI
Description
ihms://agents
List of all AI agents with MCP tool and A2A skill mappings