Skip to main content
Glama
Kartha-AI

MCP Server for Google Cloud Healthcare API

by Kartha-AI

get-drug-info

Retrieve detailed drug information using its generic name with a tool designed for FHIR-based digital health solutions, enabling efficient clinical workflows and pre-authorization processes.

Instructions

Get Drug details by a generic name

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
genericNameYes

Implementation Reference

  • The primary handler for the 'get-drug-info' tool. It extracts the genericName from arguments, caches the result using CacheManager, fetches drug information by calling searchGenericName, and returns the JSON-formatted drug data.
    async getDrug(args: any, cache: CacheManager) {
      const { genericName} = args
      const cacheKey = cache.createKey('interactions', { genericName: genericName});
      
      const drug = await cache.getOrFetch(
        cacheKey,
        () => this.searchGenericName(genericName)
      );
    
      return {
        content: [{
          type: 'text',
          text: JSON.stringify(drug, null, 2)
        }]
      };
    }
  • The input schema and metadata definition for the 'get-drug-info' tool, specifying genericName as required string input.
    {
      name: 'get-drug-info',
      description: 'Get Drug details by a generic name',
      inputSchema: {
        type: 'object',
        properties: {
          genericName: { type: 'string' },
        },
        required: ['genericName']
      }
    },
  • Registration and dispatch for 'get-drug-info' tool in the handleCall switch statement, delegating to FDA.getDrug method.
    case "get-drug-info":
      return await this.fdaApi.getDrug(request.params.arguments,this.cache);
  • Supporting helper function that performs the actual FDA API query for drugs matching the generic name and returns the results.
    async searchGenericName(genericName: string): Promise<Generics[]> {
      const url = new URL(this.baseUrl);
      url.searchParams.append('search', `generic_name:"${genericName}"`)
      
      const response = await fetch(url);
      const data = await response.json() as FDAResponse;
    
      return data.results;
    }

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/Kartha-AI/google-cloud-healthcare-api-mcp'

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