A2A Protocol The HMS4all A2A (Agent-to-Agent) endpoint enables structured agent communication via JSON-RPC. 26 skills with task persistence and keyword-based automatic routing.
Agent Card The agent card is discoverable at the standard Well-Known URL:
GET https://your-api.hms4all.com/.well-known/agent.json
{
"name": "HMS4all Hospital Management AI",
"description": "Multi-tenant hospital management platform with specialized AI agents",
"version": "1.0.0",
"url": "https://your-api.hms4all.com",
"capabilities": { "streaming": true },
"authentication": { "schemes": ["bearer"] },
"skills": [ ... ]
} Sending a Task curl -X POST https://your-api.hms4all.com/a2a \
-H "Content-Type: application/json" \
-H "Authorization: Bearer hms4all_sk_your_api_key" \
-d '{
"jsonrpc": "2.0",
"method": "tasks/send",
"id": "req-1",
"params": {
"id": "task-unique-id",
"message": {
"role": "user",
"parts": [
{ "type": "text", "text": "Analyze these lab results: CBC Hb 10.2, WBC 12000" }
]
}
}
}' Skill Routing When you send a task, the system automatically routes to the best skill using keyword matching on the message text. You can also specify a skill explicitly in the task metadata:
{
"params": {
"id": "task-002",
"metadata": { "skillId": "lab-interpretation" },
"message": {
"role": "user",
"parts": [{ "type": "text", "text": "..." }]
}
}
} Task Lifecycle SUBMITTED → WORKING → COMPLETED
→ FAILED
→ INPUT_REQUIRED (HITL skills) SUBMITTED : Task received, routing to skillWORKING : Skill is processingCOMPLETED : Result available in responseFAILED : Error during processingINPUT_REQUIRED : HITL skills — human review needed. Send follow-up with actionId to check statusTask Persistence All tasks are persisted in the database. You can retrieve a task at any time:
{
"jsonrpc": "2.0",
"method": "tasks/get",
"id": "req-2",
"params": { "id": "task-unique-id" }
} Skill Reference 26 skills organized by category. All output JSON.
Architecture (1 skill) Skill ID Name Input HITL hospital-design Hospital Architect TEXTNo
Billing (3 skills) Skill ID Name Input HITL billing-check Billing Health Check TEXTNo billing-summary Billing Summary JSONNo cost-estimation Cost Estimator TEXT, JSONNo
Clinical (2 skills) Skill ID Name Input HITL clinical-decision Clinical Decision Support TEXT, JSONNo clinical-notes Clinical Scribe TEXTNo
Hospital-setup (1 skill) Skill ID Name Input HITL department-planning Department Planner TEXT, JSONNo
Hr (1 skill) Skill ID Name Input HITL roster-generation Smart Roster Generator JSONNo
Human-in-the-Loop (3 skills) Skill ID Name Input HITL admit-patient Admit Patient (HITL) JSONHITL discharge-patient Discharge Patient (HITL) JSONHITL prescribe-medication Prescribe Medication (HITL) JSONHITL
Monitoring (1 skill) Skill ID Name Input HITL vitals-assessment Vitals Monitor TEXT, JSONNo
Operations (2 skills) Skill ID Name Input HITL bed-availability Bed Availability JSONNo queue-status OPD Queue Status JSONNo
Pathology (1 skill) Skill ID Name Input HITL lab-interpretation Lab Interpreter TEXT, JSONNo
Pharmacy (2 skills) Skill ID Name Input HITL pharmacy-scan Pharmacy Expiry Scanner JSONNo stock-check Pharmacy Stock Check JSONNo
Radiology (1 skill) Skill ID Name Input HITL radiology-qa Radiology QA TEXT, JSONNo
Reception (3 skills) Skill ID Name Input HITL appointment-management Appointment Management JSONNo patient-lookup Patient Lookup TEXT, JSONNo registration-parser Registration Parser TEXTNo
Setup (1 skill) Skill ID Name Input HITL onboarding-chat Onboarding Assistant TEXTNo
Support (3 skills) Skill ID Name Input HITL get-fix-proposal Get Code Fix Proposal TEXT, JSONNo support-query Support Assistant TEXTNo support-triage Support Ticket Triage TEXT, JSONNo
Surgical (1 skill) Skill ID Name Input HITL ot-protocol OT Protocol Verifier JSONNo
HITL Skills Flow HITL skills use INPUT_REQUIRED state to pause for human review:
Send task with clinical data (e.g., prescription items) Skill creates an AgentAction and returns INPUT_REQUIRED with actionId Human reviews in the admin dashboard → approves or rejects Send follow-up task with {"actionId":"..."} to check result Returns COMPLETED with final status (APPROVED/REJECTED/PENDING) Interactive Skill Tester A2A Skill Tester Select Skill (optional — auto-routes if empty) Auto-route by keywords... Message
Error Handling // JSON-RPC error response
{
"jsonrpc": "2.0",
"id": "req-1",
"error": {
"code": -32600, // Invalid request
"message": "..."
}
}
// Codes:
// -32700 Parse error
// -32600 Invalid request
// -32601 Method not found
// -32000 Server error Next Steps