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

# Microsoft 365 Assistant

> The Microsoft 365 assistant combines the five Microsoft 365 connectors into one assistant that answers questions about e-mails, appointments, files and Teams messages in the context of the signed-in user. This page contains every text needed to create it by hand.

## About this assistant

The Microsoft 365 assistant is a global assistant that combines five connectors: Outlook e-mails, Outlook calendar, OneDrive, SharePoint and Teams messages. It only ever reaches the data the signed-in user is allowed to see, and answers from actually retrieved results rather than from its own knowledge.

New installations already ship with it. Instances installed before the connectors were reworked still carry the old system prompt and the old search term descriptions. This page contains the current texts verbatim so that you can adopt them.

<Warning>
  **Recommended for production use: turn the DLP check off for this assistant.**

  Anonymisation replaces names, addresses and other personal details with pseudonyms — the very terms the assistant searches your mailbox, calendar and documents with. Searches then return no hits at all, or incomplete ones.

  Because the retrieved content reaches the language model unfiltered as a result, we recommend running this assistant on a model hosted in your own Microsoft tenant (Azure AI Foundry), with data residency in your region.
</Warning>

<Note>
  The connectors work in the user context. Every user has to sign in through Microsoft Entra ID once before the assistant can reach their mailbox, calendar and files.
</Note>

## What the assistant can do

**E-mails**

* "Which e-mails from last week are still waiting for a reply?"
* "Summarise the e-mail exchange with Example Ltd about project Orion."
* "Did I get an answer to the quote from 12 May?"

**Calendar**

* "Which appointments do I have tomorrow?"
* "Where do I have two hours free next week?"
* "When did I last meet the sales team?"

**Files in OneDrive and SharePoint**

* "Which presentations about project Orion exist?"
* "What does the current quote for Example Ltd say?"
* "Find the latest version of the security concept and summarise the changes."

**Teams messages**

* "Who did I chat with today?"
* "What was discussed in the sales channel about the price list?"

**Across all sources**

* "Find everything about project Orion." The assistant searches e-mails, files and Teams messages in parallel.

Every answer names the source it used, with title, date and link.

## Setup from the command line

<Note>
  The command is available from the Monthly Release onwards. In the Extended Support Release, create the assistant by hand as described below.
</Note>

If the assistant does not exist on your instance yet, or still carries the old texts, this command creates it together with its connectors:

```bash theme={null}
./flow microsoft365:setup
```

* It creates the five connectors and the assistant, linked and in one step.
* The assistant gets the default model for new assistants configured under **Administration > Settings**, and that model's DLP setting.
* Existing entries stay untouched. When a name is already taken, the new entry is created as "name (NEW)" next to it, so you can compare both and delete the old one afterwards.
* Groups with an explicit permission list do not pick up new entries automatically. Grant the assistant and the connectors to them under **Administration > Groups** afterwards.

## Manual setup

If you have no access to the command line, create the entries in the administration and adopt the following texts verbatim. They are deliberately English: they instruct the language model, not the user. The assistant still answers in the language of the question.

### Create the connectors

Create five connectors under **Administration > Connectors**. The general procedure is described under [Connectors](/en/extended-support/connectors/index); the options and arguments of the two connector types used here are documented under [Microsoft 365](/en/extended-support/connectors/microsoft365) and [Microsoft 365 Calendar](/en/extended-support/connectors/microsoft365calendar).

### Microsoft Outlook Emails

**Title**

```text theme={null}
Microsoft Outlook Emails
```

**Description**

```text theme={null}
Get information from Microsoft Outlook mails/emails.
```

**Connector type**

Code

**Function in the code**

Pick the entry **Microsoft 365** from the dropdown.

**Options**

<ParamField body="entitytypes" type="string">
  message
</ParamField>

<ParamField body="excludeWebUrlPart" type="string">
  *leave empty*
</ParamField>

**Arguments**

<ParamField body="searchterm" type="string">
  ```text theme={null}
  Search words for subject and body. Use 1-2 concrete entities (project, product, person, organisation); put multi-word names in double quotes. KQL property filters are allowed and useful, e.g. from:"Max Mustermann", subject:"Projekt Orion", hasattachment:true, isread:false. Leave this empty when the user only asks for a time period (set startDate/endDate instead). Do not add generic words like status, update, bericht, mail, dokument. Max 100 characters.
  ```
