# Clinical Tools

The agent has built-in tools for interacting with clinical data during live interactions, whether voice calls or text sessions. These tools execute identically regardless of channel. They read from and write to the [world model](https://docs.amigo.ai/data/world-model), and write operations fire outbound sync events that the [connector runner](https://docs.amigo.ai/data/connectors-and-ehr) delivers to the EHR.

All write operations carry conversation-level confidence and must pass through [confidence gates](https://docs.amigo.ai/data/connectors-and-ehr) before reaching external systems.

## Patient Tools

| Tool               | Type  | What It Does                                                                                                                                                                                                                                                  |
| ------------------ | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Patient lookup** | Read  | Searches patients by date of birth, name, phone number, or medical record number. Returns demographics, insurance, upcoming appointments, and recent visits. Uses a cascading search strategy that tries progressively broader matching.                      |
| **Patient create** | Write | Creates a new patient record with automatic address parsing and location resolution for EHR sync. Duplicate checking is required before creation.                                                                                                             |
| **Patient update** | Write | Updates patient demographics: phone, email, address (free-text or structured with line, city, state, postal code), gender, and preferred language. Existing fields not included in the update are preserved. Fires outbound sync to update the EHR.           |
| **Save patient**   | Write | Combined create-or-update operation. If an entity ID is provided, updates the existing patient. If not, checks for duplicates by name and date of birth and creates a new record if no match is found. Accepts flexible date formats and natural field names. |

## Scheduling Tools

| Tool                       | Type  | What It Does                                                                                                                                                                                                                                                                                                                                                                                                  |
| -------------------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Slot search**            | Read  | Searches available appointment slots from the EHR. Filters by location, date, appointment type, provider, and time preference (morning, afternoon, or evening). When a time preference is specified and no exact matches exist, falls back to the nearest available window. Handles timezone-aware filtering based on clinic location. Results are cached per session for fast slot reference during booking. |
| **Schedule appointment**   | Write | Books an appointment using an available slot. Writes to both the appointment and patient entities atomically, ensuring both stay in sync.                                                                                                                                                                                                                                                                     |
| **Appointment lookup**     | Read  | Searches a patient's existing appointments by status (booked, pending, fulfilled, cancelled) and date range.                                                                                                                                                                                                                                                                                                  |
| **Cancel appointment**     | Write | Cancels a booked appointment with a required cancellation reason. Fires outbound sync.                                                                                                                                                                                                                                                                                                                        |
| **Confirm appointment**    | Write | Confirms a booked appointment. Fires outbound sync.                                                                                                                                                                                                                                                                                                                                                           |
| **Reschedule appointment** | Write | Reschedules an existing appointment to a new slot. Cancels the original and books the replacement atomically, maintaining continuity in the patient's appointment history.                                                                                                                                                                                                                                    |

## Medication and Encounter Tools

| Tool                    | Type  | What It Does                                                                                                                                    |
| ----------------------- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| **Medication lookup**   | Read  | Retrieves a patient's active medications from the world model. Returns medication name, dosage, frequency, and prescriber information.          |
| **Prescription refill** | Write | Creates a refill request for an existing medication. Writes a MedicationRequest event at voice confidence for review before syncing to the EHR. |
| **Encounter lookup**    | Read  | Retrieves a patient's encounter history (visits, diagnoses, participating practitioners). Can be filtered by date range and encounter type.     |

## Encounter Documentation Tools

These tools support [clinical copilot](https://docs.amigo.ai/channels/clinical-copilot) workflows where the platform generates structured notes from provider-patient encounters in real time.

| Tool                       | Type  | What It Does                                                                                                                                                                                    |
| -------------------------- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **SOAP generation**        | Write | Produces structured Subjective, Objective, Assessment, and Plan sections from the encounter transcript. Updates incrementally as the conversation progresses.                                   |
| **ICD-10 suggestion**      | Read  | Analyzes the clinical discussion and suggests relevant diagnosis codes ranked by confidence. Checks suggested codes against the patient's existing conditions and medication list.              |
| **Clinical alerts**        | Read  | Monitors for drug interactions, allergy contraindications, and vital sign concerns using the patient's full world model context. Alerts surface in real time during the encounter.              |
| **Encounter finalization** | Write | Creates a frozen clinical snapshot at encounter end - SOAP notes, ICD-10 codes, and alerts packaged for review. Finalized encounters can trigger follow-up outbound calls and surface delivery. |

## Insurance Tools

| Tool                 | Type  | What It Does                                                                                                                                                                                                                                                                                                                                               |
| -------------------- | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Insurance create** | Write | Creates an insurance coverage record for a patient. Supports primary/secondary priority, non-self relationships (spouse, child), and group numbers. The outbound adapter fuzzy-matches carrier names against the practice's insurance list.                                                                                                                |
| **Payer search**     | Read  | Searches the practice's accepted insurance payer list using fuzzy matching. Matches by exact substring, alias expansion (common abbreviations like "Blue Cross" to "BCBS", "UHC" to "United Healthcare"), token overlap, and sequence similarity. The agent can verify a patient's stated insurance carrier against the practice's accepted list mid-call. |

## Queue and Ticket Tools

| Tool              | Type  | What It Does                                                                                                                                                                                                                                                                                        |
| ----------------- | ----- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Queue lookup**  | Read  | Reads outbound task entities from the world model, returning pending or scheduled tasks ordered by priority or next attempt time. Filterable by status (scheduled, dispatched, completed, failed, cancelled, snoozed). Useful for agents that need to check task backlogs or prioritize follow-ups. |
| **Ticket create** | Write | Creates a support ticket event for a patient entity. The event flows through outbound sync to the workspace's ticketing or CRM system. Supports title, description, priority (low, normal, high, critical), and category fields.                                                                    |

## Outbound Tools

| Tool                       | Type  | What It Does                                                                                                                                                                                                                                                                              |
| -------------------------- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Schedule outbound call** | Write | Schedules a future outbound call to the patient. Creates an outbound task entity that the connector runner's dispatch loop executes. Configurable priority, call window, max attempts, and context for the outbound agent. Deduplicates by patient + reason + date.                       |
| **Log call**               | Write | Records a call outcome event for a patient (e.g., appointment booked, confirmed, declined, no answer, rescheduled, voicemail left, callback requested). These outcome events flow through outbound sync back to the source system, enabling downstream reporting and workflow automation. |

## Search Tools

| Tool                        | Type | What It Does                                                                                                                               |
| --------------------------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| **Semantic patient search** | Read | Searches patients by natural language description (e.g., "elderly diabetic patient on insulin"). Uses vector similarity over patient data. |
| **Semantic event search**   | Read | Searches clinical events by natural language (e.g., "recent blood sugar results"). Can be scoped to a specific patient.                    |

## How Tools Interact with the World Model

Write tools follow a consistent pattern:

1. The tool writes a normalized event to the world model at voice-level confidence
2. The world model recomputes the affected entity's projected state
3. The tool publishes an outbound sync event to the connector runner's queue
4. The connector runner delivers the write to the EHR when the external system is ready

This means the patient gets an immediate confirmation during the call (the world model is updated instantly), while the EHR receives the write asynchronously through the confidence-gated pipeline. If the EHR is temporarily unavailable, the write is queued and retried.

{% hint style="info" %}
These are the platform's built-in clinical tools. Workspaces can add additional capabilities through [Platform Functions](https://docs.amigo.ai/agent/platform-functions) (declarative SQL, Python, and AI functions) or Skills (LLM-backed micro-agents that can run standard reasoning, orchestration workflows, browser automation, or [desktop automation](https://docs.amigo.ai/platform-functions#skill-execution-tiers) for systems without APIs).
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.amigo.ai/agent/clinical-tools.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
