Skip to main content
Glama

get_encounter

Retrieve detailed clinical encounter information from athenahealth's electronic health records to support patient care decisions and documentation.

Instructions

Get details of a specific encounter

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
encounter_idYesEncounter ID

Implementation Reference

  • Tool schema definition including name, description, and input validation schema requiring 'encounter_id'.
    {
      name: 'get_encounter',
      description: 'Get details of a specific encounter',
      inputSchema: {
        type: 'object',
        properties: {
          encounter_id: { type: 'string', description: 'Encounter ID' },
        },
        required: ['encounter_id'],
      },
    },
  • Executes the get_encounter tool: parses input, fetches encounter via client, logs audit, returns JSON response or error.
    async handleGetEncounter(args: any) {
      try {
        const { encounter_id } = args;
        const encounter = await this.client.getEncounter(encounter_id);
    
        auditLog('ENCOUNTER_ACCESS', {
          resourceId: encounter_id,
          result: 'success',
          resourceType: 'ENCOUNTER',
        });
    
        return {
          content: [
            {
              type: 'text' as const,
              text: JSON.stringify(encounter, null, 2),
            },
          ],
        };
      } catch (error: any) {
        return {
          content: [
            {
              type: 'text' as const,
              text: JSON.stringify({
                error: 'Failed to get encounter',
                message: error.message || 'Unknown error occurred',
                status: error.status || null,
                note: 'Encounter endpoints may not be available in the athenahealth preview/sandbox environment.',
              }, null, 2),
            },
          ],
        };
      }
    }
  • Dispatches get_encounter tool calls to the handler in the MCP server's tool execution switch statement.
    case 'get_encounter':
      return await this.toolHandlers.handleGetEncounter(args);

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