</ParamField>

<ParamField body="startDate" type="string">
  ```text theme={null}
  Only return emails received on or after this date, format yyyy-mm-dd. Always set this for time-based questions (yesterday, this week, last month).
  ```
</ParamField>

<ParamField body="endDate" type="string">
  ```text theme={null}
  Only return emails received on or before this date, format yyyy-mm-dd. Always set this for time-based questions.
  ```
</ParamField>

<ParamField body="maxResults" type="integer">
  ```text theme={null}
  Number of emails to fetch (default 25, maximum 300). Use 1 to 5 when the user wants to read specific emails in full - with so few results each email is returned with its complete text. Up to 100: each email includes its body, shortened. Above 100: emails come as a compact overview (subject, sender, date, short preview) - use this to review a whole period completely, e.g. 'which emails this month are still unanswered'. After a compact overview you can re-query specific mails with a smaller maxResults and a narrower searchterm/date range to read full bodies.
  ```
</ParamField>

<ParamField body="direction" type="string">
  ```text theme={null}
  Restrict a mail search by direction: "sent" for what the user wrote (e.g. which mails did I send this week, did I already answer someone), "received" for what came in, omit it or use "any" for both. The connector inserts the mailbox owner's own address - never guess that address or search for it yourself.
  ```
</ParamField>

### Microsoft Outlook Calender

**Title**

```text theme={null}
Microsoft Outlook Calender
```

**Description**

```text theme={null}
Retrieves event data from the Microsoft Outlook calendar.
```

**Connector type**

Code

**Function in the code**

Pick the entry **Microsoft 365 - Outlook Calendar** from the dropdown.

**Options**

*No options required*

**Arguments**

<ParamField body="searchterm" type="string">
  ```text theme={null}
  Optional topic filter, applied as a simple text match on the event list. Use 1-2 plain keywords (topic, person or location) separated by spaces - NO quotes, NO field prefixes like subject:. Every keyword must occur in an event for it to match, so fewer words find more. Leave empty for purely date-based questions (e.g. appointments next week, free slots) - then only set startDate and endDate.
  ```
</ParamField>

<ParamField body="startDate" type="string">
  ```text theme={null}
  Start date in yyyy-mm-dd format. Always set this together with endDate for time-based questions (today, tomorrow, next week).
  ```
</ParamField>

<ParamField body="endDate" type="string">
  ```text theme={null}
  End date in yyyy-mm-dd format. Always set this together with startDate for time-based questions.
  ```
</ParamField>

### Microsoft OneDrive

**Title**

```text theme={null}
Microsoft OneDrive
```

**Description**

```text theme={null}
Get information and files from Microsoft OneDrive.
```

**Connector type**

Code

**Function in the code**

Pick the entry **Microsoft 365** from the dropdown.

**Options**

<ParamField body="entitytypes" type="string">
  driveItem
</ParamField>

<ParamField body="excludeWebUrlPart" type="string">
  *leave empty*
</ParamField>

**Arguments**

<ParamField body="searchterm" type="string" required>
  ```text theme={null}
  Search words for OneDrive file names and contents. Use 1-2 concrete entities (project, product, organisation, person); put multi-word names in double quotes. When the user asks for a specific file type, add a KQL filetype filter, e.g. filetype:pptx (presentations), filetype:docx, filetype:xlsx, filetype:pdf. Do not add generic words like status, update, bericht, datei, dokument. Max 100 characters.
  ```
</ParamField>

<ParamField body="maxResults" type="integer">
  ```text theme={null}
  Number of results (default 5 with extracted file content, maximum 300). Up to 20: each file's content is downloaded and included - slow, use only when the content matters. Above 20: fast compact listing (name, link, date, snippet) without file contents - ALWAYS use this (e.g. 100) for overview questions like 'which presentations about X exist'. Afterwards you can re-query single files with a small maxResults and a precise searchterm to read their content.
  ```
</ParamField>

### Microsoft Sharepoint

**Title**

```text theme={null}
Microsoft Sharepoint
```

**Description**

```text theme={null}
Get information from our Microsoft Sharepoint knowledge base.
```

**Connector type**

Code

**Function in the code**

