get_patient_allergies
Retrieve patient allergies and intolerances by specifying patient ID, category, status, and type to enhance clinical workflows using the MCP Server for Google Cloud Healthcare API.
Instructions
Get allergies and intolerances for a patient
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | No | ||
| patientId | Yes | ||
| status | No | ||
| type | No |
Implementation Reference
- Core handler function that performs FHIR API search for patient allergies/intolerances with optional filters (status, type, category) and formats the response.async getPatientAllergies(args: any) { const params = new URLSearchParams(); params.append('patient', args.patientId); if (args.status) params.append('clinical-status', args.status); if (args.type) params.append('type', args.type); if (args.category) params.append('category', args.category); const response = await this.client.get(`/AllergyIntolerance?${params}`); return this.formatResponse(`fhir://Patient/${args.patientId}/allergies`, response.data); }
- src/server/handlers/ToolHandler.ts:76-77 (registration)Tool dispatch/registration in the main CallTool handler switch statement, routing 'get_patient_allergies' calls to FhirClient.getPatientAllergies.case "get_patient_allergies": return await this.fhirClient.getPatientAllergies(request.params.arguments);
- src/server/constants/tools.ts:85-107 (schema)Tool definition including name, description, and input schema (requires patientId, optional status/type/category filters). Used for ListTools response.{ name: "get_patient_allergies", description: "Get allergies and intolerances for a patient", inputSchema: { type: "object", properties: { patientId: { type: "string" }, status: { type: "string", enum: ["active", "inactive", "resolved"] }, type: { type: "string", enum: ["allergy", "intolerance"] }, category: { type: "string", enum: ["food", "medication", "environment", "biologic"] } }, required: ["patientId"] } },