> ## Documentation Index
> Fetch the complete documentation index at: https://agents.nanonets.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# DrChrono Get Appointment Summary

> Native DrChrono appointment summary tool exposed through the Agents Platform.

This document covers `drchrono_get_appointment_summary`, the native DrChrono appointment summary tool exposed through the Agents Platform.

## Authentication

DrChrono tools use the DrChrono OAuth connector. The platform injects:

* `access_token`

The token is minted and refreshed by the integration service. Tools do not accept raw API keys, Nanonets API keys, webhook URLs, or caller-supplied token-fetch endpoints.

## `drchrono_get_appointment_summary`

Fetches a DrChrono appointment by `appointment_id`, then enriches it with patient, eligibility, line items, and nearby appointments for the same patient.

This tool is read-only and is intended to run before expensive documentation and LLM calls.

### Inputs

Required:

* `appointment_id`: DrChrono appointment ID.

Optional:

* `appointment_window_days`: Days on either side of the current date used for nearby appointment lookup. Defaults to `7`.

### Matching / Lookup Behavior

The tool:

* calls `GET /api/appointments/{appointment_id}?verbose=true`,
* extracts patient and doctor identifiers,
* fetches patient details,
* fetches eligibility checks for the appointment,
* fetches line items for existing procedure code context,
* lists nearby appointments for the patient.

### Output

On success, structured content is a typed `AppointmentSummaryResult` envelope (with a typed `AppointmentSummaryInfo` `summary` block). The `appointment`, `patient`, `eligibility`, `line_items`, and `nearby_appointments` fields are retained as raw upstream passthrough so no DrChrono field is dropped. The JSON shape is unchanged:

```json theme={null}
{
  "success": true,
  "appointment_id": "123",
  "patient_id": "456",
  "doctor_id": "789",
  "summary": {
    "clinical_note_locked": "true",
    "appointment_type": "Medication Management",
    "existing_procedure_codes": []
  },
  "appointment": {},
  "patient": {},
  "eligibility": [],
  "line_items": [],
  "nearby_appointments": [],
  "errors": {}
}
```

Common failure reasons:

* `drchrono_not_connected`: DrChrono is not connected.
* Appointment fetch failure: fatal.
* Patient / eligibility / line-item enrichment failures: returned under `errors`.

## Human-readable text

The tool emits markdown for the feed: an `## Appointment Summary` table, an `## Appointment` field table, `## Patient`, `## Line Items`, `## Eligibility`, `## Nearby Appointments`, and `## Errors` sections. The full raw payloads stay in `structuredContent`.

## Agent Instruction Guidance

Use this as the first DrChrono step in realtime coding. If the clinical note is not locked or line items already exist and `force_recode=false`, the workflow should stop before documentation fetch.