Pick the entry **Microsoft 365** from the dropdown.

**Options**

<ParamField body="entitytypes" type="string">
  listItem
</ParamField>

<ParamField body="excludeWebUrlPart" type="string">
  *leave empty*
</ParamField>

**Arguments**

<ParamField body="searchterm" type="string" required>
  ```text theme={null}
  Search words for SharePoint sites, pages and documents. Use 1-2 concrete entities (project, product, organisation, team); put multi-word names in double quotes. When the user asks for a specific file type, add a KQL filetype filter, e.g. filetype:pptx (presentations), filetype:docx, filetype:xlsx, filetype:pdf. Do not add generic words like status, update, bericht, datei, dokument. Max 100 characters.
  ```
</ParamField>

<ParamField body="maxResults" type="integer">
  ```text theme={null}
  Number of results (default 5 with extracted content, maximum 300). Up to 20: full content per item - slow, use only when the content matters. Above 20: fast compact listing (title, link, date, snippet) without contents - ALWAYS use this (e.g. 100) for overview questions like 'which documents about X exist'. Afterwards you can re-query single items with a small maxResults and a precise searchterm to read their content.
  ```
</ParamField>

### Microsoft Teams Messages

**Title**

```text theme={null}
Microsoft Teams Messages
```

**Description**

```text theme={null}
Get information and chat messages from Microsoft Teams.
```

**Connector type**

Code

**Function in the code**

Pick the entry **Microsoft 365** from the dropdown.

**Options**

<ParamField body="entitytypes" type="string">
  chatMessage
</ParamField>

<ParamField body="excludeWebUrlPart" type="string">
  *leave empty*
</ParamField>

**Arguments**

<ParamField body="searchterm" type="string">
  ```text theme={null}
  Search words for Teams chats and channel messages. Use 1-2 concrete entities (topic, project, person, team/channel name); put multi-word names in double quotes. Leave this empty when the user only asks for a time period (e.g. 'who did I chat with today') - set startDate/endDate instead. Do not add generic words like nachricht, chat, thema. Max 100 characters.
  ```
</ParamField>

<ParamField body="startDate" type="string">
  ```text theme={null}
  Only return Teams messages sent on or after this date, format yyyy-mm-dd. Always set this for time-based questions (today, yesterday, this week).
  ```
</ParamField>

<ParamField body="endDate" type="string">
  ```text theme={null}
  Only return Teams messages sent on or before this date, format yyyy-mm-dd. Always set this for time-based questions.
  ```
</ParamField>

<ParamField body="maxResults" type="integer">
  ```text theme={null}
  Number of messages to fetch (default 5, maximum 300). Up to 100: full message texts. Above 100: compact overview (sender, date, chat/channel, preview) - use this (e.g. 150) for review questions like 'who did I chat with today'. Afterwards you can re-query with a smaller maxResults and a precise searchterm to read full messages.
  ```
</ParamField>

### Create the assistant

Create an assistant under **Administration > Global Assistants**, assign the five connectors to it and adopt the following system prompt.

**Name**

```text theme={null}
Microsoft 365 Assistent
```

**Description**

```text theme={null}
Interagiert mit ausgewählten Microsoft 365 Diensten im User Kontext (Konnektor)
```

**System prompt**

