> For the complete documentation index, see [llms.txt](https://docs.pascom.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pascom.net/docs/en/setup/acd/ai-agents-pia-setup/pia-actions-inlinetools.md).

# Use Pia Actions with Inline Tools

With **inline tools**, you expand the text instructions (prompts) of your AI agent **Pia** with functional interfaces to the PASCOM phone system and external services. Instead of describing actions purely in text, you insert structured interactive building blocks directly into your prompt.

### Access Inline Tools in the Prompt Editor

{% stepper %}
{% step %}

#### Open the AI Agents settings

In the Admin Dashboard, navigate to **Call Routing** > **AI Agents**.
{% endstep %}

{% step %}

#### Select the Pia prompt

Select your desired Pia agent and switch to the **Pia Prompt** section.
{% endstep %}

{% step %}

#### Insert an action

There are two ways to insert an action:

* **Keyboard command**: Type a slash (`/`) at the desired position in the text field. The inline tools context menu opens with all available tools.
*

```
<figure><img src="/files/en6XPmfBdJHRTGJ2b8jj" alt=""><figcaption></figcaption></figure>
```

* **Button**: Above the text field, click the **Add prompt action** button.
*

```
<figure><img src="/files/AII5CFiAqstyuPQONSM7" alt=""><figcaption></figcaption></figure>
```

{% endstep %}
{% endstepper %}

### 1. Forward to Team

This action seamlessly transfers the conversation from Pia to an internal queue or team.

* **Selection**: Select `/team` and specify the target team (e.g., `/team:Support` or `/team:Sales`).
* **How it works**: When Pia identifies during the conversation that the caller's request matches the defined team, she ends the AI dialog and connects the call to the team.

{% hint style="warning" %}
**Important: Forwarding only to teams & define fallbacks**

Pia forwards **exclusively to teams**, not to individual users. This ensures callers never get stuck at busy or absent extensions.

Always include a clear **fallback instruction** in your prompt if a transfer fails or if Pia does not clearly understand the caller after asking:

```markdown
If you cannot clearly identify the inquiry after asking twice, 
inform the caller politely and forward them to /team:Zentrale.
```

{% endhint %}

***

### 2. Set and Read Labels

Labels serve as structured **data containers** in PASCOM. They attach important information directly to the call, allowing employees in the PASCOM app to see the context immediately.

Pia can utilize labels in two ways:

#### Populate Labels (Write)

* **Status information**: Pia assigns the call to a category (e.g., label `Support` or `Sales`).
* **Enrich with custom data**: Pia requests specific details from the caller and stores the text content in the label (e.g., label `Customer Number: 10482` or `Issue: PC does not start`).

*Example prompt instruction:*

```markdown
Ask for the invoice number. Store the number in the label /Rechnungsnummer.
Briefly summarize the reason for the call and store it in the label /Anrufgrund.
```

#### Read Labels (Read)

Pia can evaluate existing labels from the preceding call history.

For example, if a caller presses `1` for *Prescription orders* in an upstream IVR menu, the label `Prescription` is automatically attached to the call. Pia reads this label at the beginning of the dialog and greets the patient with specific context:

> *"Hello! I see you would like to order a prescription. Which medication do you need?"*

{% hint style="info" %}
**Labels must be pre-defined:**

Pia can write arbitrary data into labels, but does not create new label types automatically. Define all required labels in advance under **Call Routing** > **Labels**.
{% endhint %}

***

### 3. Use Caller Context

Through caller context, Pia accesses caller master data in real time. If the PASCOM phone system recognizes the telephone number in the central phonebook, all contact details become available to Pia as variables.

#### Available Context Fields Overview

| Menu Field                                        | Source & Behavior                                                                                        | Purpose & Example                                                                            |
| ------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| **Caller Number** (`Anrufernummer`)               | Provided directly by the PASCOM trunk. **Always available**, even if the caller is not in the phonebook. | Identification and logging: *"I have recorded your phone number /Anrufernummer."*            |
| **Caller Name** (`Anrufername`)                   | Originates from the phonebook. Contains the full name.                                                   | Greeting known customers: *"Hello Mr. /Anrufername."*                                        |
| **First Name / Last Name** (`Vorname / Nachname`) | Separate name fields from the phonebook.                                                                 | For natural salutations: *"Hello Ms. /Nachname."*                                            |
| **Display Name** (`Anzeigename`)                  | The formatted contact name in the PASCOM system.                                                         | Clear presentation in dialog transcripts.                                                    |
| **Organization** (`Organisation`)                 | Company or client name from the phonebook.                                                               | Personalized greeting for corporate clients: *"Are you calling regarding /Organisation?"*    |
| **Email** (`E-Mail`)                              | Email address saved in the phonebook.                                                                    | Verification for callbacks or confirmations: *"Should we send the confirmation to /E-Mail?"* |
| **Notes** (`Notizen`)                             | Free-text contact notes from the phonebook.                                                              | Taking specific customer requirements into account.                                          |
| **Inbound Rule** (`Eingehende Regel`)             | Name of the dialed inbound rule in PASCOM (e.g., `Service-Hotline` or `Zentrale-DE`).                    | Enables Pia to recognize which line the call arrived on.                                     |

***

### 4. Schedule Appointment (Microsoft 365 Calendar)

With the `/Termin vereinbaren` action, Pia schedules appointments autonomously in a connected Microsoft 365 calendar. Pia checks available time slots in real time, offers options to the caller, and books the confirmed appointment.

#### Prerequisite

Before use, an administrator must set up a **Microsoft 365 Calendar** connector under **Settings** > **Connector** and authenticate it via a Microsoft 365 account. This connector is then automatically provided to Pia. *(The guide for setting up the Microsoft 365 calendar can be found here:* [Calendar from Microsoft 365](https://docs.pascom.net/docs/en/integrations/connector/calendar-microsoft-365.md)*)*

#### Configure Calendar Settings

{% stepper %}
{% step %}

#### Insert the calendar element

Insert the calendar element into your prompt using `/Termin vereinbaren`.
{% endstep %}

{% step %}

#### Open the settings dialog

Click the inserted element to open the settings dialog.

<figure><img src="https://2713225-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVIw0BpSv358R2Pr2HflD%2Fuploads%2FjM8Q9UlXZTR31PtR5YqO%2FPia%20Calendar%20usage.png?alt=media&amp;token=1faef319-608d-47ad-8fd3-a4905fd713a8" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

#### Overview of Calendar Configuration for Pia

<figure><img src="https://2713225-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVIw0BpSv358R2Pr2HflD%2Fuploads%2FUR4aeCrRFqxW8JO6b1uc%2Fconfigure%20pia%20calendar.png?alt=media&amp;token=09388b18-e680-4b5b-ab5f-0fe0ae709d13" alt=""><figcaption></figcaption></figure>

| Parameter                                                  | Description                                                                                                                         | Recommended Value / Example        |
| ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
| **Calendar** (`Kalender`)                                  | Selection of the Microsoft 365 target calendar (e.g., personal calendar or shared team calendar).                                   | `Support Calendar` or `Dr. Miller` |
| **Meeting Duration** (`Termindauer`)                       | Fixed duration of the booked appointment slot.                                                                                      | `30 minutes`                       |
| **Buffer Time** (`Pufferzeit`)                             | Break between consecutive appointments to prevent overlaps.                                                                         | `15 minutes`                       |
| **Number of Slot Suggestions** (`Anzahl Terminvorschläge`) | Maximum number of open appointment slots Pia offers to the caller at once.                                                          | `3 suggestions`                    |
| **Minimum Lead Time** (`Mindestvorlaufzeit`)               | Minimum hours or days required between the call and the earliest available slot (prevents unprepared surprise bookings).            | `2 hours` or `24 hours`            |
| **Max. Booking Horizon** (`Max. Buchungshorizont`)         | How far into the future appointments can be scheduled.                                                                              | `14 days`                          |
| **Availability Hours** (`Verfügbarkeitszeiten`)            | Time windows when bookings are generally permitted (e.g., during office hours only).                                                | `Business hours`                   |
| **Absence Calendar** (`Abwesenheitskalender`)              | Specifies which sub-calendar is checked for vacation, holidays, or closing times so that no appointments are offered on those days. | `Vacation / Absence`               |

{% hint style="info" %}
**Use sub-calendars as absence calendars:**

In Microsoft 365, you can manage separate sub-calendars alongside your primary calendar (e.g., *Work*, *Vacation*, *Training*). Use the **Absence calendar** field to select the specific calendar that defines blocked days. Pia will not suggest appointments on dates with recorded absences.
{% endhint %}

***

### Practical Example: Complete Prompt with Inline Tools

The following example demonstrates how the different inline tools work together in a production prompt:

{% code title="pia-praxis-prompt.md" overflow="wrap" %}

```markdown
# Role and Greeting
You are Pia, the digital assistant for Muster GmbH.
If the caller is recognized, greet them with: 
"Hello Mr./Ms. /anruferkontext:Anzeigename. How can I help you?"
If the caller is unknown, use:
"Hello, you have reached Pia at Muster GmbH. How can I help you?"

# Qualify Inquiries
- For technical issues: Ask for the specific issue description, store it in the label /label:Fehlerbeschreibung, and forward the caller to /team:Support.
- For consultation requests: Offer available appointment slots using /Termin vereinbaren.
- For billing questions: Ask for the invoice number, store it in the label /label:Rechnungsnummer, and forward to /team:Buchhaltung.

# Fallback
If you do not understand the caller after asking twice or if they explicitly request an agent, say:
"I will connect you directly to our front desk." and forward them to /team:Zentrale.
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.pascom.net/docs/en/setup/acd/ai-agents-pia-setup/pia-actions-inlinetools.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
