get_clinical_summary
Retrieve comprehensive patient clinical summaries including allergies, problems, prescriptions, vitals, lab results, and clinical alerts for informed medical decision-making.
Instructions
Get a comprehensive clinical summary for a patient
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| include_alerts | No | Include clinical alerts | |
| include_allergies | No | Include allergies | |
| include_labs | No | Include lab results | |
| include_prescriptions | No | Include prescriptions | |
| include_problems | No | Include problems | |
| include_vitals | No | Include vitals | |
| patient_id | Yes | Patient ID |
Input Schema (JSON Schema)
{
"properties": {
"include_alerts": {
"default": true,
"description": "Include clinical alerts",
"type": "boolean"
},
"include_allergies": {
"default": true,
"description": "Include allergies",
"type": "boolean"
},
"include_labs": {
"default": true,
"description": "Include lab results",
"type": "boolean"
},
"include_prescriptions": {
"default": true,
"description": "Include prescriptions",
"type": "boolean"
},
"include_problems": {
"default": true,
"description": "Include problems",
"type": "boolean"
},
"include_vitals": {
"default": true,
"description": "Include vitals",
"type": "boolean"
},
"patient_id": {
"description": "Patient ID",
"type": "string"
}
},
"required": [
"patient_id"
],
"type": "object"
}
Implementation Reference
- src/handlers/tool-handlers.ts:215-304 (handler)The primary handler function implementing the get_clinical_summary tool. Fetches comprehensive patient data (demographics, allergies, problems, prescriptions, vitals, labs, alerts) with graceful error handling for sandbox limitations.async handleGetClinicalSummary(args: any) { const { patient_id, ...options } = args; const summary: any = {}; const errors: any = {}; // Get patient details try { summary.patient = await this.client.getPatient(patient_id); } catch (error: any) { errors.patient = error.message || 'Failed to fetch patient data'; } // Get clinical data based on options - handle errors gracefully const warnings: string[] = []; if (options.include_allergies !== false) { try { summary.allergies = await this.client.getPatientAllergies(patient_id); } catch (error: any) { warnings.push('Allergies endpoint not available in preview/sandbox'); summary.allergies = []; } } if (options.include_problems !== false) { try { summary.problems = await this.client.getPatientProblems(patient_id); } catch (error: any) { warnings.push('Problems endpoint not available in preview/sandbox'); summary.problems = []; } } if (options.include_prescriptions !== false) { try { summary.prescriptions = await this.client.getPatientPrescriptions(patient_id); } catch (error: any) { warnings.push('Prescriptions endpoint not available in preview/sandbox'); summary.prescriptions = []; } } if (options.include_vitals !== false) { try { summary.vitals = await this.client.getPatientVitals(patient_id); } catch (error: any) { warnings.push('Vitals endpoint not available in preview/sandbox'); summary.vitals = []; } } if (options.include_labs !== false) { try { summary.labs = await this.client.getPatientLabResults(patient_id); } catch (error: any) { warnings.push('Labs endpoint not available in preview/sandbox'); summary.labs = []; } } if (options.include_alerts !== false) { try { summary.alerts = await this.client.getClinicalAlerts(patient_id); } catch (error: any) { warnings.push('Alerts endpoint not available in preview/sandbox'); summary.alerts = []; } } // Include warnings and errors if (warnings.length > 0) { summary._warnings = warnings; summary._note = 'Preview/Sandbox environment: Clinical endpoints unavailable. Only patient demographics accessible.'; } if (Object.keys(errors).length > 0) { summary._errors = errors; } logDataAccess('CLINICAL_SUMMARY', patient_id, 'READ'); return { content: [ { type: 'text' as const, text: JSON.stringify(summary, null, 2), }, ], }; }
- src/definitions/tools.ts:87-103 (schema)Tool schema definition including input parameters for patient_id (required) and optional flags to include various clinical data types.{ name: 'get_clinical_summary', description: 'Get a comprehensive clinical summary for a patient', inputSchema: { type: 'object', properties: { patient_id: { type: 'string', description: 'Patient ID' }, include_allergies: { type: 'boolean', description: 'Include allergies', default: true }, include_problems: { type: 'boolean', description: 'Include problems', default: true }, include_prescriptions: { type: 'boolean', description: 'Include prescriptions', default: true }, include_vitals: { type: 'boolean', description: 'Include vitals', default: true }, include_labs: { type: 'boolean', description: 'Include lab results', default: true }, include_alerts: { type: 'boolean', description: 'Include clinical alerts', default: true }, }, required: ['patient_id'], }, },
- src/mcp-server.ts:191-192 (registration)Tool registration in the MCP server's CallToolRequestHandler switch statement, dispatching to the handler method.case 'get_clinical_summary': return await this.toolHandlers.handleGetClinicalSummary(args);