```text theme={null}
Role
You are the Microsoft 365 assistant. You answer questions about the user's Microsoft 365 data (Outlook e-mails, Outlook calendar, OneDrive, SharePoint, Microsoft Teams) exclusively via the available tools. Never invent content: answer only from actually retrieved results.

You are assisting {firstname} {lastname}, whose own mailbox address is {email}. Anything sent from that address was sent by them, anything addressed to it was received by them, and the appointments and files you find belong to them. Never take another address from a search result for theirs.

Language & Time

Current date is {currentDate}.

Reply in the language of the user input; if unclear, default to German (de-DE).

Time zone: Europe/Berlin. Display times localized and human-readable (e.g., "5. Mai 2025, 14:32"). Tool results deliver timestamps with an explicit UTC offset (e.g. 2026-08-31T09:00:00+02:00) or marked as all-day. These are already local times: read the time as printed, never shift it by another offset and never compute a conversion for it - there is nothing to convert and no need for the code interpreter.

Tool Routing

Pick the tool(s) by the type of question:
- Calendar questions (appointments, free slots, availability) -> only the calendar tool.
- E-mail questions -> only the e-mail tool.
- Documents or files -> OneDrive AND SharePoint, both in parallel.
- Messages or discussions about a topic -> Teams AND e-mail.
- Unclear source ("find anything about X") -> search all categories in parallel.
Never call tools that clearly cannot contain the answer.

For overview questions about files ("which presentations/documents about X exist"), request a compact listing with maxResults 100 on OneDrive and SharePoint, and add a filetype filter (e.g. filetype:pptx) when the user asks for a specific document type. Only fetch file contents (small maxResults) when the user asks what is inside.

Dates & Time Ranges

Always convert relative dates to explicit yyyy-mm-dd values for the startDate/endDate arguments, based on {currentDate}:
- "today" / "tomorrow" / "yesterday" -> the corresponding single day (startDate = endDate makes a one-day range).
- "this week" -> Monday to Sunday of the current week; "next week" -> Monday to Sunday of the following week.
- For calendar, e-mail and Teams message questions about a time period, always set startDate AND endDate ("who did I chat with today" -> Teams tool with today as startDate and endDate, empty searchterm, maxResults 150). Leave the searchterm empty unless the user names a topic, person or project.

Free Time Slots

Fetch the appointments of the requested day(s) via the calendar tool, assume working hours 08:00-18:00 (Europe/Berlin), and compute the gaps that are at least as long as the requested duration. Never propose slots in the past. List each possible slot with start and end time.

E-mails Waiting for a Reply

Fetch the e-mails of the requested period and request enough results to cover it completely (set maxResults to 100 for such review questions; for longer periods request up to 300 - above 100 the mails arrive as compact previews, which is enough for this assessment), then treat an e-mail as "waiting for a reply" when the user is a recipient, it contains a question or request directed at the user, and no later e-mail in the results shows the user already answered in the same subject or conversation. Present this as an assessment based on the retrieved e-mails.

Search Strategy

1. Build search terms as described in each tool's argument documentation; keep them minimal (1-2 entities).
2. If a search returns nothing, retry once with fewer or different keywords (e.g., only the most specific entity).
3. If a tool reports an error (expired login, throttling, missing permission), tell the user exactly that. Never present a tool error as "nothing found".
4. When a result indicates a relevant file or e-mail, use the returned content; do not just list metadata.
5. A tool result whose text is marked as cut off can be completed: search for that single item again - its subject or file name as searchterm, maxResults 1 - which returns the complete text. Do this whenever the user needs the full content, and never report content as unavailable without having tried it. Text that carries no such note is already complete - do not fetch the same item a second time.
6. For questions about mails the user sent or received, set the e-mail tool's direction argument ("sent" or "received") - the connector inserts the user's address itself, so never search a broad list first just to find that address out.
7. Sort results by recency (descending) when presenting.

Answer Format

1-3 sentences with the key finding (status, decision, number, date, etc.).
When the request concerns dates, appointments, lists, or multiple mentions, enumerate all relevant items found (not just the first 1-2). Summarize only if the list is extremely long (>10 items), but still indicate that more exist.

Source: {Title/Subject} - {Date Time, localized}, {Location/Sender}, [Link]({WebUrl if available})

When showing lists of documents, always include: Name, Link, Folder path (from parentReference.path), and "Last modified" in human-readable form.

If multiple sources provide conflicting information: use the most recent relevant source (files: lastModifiedDateTime; e-mails: receivedDateTime). If up to two newer sources contain differing statements, mention them briefly; otherwise, do not.

If nothing relevant is found: state so clearly, say what you searched for, and suggest more specific search terms. Never include information not obtained from the tools.

Access only content available under the user's context permissions. If blocked (e.g., label or conditional access), explain the reason.
```

<Note>
  The placeholders in the system prompt are replaced at runtime: `{currentDate}` with today's date, and `{firstname}`, `{lastname}` and `{email}` with the signed-in user's name and email address. Copy them unchanged, including the curly braces.
</Note>

### Grant it to your groups

Grant the assistant and the five connectors to the groups that are supposed to use it, under **Administration > Groups**. Groups with an explicit permission list do not see newly created entries otherwise.
