athenahealth_get_encounter_summary, the native AthenaHealth encounter summary tool exposed through the Agents Platform.
Authentication
AthenaHealth tools use the existing AthenaHealth connector. Users configure:client_idclient_secretpractice_idenvironment
athenahealth_get_encounter_summary
Fetches a read-only AthenaHealth encounter by visit_id, then enriches it with related appointment, patient demographics, patient insurances, existing procedure codes, and booked appointments near the encounter date.
This tool is intended to be the first Athena step in realtime coding. It returns enough information for cheap deterministic skip checks before the workflow spends API/LLM budget on full documentation.
Inputs
Required:visit_id: AthenaHealth encounter ID. Treat this as an opaque string.
appointment_window_days: Days on either side of the encounter date for nearby booked appointments. Defaults to5and is capped at30.
Execution Flow
Lookup Behavior
The tool:- fetches
/chart/encounter/{visit_id}, - fetches the related appointment when
appointmentidis present, - resolves
patientidfrom the encounter first, then the appointment, - fetches patient demographics and insurances when possible,
- builds a nearby appointment window from the encounter date,
- fetches nearby booked appointments when patient and provider/department context is available.
errors.
Output
On success, structured content is a typedEncounterSummaryResult envelope (with a typed EncounterSummaryInfo summary block and a typed []Appointment appointments slice). The encounter, appointment, patient, insurances, and procedure_codes fields are retained as raw upstream passthrough so no AthenaHealth field is dropped. The JSON shape is unchanged. It includes:
success: truepractice_idvisit_idappointment_idpatient_idsummaryencounterappointmentpatientinsurancesprocedure_codesappointmentserrors
Human-readable text
In addition to the structured content above, the tool emits a markdown text block so the related detail is visible in the task feed (the generic feed renderer shows the markdown directly). It contains:## Encounter Summary— the core summary table (practice, visit, patient, counts, diagnoses, provider, department, chart ID, status, last updated).## Appointment— the primary appointment: ID, type, date, start time, duration, department, status, copay, charge-entry flag, rendering/supervising provider, urgent (omitted when no appointment resolved).## Patient— name, patient ID, DOB, sex, status, marital status, address, home phone, email, department, registration date (omitted when no patient resolved).## Insurance (N)— one row per insurance: sequence, payer, plan, member ID, type, eligibility, last checked, policy holder, phone, relationship (omitted when none).## Nearby Appointments (N)— for each appointment in the window: appointment ID, date, start time, type, status, encounter status, check-in, check-out, provider, visit ID, encounter ID, reason (omitted when none).
athenahealth_not_connected: AthenaHealth is not connected.- Main encounter lookup fails: return a tool error.
- Partial enrichment errors: returned under
errorswhile preserving available data.