Skip to main content
Glama

check_drug_interactions

Check for potential drug interactions between medications for a specific patient using athenahealth's clinical data.

Instructions

Check for drug interactions for a patient

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patient_idYesPatient ID
medicationsYesList of medication names or RxNorm codes

Implementation Reference

  • MCP tool handler that processes the check_drug_interactions tool call. Extracts parameters, calls the client service, logs data access, and returns the interactions as JSON text content.
    async handleCheckDrugInteractions(args: any) {
      const { patient_id, medications } = args;
      const interactions = await this.client.checkDrugInteractions(patient_id, medications);
    
      logDataAccess('DRUG_INTERACTIONS', patient_id, 'CHECK');
    
      return {
        content: [
          {
            type: 'text' as const,
            text: JSON.stringify(interactions, null, 2),
          },
        ],
      };
    }
  • Tool schema definition including name, description, and input validation schema for check_drug_interactions.
    {
      name: 'check_drug_interactions',
      description: 'Check for drug interactions for a patient',
      inputSchema: {
        type: 'object',
        properties: {
          patient_id: { type: 'string', description: 'Patient ID' },
          medications: {
            type: 'array',
            items: { type: 'string' },
            description: 'List of medication names or RxNorm codes'
          },
        },
        required: ['patient_id', 'medications'],
      },
    },
  • Registration of the check_drug_interactions tool in the MCP server request handler switch statement, dispatching to the tool handler.
    case 'check_drug_interactions':
      return await this.toolHandlers.handleCheckDrugInteractions(args);
  • Core helper function that performs the actual API call to athenahealth's druginteractions endpoint, constructing form data from medications list and returning ClinicalAlert[].
    async checkDrugInteractions(patientId: string, medications: string[]): Promise<ClinicalAlert[]> {
      const formData = new URLSearchParams();
      medications.forEach((med, index) => {
        formData.append(`medications[${index}]`, med);
      });
    
      const response = await this.makeRequest<AthenaHealthResponse<ClinicalAlert[]>>(
        `${this.config.practice_id}/patients/${patientId}/druginteractions`,
        {
          method: 'POST',
          data: formData.toString(),
          headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
          },
        }
      );
      return response.data;
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ophydami/Athenahealth-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server