@chrischall/microsoft-teams-mcp 0.14.0 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +248 -37
- package/dist/attachments.js +238 -0
- package/dist/auth-fetchproxy.js +7 -6
- package/dist/browser-open.js +159 -0
- package/dist/bundle.js +6849 -3949
- package/dist/capture-feedback.js +283 -0
- package/dist/chatsvc.js +132 -7
- package/dist/compose.js +9 -1
- package/dist/file-upload.js +335 -0
- package/dist/index.js +11 -1
- package/dist/model.js +1 -0
- package/dist/presence.js +120 -0
- package/dist/profile.js +182 -0
- package/dist/recap-auth.js +6 -4
- package/dist/recap.js +3 -1
- package/dist/sender-email.js +147 -0
- package/dist/sharepoint-auth.js +42 -21
- package/dist/sharepoint.js +150 -3
- package/dist/substrate-auth.js +8 -7
- package/dist/substrate.js +98 -4
- package/dist/tools/attach.js +167 -0
- package/dist/tools/attachment.js +3 -1
- package/dist/tools/conversation.js +14 -5
- package/dist/tools/edit.js +42 -14
- package/dist/tools/errors.js +10 -11
- package/dist/tools/export.js +30 -3
- package/dist/tools/format.js +29 -6
- package/dist/tools/group-chat.js +349 -33
- package/dist/tools/healthcheck.js +23 -9
- package/dist/tools/mention-check.js +225 -0
- package/dist/tools/people.js +149 -39
- package/dist/tools/profile.js +67 -0
- package/dist/tools/send.js +134 -37
- package/dist/tools/sender-email-arg.js +37 -0
- package/dist/tools/token-status.js +97 -0
- package/dist/tools/unread.js +3 -2
- package/dist/tools/upload-slots.js +51 -0
- package/dist/version.js +1 -1
- package/mint.yaml +26 -0
- package/package.json +4 -1
- package/server.json +37 -2
- package/skills/teams-fpx/SKILL.md +2 -2
- package/skills/teams-fpx/references/teams-env.sh +1 -1
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"metadata": {
|
|
9
9
|
"description": "MCP server for Microsoft Teams — read any chat or channel, your unread messages, and their attachments, and send messages and reactions (each confirmed first)",
|
|
10
|
-
"version": "0.
|
|
10
|
+
"version": "0.15.1"
|
|
11
11
|
},
|
|
12
12
|
"plugins": [
|
|
13
13
|
{
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"displayName": "Microsoft Teams",
|
|
16
16
|
"source": "./",
|
|
17
17
|
"description": "MCP server for Microsoft Teams — read any chat or channel, your unread messages, and their attachments, and send messages and reactions (each confirmed first), via your signed-in browser session",
|
|
18
|
-
"version": "0.
|
|
18
|
+
"version": "0.15.1",
|
|
19
19
|
"author": {
|
|
20
20
|
"name": "Chris Hall"
|
|
21
21
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "microsoft-teams-mcp",
|
|
3
3
|
"displayName": "Microsoft Teams",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.15.1",
|
|
5
5
|
"description": "Microsoft Teams for Claude — read any chat or channel, your unread messages, and their attachments, and send messages and reactions (each confirmed first), using your signed-in browser session",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Chris Hall",
|
package/README.md
CHANGED
|
@@ -26,6 +26,43 @@ them can be read by id or name, and listing covers every chat, not just the
|
|
|
26
26
|
ones the sidebar shows. To capture a token, an idle tab is not enough: click
|
|
27
27
|
into any chat so Teams calls its chat service.
|
|
28
28
|
|
|
29
|
+
### Token capture timing (read this if a call says it could not get a token)
|
|
30
|
+
|
|
31
|
+
A capture reads the header off the **next** matching request the Teams page
|
|
32
|
+
makes **while the capture is waiting** — the bridge has no "recently seen"
|
|
33
|
+
request to fall back on. So clicking into a chat *before* a call starts never
|
|
34
|
+
counts: the click has to land within the capture window (`TEAMS_CAPTURE_TIMEOUT`,
|
|
35
|
+
default 30 s) **after** the call starts. Every capture error says exactly that,
|
|
36
|
+
with the real window length, and names the step that failed with a stable code:
|
|
37
|
+
|
|
38
|
+
| Code | Step that failed | Next step |
|
|
39
|
+
| --- | --- | --- |
|
|
40
|
+
| `token_bridge_not_approved` | The ContextMint Bridge has not approved this server (or this capture) yet | Approve `microsoft-teams-mcp` in the extension popup, then retry |
|
|
41
|
+
| `token_bridge_unreachable` | No browser with the bridge extension is connected | Open that browser and check the extension is connected, then retry |
|
|
42
|
+
| `token_no_tab` | The bridge found no signed-in Teams tab | Open and sign in to `teams.cloud.microsoft`, then retry and click into a chat while it waits |
|
|
43
|
+
| `token_no_request_seen` | The window closed with no matching request (the bridge cannot tell an idle tab from a missing one); the error says how long it waited and when the previous token expired | Retry, and within the window click into any chat (search token: run a search in the Teams search box) |
|
|
44
|
+
| `token_token_rejected` | A freshly captured token was still refused | Reload the Teams tab (sign in again if asked), then retry and click while it waits |
|
|
45
|
+
| `token_capture_failed` | Anything else (e.g. a header too short to be a token) | As the message says |
|
|
46
|
+
|
|
47
|
+
Three things make the window easier to hit:
|
|
48
|
+
|
|
49
|
+
- **Progress while waiting.** When the client asked for progress (claude.ai
|
|
50
|
+
sends a `progressToken`), a capture reports "Waiting for the Teams tab: click
|
|
51
|
+
into any chat now (25s left)" every 5 s, so a client that shows progress gives
|
|
52
|
+
you the chance to act in time.
|
|
53
|
+
- **A Teams tab opened for you (local installs).** On a local install, as a
|
|
54
|
+
chat-service capture starts the server opens `https://teams.cloud.microsoft/`
|
|
55
|
+
in your default browser (or the one `TEAMS_BROWSER` names — set it to the
|
|
56
|
+
browser the bridge runs in, e.g. `Microsoft Edge`); a loading Teams page lists
|
|
57
|
+
its chats through the chat service at once, inside the window, with no click
|
|
58
|
+
needed. At most one tab per 10 minutes; `TEAMS_OPEN_TEAMS_TAB=false` turns it
|
|
59
|
+
off. Never on a hosted install (the browser is not on the server's machine),
|
|
60
|
+
and not for the search token (only a search you run makes that request).
|
|
61
|
+
- **`teams_token_status`.** Reports which tokens are held and until when without
|
|
62
|
+
touching the browser — check it before a write. With `wait: true` it primes a
|
|
63
|
+
token that is not held, waiting up to 120 s: start it, then click into a chat
|
|
64
|
+
(or, with `token: "substrate"`, run a search in the Teams search box).
|
|
65
|
+
|
|
29
66
|
**The Activity feed comes from the same API.** It is a chat-service
|
|
30
67
|
conversation of its own (`48:notifications`), so `teams_list_activity` reads
|
|
31
68
|
it like any chat — no Activity view (or any view) needs to be open, and
|
|
@@ -120,10 +157,15 @@ read only from the request header, never from page storage.
|
|
|
120
157
|
|
|
121
158
|
- **No separate pairing.** Search is part of the one bridge scope every capture
|
|
122
159
|
declares (see [Pairing](#pairing)), so the pairing that reads chats covers it.
|
|
123
|
-
- **Run a search in Teams once.** The token is read off
|
|
124
|
-
search request, so the first search may need you to type
|
|
125
|
-
Teams search box and press Enter
|
|
126
|
-
(`TEAMS_CAPTURE_TIMEOUT`, default 30s)
|
|
160
|
+
- **Run a search in Teams once — while the call waits.** The token is read off
|
|
161
|
+
the Teams tab's own search request, so the first search may need you to type
|
|
162
|
+
anything into the Teams search box and press Enter **after** the call starts
|
|
163
|
+
and within the capture window (`TEAMS_CAPTURE_TIMEOUT`, default 30s); a search
|
|
164
|
+
run before the call does not count. `teams_token_status` with `wait: true`
|
|
165
|
+
and `token: "substrate"` primes it with a 120 s window instead. The token
|
|
166
|
+
(about 1.4 hours) is cached with its expiry in
|
|
167
|
+
`~/.microsoft-teams-mcp/substrate-token.json` and reused — across restarts —
|
|
168
|
+
until it is within 5 minutes of expiring.
|
|
127
169
|
- **It falls back to scanning.** In the default `mode: "auto"`, when no Substrate
|
|
128
170
|
token can be captured or the search fails, the tool scans recent conversations
|
|
129
171
|
instead (`source: "scan"`, with a `fallback_reason`), and does not wait on
|
|
@@ -135,7 +177,18 @@ read only from the request header, never from page storage.
|
|
|
135
177
|
organisation's directory (Substrate's people suggestions) when a name is not
|
|
136
178
|
in your chats, or when you pass an email address. A lookup is an explicit
|
|
137
179
|
request, so it always tries a fresh capture rather than honouring the
|
|
138
|
-
10-minute cooldown below.
|
|
180
|
+
10-minute cooldown below. `teams_get_profile` reads the profile card from the
|
|
181
|
+
same people suggestions (job title, department, office, company, chat
|
|
182
|
+
address; city and manager when the directory includes them) — Teams' own
|
|
183
|
+
card reads its extended fields from the Loki/Delve profile service, which
|
|
184
|
+
would need another token on another host and a re-pair, so this server does
|
|
185
|
+
not. `sender_email` on `teams_list_messages` / `teams_export_messages` uses
|
|
186
|
+
the same lookup.
|
|
187
|
+
- **Presence is best-effort.** `teams_get_profile`'s `include_presence` asks
|
|
188
|
+
the presence service behind the Teams host
|
|
189
|
+
(`teams.cloud.microsoft/ups/<TEAMS_CHATSVC_REGION>/v1/presence/getpresence/`)
|
|
190
|
+
with the chat-service token — no new token or pairing. If that token is not
|
|
191
|
+
accepted there, the lookup still returns the cards with a `presence_error`.
|
|
139
192
|
- **It does not re-capture in a loop.** If a freshly captured token is still
|
|
140
193
|
refused (401), the same 10-minute cooldown applies, so `auto` goes straight
|
|
141
194
|
to the scan instead of waiting on the bridge every call.
|
|
@@ -195,10 +248,11 @@ npm i -g @chrischall/microsoft-teams-mcp
|
|
|
195
248
|
Requires the **ContextMint Bridge** browser extension and `@fetchproxy/cli`,
|
|
196
249
|
on a matching major version. Install the bridge from
|
|
197
250
|
[its releases page](https://github.com/nullnet-app/contextmint-bridge/releases):
|
|
198
|
-
in Chrome, unzip the chrome zip and load it
|
|
199
|
-
(`chrome://extensions` → Developer mode → Load
|
|
200
|
-
available yet (it will ship inside the ContextMint app,
|
|
201
|
-
download)
|
|
251
|
+
in Chrome, Edge or another Chromium browser, unzip the chrome zip and load it
|
|
252
|
+
unpacked (`chrome://extensions` or `edge://extensions` → Developer mode → Load
|
|
253
|
+
unpacked). Safari isn't available yet (it will ship inside the ContextMint app,
|
|
254
|
+
which has no public download). If the bridge's browser is not your default
|
|
255
|
+
browser, set `TEAMS_BROWSER` to it so the tabs this server opens land there.
|
|
202
256
|
|
|
203
257
|
ContextMint Bridge is the fetchproxy browser extension under its new name,
|
|
204
258
|
from the same maintainer — fetchproxy's own README
|
|
@@ -244,6 +298,11 @@ Everything is optional — by default the token is captured from your browser.
|
|
|
244
298
|
| `TEAMS_CHATSVC_BASE` | Full override for the API base (default `https://teams.cloud.microsoft/api/chatsvc/<region>/v1`). |
|
|
245
299
|
| `TEAMS_CAPTURE_TIMEOUT` | Seconds to wait for the Teams tab to issue a chat-service request. Defaults to `30`. The bridge deadline is derived from it (window + 15s). |
|
|
246
300
|
| `TEAMS_TOKEN_CACHE` | `false` to keep the captured token in memory only. Defaults to on. |
|
|
301
|
+
| `TEAMS_OPEN_TEAMS_TAB` | `false` to never open the Teams web app in a browser tab when a chat-service token capture starts. Defaults to on for a local install: a capture only sees a request the Teams page makes while it waits, and a freshly loading Teams tab makes one at once, so `https://teams.cloud.microsoft/` opens in your default browser (or `TEAMS_BROWSER`) at most once per 10 minutes. Never on a hosted install. |
|
|
302
|
+
| `TEAMS_OPEN_SIGNIN_TAB` | `false` to never open a shared file's link in a browser tab. Defaults to on: when a shared SharePoint file is on a host the browser has no session for (it gets SharePoint's sign-in page), the file's link opens once per host in your default browser (or `TEAMS_BROWSER`) so the browser signs in there, and the download is retried for up to 30s. The tab is left open. Local installs only. |
|
|
303
|
+
| `TEAMS_BROWSER` | The browser those tabs open in: the one the ContextMint Bridge runs in, when it is not your default browser (e.g. Edge at work). On macOS an app name (`Microsoft Edge`, `Google Chrome`); on Windows/Linux the browser's executable (full path, or a name on `PATH` such as `microsoft-edge`). Unset: the system default browser. Local installs only. |
|
|
304
|
+
| `TEAMS_UPLOAD_DIRS` | Folders (separated by `:`; `;` on Windows) that `attachments` may read local files from. Defaults to your home folder. Hidden files and folders, directories and symlinks are refused either way. Local installs only. |
|
|
305
|
+
| `TEAMS_ONEDRIVE_HOST` | Your OneDrive host (e.g. `contoso-my.sharepoint.com`), where files attached in a chat are uploaded. Defaults to the OneDrive host of a SharePoint host the server already knows (one a shared file was fetched from); set it if a send says it cannot tell which OneDrive to use. |
|
|
247
306
|
| `TEAMS_TOKEN_FILE` | Where the captured token is cached. Defaults to `~/.microsoft-teams-mcp/token.json`. |
|
|
248
307
|
| `TEAMS_RECAP_TOKEN_FILE` | Where the captured meeting-recap token is cached. Defaults to `~/.microsoft-teams-mcp/recap-token.json`. `TEAMS_TOKEN_CACHE=false` keeps it in memory too. |
|
|
249
308
|
| `TEAMS_MCPS_REGION` | The region in the meeting-recap API path (`teams.cloud.microsoft/api/mcps/<region>`). Defaults to `us`. |
|
|
@@ -322,8 +381,13 @@ Everything is optional — by default the token is captured from your browser.
|
|
|
322
381
|
`teams_list_conversations`) and
|
|
323
382
|
`limit` (default 50, max 500).
|
|
324
383
|
- `teams_list_messages` — read any chat or channel by id or name,
|
|
325
|
-
oldest first: sender,
|
|
326
|
-
|
|
384
|
+
oldest first: sender, `senderMri` (the sender's MRI, `8:orgid:…` — pass it
|
|
385
|
+
to `teams_get_profile`), time (UTC, ISO 8601), text, subject, edited/deleted
|
|
386
|
+
flags and attachments. `sender_email: true` (full format only) also adds
|
|
387
|
+
`senderEmail`, looked up in your organisation's directory once per sender
|
|
388
|
+
(by that exact MRI, never a namesake) and cached in memory for an hour; a
|
|
389
|
+
sender the directory does not list gets none, and if the directory cannot be
|
|
390
|
+
asked, `sender_email_error` says why while the messages still come back. A formatted message also carries `content_html` —
|
|
327
391
|
its body as sanitised HTML (bold, italic, lists, links, code, quotes,
|
|
328
392
|
headings, tables and @mention spans; every other tag and attribute
|
|
329
393
|
dropped) — and any message with them carries `mentions`
|
|
@@ -331,11 +395,19 @@ Everything is optional — by default the token is captured from your browser.
|
|
|
331
395
|
(`[{href, text}]`, each link with the text it was shown as). A plain
|
|
332
396
|
message has none of the three: its `text` says everything. In `text` a
|
|
333
397
|
numbered list keeps its numbers (`1. `, `2. `) and a bulleted one its `- `.
|
|
334
|
-
A channel comes back as threads (root post + replies)
|
|
398
|
+
A channel comes back as threads (root post + replies) AND, in `full` and
|
|
399
|
+
`compact`, as a flat `messages` list — roots and replies in time order,
|
|
400
|
+
each with `thread_root_id` (a root's own id) — so reading `messages` works
|
|
401
|
+
the same for a chat and a channel. Every result has `message_count` (the
|
|
402
|
+
messages read); a window with nothing in it says `message_count: 0` and
|
|
403
|
+
`messages: []`, never an absent key. A channel read with `since` and
|
|
404
|
+
`format: "compact"` looks like
|
|
405
|
+
`{ conversation, unread_count, message_count: 4, messages: [{ id, time, sender, text, thread_root_id }, …], threads: [{ root, replies }, …], next_cursor, … }`.
|
|
335
406
|
A thread whose root post is older than the window (a reply came in after
|
|
336
407
|
`since`, `limit` or `after_message_id` cut the read) still shows its root:
|
|
337
|
-
it is fetched by id and marked `outside_window: true` — context only
|
|
338
|
-
|
|
408
|
+
it is fetched by id and marked `outside_window: true` — context only: in
|
|
409
|
+
`threads` but not in the flat `messages`, not counted in `unread_count` or
|
|
410
|
+
`message_count` and never the `next_cursor`.
|
|
339
411
|
Up to 25 roots are fetched per call (shared by every conversation it
|
|
340
412
|
reads, newest threads first); one past that, or one that cannot be
|
|
341
413
|
fetched, is `{ id, missing: true }`.
|
|
@@ -399,7 +471,10 @@ Everything is optional — by default the token is captured from your browser.
|
|
|
399
471
|
- `teams_list_unread_messages` — every unread message across your chats and channels,
|
|
400
472
|
grouped by conversation, most recent first (or, with `from`, one
|
|
401
473
|
oldest-first list across them all — see
|
|
402
|
-
[Paging from a time](#paging-from-a-time)).
|
|
474
|
+
[Paging from a time](#paging-from-a-time)). Each conversation carries
|
|
475
|
+
`message_count` and, like `teams_list_messages`, a channel's unread posts
|
|
476
|
+
both flat (`messages`, each with `thread_root_id`) and as `threads`.
|
|
477
|
+
Filter by `kinds` (`chat`,
|
|
403
478
|
`channel`, `meeting`, `oneOnOne`) or `query` (title, channel or team
|
|
404
479
|
name, an untitled chat's participant name, or the last-message preview —
|
|
405
480
|
each conversation then carries `match_reason`, as in `teams_list_conversations`);
|
|
@@ -530,7 +605,10 @@ Everything is optional — by default the token is captured from your browser.
|
|
|
530
605
|
every SharePoint host, so the first download may need
|
|
531
606
|
[your Teams tab reloaded](#sharepoint-file-download) to capture it; a
|
|
532
607
|
file your account cannot open, or one that could not be fetched, comes back as
|
|
533
|
-
metadata and its open link instead of failing.
|
|
608
|
+
metadata and its open link instead of failing. On a local install, a file on
|
|
609
|
+
a SharePoint host the browser has not signed in to yet opens its link in a
|
|
610
|
+
browser tab — the default browser, or `TEAMS_BROWSER` — (once per host; the tab is left open, `TEAMS_OPEN_SIGNIN_TAB=false`
|
|
611
|
+
turns it off) and the download is retried. The caption names the
|
|
534
612
|
conversation beside its id (`title`, plus `participants` for an untitled
|
|
535
613
|
chat), titled as `teams_list_conversations` titles it.
|
|
536
614
|
|
|
@@ -591,6 +669,20 @@ Everything is optional — by default the token is captured from your browser.
|
|
|
591
669
|
the whole series, e.g. files shared across it) and `other_occurrences`
|
|
592
670
|
(other call days, newest first). Uses its own token (see
|
|
593
671
|
[Meeting recaps](#meeting-recaps)). Read-only.
|
|
672
|
+
- `teams_get_profile` — a colleague's profile card, as Teams shows it:
|
|
673
|
+
`displayName`, `mri`, `email`, `chatAddress`, `jobTitle`, `department`,
|
|
674
|
+
`officeLocation`, `city`, `company` and `manager` (each absent when the
|
|
675
|
+
directory does not say). `person` is an email address, a chat address (UPN),
|
|
676
|
+
an MRI or a name (`"Last, First"` or `"First Last"`), or an array of up to 50.
|
|
677
|
+
The result is `{ profiles: [...] }`, one per person in order, each with
|
|
678
|
+
`status` `found` (+ `profile`), `ambiguous` (+ `candidates`, up to 10 cards —
|
|
679
|
+
a name several people share is never guessed; pass one's email or MRI),
|
|
680
|
+
`not_found` or `error` (+ `hint`). `include_presence: true` also returns
|
|
681
|
+
`presence: [{ mri, availability, activity, lastSeen, timeZone, localTime }]`
|
|
682
|
+
for the people found — beside the cards, fetched only when asked, never
|
|
683
|
+
stored; if presence cannot be read, `presence_error` says why and the cards
|
|
684
|
+
still come back. Uses the directory token (see
|
|
685
|
+
[Substrate search](#substrate-search)). Read-only.
|
|
594
686
|
- `teams_get_transcript` — the transcript of a recorded Teams meeting, read from
|
|
595
687
|
its meeting chat (`conversation`: the chat's id or a substring of its title).
|
|
596
688
|
It reads **Teams' own copy** of the transcript — the one the meeting's Recap
|
|
@@ -621,7 +713,10 @@ Everything is optional — by default the token is captured from your browser.
|
|
|
621
713
|
conversation, and a note that the content is untrusted third-party text),
|
|
622
714
|
then one record per message, oldest first, each carrying its conversation's
|
|
623
715
|
`id`, `kind`, `title`, `team` (channels) and `participants` (chats: the
|
|
624
|
-
people seen writing, other than you)
|
|
716
|
+
people seen writing, other than you), the sender's `senderMri` (and, with
|
|
717
|
+
`sender_email: true`, `senderEmail`, looked up as for `teams_list_messages`;
|
|
718
|
+
jsonl only — `sender_email` with `format: "markdown"` is refused)
|
|
719
|
+
and the message's `content_html`,
|
|
625
720
|
`mentions` and `links` when it has them — or `format: "markdown"` for readable
|
|
626
721
|
transcripts, channels threaded under their root posts, a formatted message
|
|
627
722
|
rendered as Markdown (bold, italic, lists, links with their text, code,
|
|
@@ -662,6 +757,16 @@ Everything is optional — by default the token is captured from your browser.
|
|
|
662
757
|
large — is listed with `skipped` and the reason instead, and never fails the
|
|
663
758
|
export (`counts.attachments` / `counts.attachments_skipped`). Never marks
|
|
664
759
|
anything read.
|
|
760
|
+
- `teams_token_status` — whether the chat-service and Substrate (search /
|
|
761
|
+
directory) tokens are held, where (`memory`, `disk cache`,
|
|
762
|
+
`TEAMS_ACCESS_TOKEN`), `expires_at` and `minutes_remaining`, and the last
|
|
763
|
+
capture (with its `token_*` code when it failed) — without touching the
|
|
764
|
+
browser, so it is the check to run before a write. `wait: true` primes one
|
|
765
|
+
token (`token`, default `chat_service`) when it is not held, waiting up to
|
|
766
|
+
`wait_seconds` (default and maximum 120) and reporting progress: start it,
|
|
767
|
+
then click into a chat (or run a search, for `substrate`). A failed prime is
|
|
768
|
+
reported in the result (`error`, `next_step`), not as a tool error. Never
|
|
769
|
+
returns a token.
|
|
665
770
|
- `teams_healthcheck` — resolves the token the way every tool does
|
|
666
771
|
(capturing one on a cold start) and probes the chat service with one
|
|
667
772
|
conversations listing. Reports where the token came from and when it
|
|
@@ -698,18 +803,83 @@ Everything is optional — by default the token is captured from your browser.
|
|
|
698
803
|
`warning` saying what it does (a thread reply in a channel, a quote in a
|
|
699
804
|
chat). The fenced details of the quoted message are in `quoted_message`.
|
|
700
805
|
`mentions`
|
|
701
|
-
@-mentions people by MRI
|
|
806
|
+
@-mentions people by MRI (a bare Entra object id is taken as
|
|
807
|
+
`8:orgid:<id>`) or by a display name matched among the
|
|
702
808
|
conversation's recent senders (an ambiguous name is refused with the
|
|
703
|
-
candidates).
|
|
809
|
+
candidates). To mention a channel, pass the channel's id
|
|
810
|
+
(`19:…@thread.tacv2`) or its exact name as `person` — the channel being
|
|
811
|
+
posted to, or its team (by its team thread id or name); that produces the
|
|
812
|
+
mention Teams stores when you type @ChannelName. The preview checks the
|
|
813
|
+
mentions, best-effort and without a lookup per mention:
|
|
814
|
+
- `unmatched_mentions` (with `mention_warning`), shown above the text:
|
|
815
|
+
each "@name" in the text that no mention covers — it goes out as plain
|
|
816
|
+
text and notifies nobody. It is a warning; confirming still sends. An
|
|
817
|
+
"@" counts when it starts a word and a letter follows (so `a@b.com` and
|
|
818
|
+
`@3pm` do not), outside URLs and code; the name is the longest known
|
|
819
|
+
display name (recent senders, the mentions, the channel and team) the
|
|
820
|
+
text continues with, else one word (letters/digits joined by `.` or
|
|
821
|
+
`-`). "Hi @Platform Ops team and @Alice" with only Alice mentioned, in
|
|
822
|
+
the Platform Ops channel, gives `["@Platform Ops"]`; elsewhere
|
|
823
|
+
`["@Platform"]`.
|
|
824
|
+
- `mentions_summary`, one line: `Mentions: "Alice Example", "Platform Ops" (channel)`.
|
|
825
|
+
- per mention: `mention_type` (`person`, `channel` or `team`), the resolved
|
|
826
|
+
display `name` when known, the `mri`, and for a person `in_conversation`
|
|
827
|
+
— `true`/`false` from a chat's member list (a 1:1 from its id), or
|
|
828
|
+
`"unknown"` when it cannot be read; in a channel only someone who posted
|
|
829
|
+
lately is known to be in it, anyone else is `"unknown"`. Emails are not
|
|
830
|
+
looked up.
|
|
831
|
+
- `mention_notes` when a person is not a member of the chat, or a
|
|
832
|
+
channel mention names a different channel than the one posted to.
|
|
833
|
+
The result says whether the post was found again by reading
|
|
704
834
|
the conversation back (`verified`).
|
|
835
|
+
A `conversation` that is exactly a person's name (`First Last` or
|
|
836
|
+
`Last, First`, any case) goes to your 1:1 with them even when group chats
|
|
837
|
+
or channels also match it; the preview's and result's `conversation`
|
|
838
|
+
lists those other matches as `other_matches`, so the choice is visible. A
|
|
839
|
+
partial name, or one matching no single 1:1, is still refused with the
|
|
840
|
+
candidates.
|
|
841
|
+
`attachments` sends files with the message — up to 10, each at most
|
|
842
|
+
100 MiB, any type — and `text` may then be left out. Each item is exactly
|
|
843
|
+
one of `{ path }` (a local file: absolute or `~/…`, inside your home
|
|
844
|
+
folder or a `TEAMS_UPLOAD_DIRS` folder; directories, hidden files and
|
|
845
|
+
symlinks are refused; refused on the hosted connector), `{ blobKey }`
|
|
846
|
+
(the hosted connector: from `teams_upload_slots`) or `{ inline:
|
|
847
|
+
{ filename, contentBase64, mimeType? } }` (small files), each with an
|
|
848
|
+
optional `name` to show. In a chat the files go to your OneDrive's
|
|
849
|
+
"Microsoft Teams Chat Files" folder (the one Teams uses), shared with the
|
|
850
|
+
chat's members (view access, no email); in the self-chat they are shared
|
|
851
|
+
with no one. In a channel they go to the channel's folder of the team's
|
|
852
|
+
SharePoint "Shared Documents" — refused, before anything is uploaded,
|
|
853
|
+
when the channel's details do not name the team's site. They are posted
|
|
854
|
+
as file cards, as the Teams client does. The preview lists each file's
|
|
855
|
+
name, size, type, SHA-256, where it goes and who gets access; nothing is
|
|
856
|
+
uploaded until you confirm, and a file that changed since the preview is
|
|
857
|
+
refused. A file over the limit is refused before anything is sent; files
|
|
858
|
+
over 4 MiB go up through an upload session. An upload or share that fails
|
|
859
|
+
stops the send — the message is never posted without its files — and the
|
|
860
|
+
error names the permission SharePoint wanted (and any file already
|
|
861
|
+
uploaded). The result gives the message id and each file's name, size and
|
|
862
|
+
link. Verified live (2026-12-01) in the self-chat and a 1:1 chat: the
|
|
863
|
+
OneDrive upload (single request and upload session), sharing with the
|
|
864
|
+
other member, and the file cards. Channel attachments are not yet verified
|
|
865
|
+
live (`scripts/manual-send-attachment.mjs` exercises `48:notes`).
|
|
705
866
|
- `teams_edit_message` — replace the text of one of your own messages:
|
|
706
867
|
`conversation`, `message_id` (one you sent — someone else's, a deleted
|
|
707
868
|
message or a system event is refused before any preview), `text`, and
|
|
708
|
-
`format` / `mentions` as for `teams_send_message
|
|
869
|
+
`format` / `mentions` as for `teams_send_message` (the preview checks the
|
|
870
|
+
mentions the same way: `unmatched_mentions`, `mentions_summary`,
|
|
871
|
+
`mention_notes`). A quote-reply keeps its
|
|
709
872
|
quote. The preview shows the current text, the new text and the exact HTML
|
|
710
873
|
that will replace it; text that renders exactly as the message already
|
|
711
874
|
does, mentioning the same people, changes nothing (`status: "unchanged"`). The message is read back to
|
|
712
|
-
verify the edit (`verified`).
|
|
875
|
+
verify the edit (`verified`). `attachments` (as for `teams_send_message`)
|
|
876
|
+
adds files to the message, beside any it already carries.
|
|
877
|
+
- `teams_upload_slots` — the hosted connector's way to attach a file: for
|
|
878
|
+
each `{ filename, mimeType? }` it returns a signed `uploadUrl` (and a
|
|
879
|
+
ready `curl`) to PUT the file to, and a `blobKey` to pass as an attachment
|
|
880
|
+
to `teams_send_message` / `teams_edit_message`. The upload is deleted once
|
|
881
|
+
the message is sent. Writes nothing to Teams; refused on a local install
|
|
882
|
+
(pass `path` there).
|
|
713
883
|
- `teams_delete_message` — delete one of your own messages: `conversation`
|
|
714
884
|
and `message_id` (one you sent — someone else's or a system event is
|
|
715
885
|
refused before any preview). One already deleted is reported as
|
|
@@ -751,17 +921,30 @@ Everything is optional — by default the token is captured from your browser.
|
|
|
751
921
|
several exact matches, several suggestions, a partial word, nothing —
|
|
752
922
|
refuses, listing the candidates with their email and MRI.
|
|
753
923
|
|
|
924
|
+
People are resolved in this order, and nothing is guessed: **(a)** an MRI or
|
|
925
|
+
bare Entra object id, as given; **(b)** a name among the people in your
|
|
926
|
+
chats; **(c)** `ids` — an optional map from a `people` entry (a name or an
|
|
927
|
+
email) to an MRI or Entra object id you looked up elsewhere, e.g. in the
|
|
928
|
+
Outlook MCP's people list (one that names someone other than the chat match
|
|
929
|
+
is refused); **(d)** only then the directory.
|
|
930
|
+
|
|
754
931
|
The directory is Substrate's people suggestions
|
|
755
932
|
(`POST https://substrate.office.com/search/api/v1/suggestions`), reached
|
|
756
933
|
with the [Substrate token](#substrate-search) search already captures — no
|
|
757
|
-
new token or bridge scope, but
|
|
758
|
-
search in the Teams search box
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
934
|
+
new token or bridge scope, but if that token is not held the lookup needs
|
|
935
|
+
you to run a search in the Teams search box **while the call waits** (see
|
|
936
|
+
[Token capture timing](#token-capture-timing-read-this-if-a-call-says-it-could-not-get-a-token)).
|
|
937
|
+
Passing an Entra object id, or `ids`, needs no directory at all. Only people
|
|
938
|
+
in your organisation are found there (not distribution lists or personal
|
|
939
|
+
contacts). The directory is asked once per distinct name, and not again in
|
|
940
|
+
the same call after its token could not be captured. When anyone does not
|
|
941
|
+
resolve, the whole call is refused with one error that names each failure
|
|
942
|
+
with a stable code (`person_ambiguous`, `person_not_found`,
|
|
943
|
+
`person_conflict`, `caller_id_invalid`, `directory_unavailable` — which
|
|
944
|
+
also carries the capture's `token_*` code and how long it waited —
|
|
945
|
+
`person_not_checked`; `people_unresolved` when several failed) and lists
|
|
946
|
+
who **did** resolve. The preview lists everyone with their `source` (`id`,
|
|
947
|
+
`chat`, `caller` or `directory`) and, for a directory hit, their `email`, so you can see
|
|
765
948
|
exactly who will be added. People already in the chat are reported as
|
|
766
949
|
`already_member` and not written (if everyone is, nothing is asked). Teams
|
|
767
950
|
posts a notice in the chat for each person added. The chat is read back,
|
|
@@ -783,14 +966,42 @@ Everything is optional — by default the token is captured from your browser.
|
|
|
783
966
|
person is a 1:1, which this tool does not create. Sent as one
|
|
784
967
|
`POST /threads` with everyone as a member (Teams makes every group-chat
|
|
785
968
|
member an Admin). Everyone added sees the new chat at once, and **it
|
|
786
|
-
cannot be deleted afterwards** — only left.
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
969
|
+
cannot be deleted afterwards** — only left. The chat is read back and the
|
|
970
|
+
result is `created` with the new `conversation` (id, title, kind `group`),
|
|
971
|
+
the `members` and `verified` (everyone and the topic shown). It is not
|
|
972
|
+
idempotent: `status: "unknown"` means Teams did not confirm the create —
|
|
973
|
+
check `teams_list_conversations` before retrying, since a blind retry makes
|
|
974
|
+
a second chat.
|
|
975
|
+
|
|
976
|
+
**First message, in the same action.** An optional `message` (with
|
|
977
|
+
`format` `text`|`markdown` and `mentions`, as for `teams_send_message`) is
|
|
978
|
+
posted right after the chat is created, to the conversation id Teams
|
|
979
|
+
returned — never looked up by name. Each mention's `person` must be one of
|
|
980
|
+
the new chat's members, by display name (or the `people` entry that named
|
|
981
|
+
them) or MRI; one matching no member (`mention_no_member`) or several
|
|
982
|
+
(`mention_ambiguous`) is refused before any preview. There is one
|
|
983
|
+
confirmation for both steps, and its token is bound to the members, the
|
|
984
|
+
topic and the exact rendered message — changing any of them needs a new
|
|
985
|
+
preview. The preview shows the members, the topic and `first_message`:
|
|
986
|
+
the text, the format, `rendered_html` (exactly what is posted) and each
|
|
987
|
+
mention with the member it resolved to — and, above the text,
|
|
988
|
+
`mentions_summary` plus `unmatched_mentions` / `mention_warning` for any
|
|
989
|
+
`@name` no mention covers (a warning, not a refusal), as for
|
|
990
|
+
`teams_send_message`. The result adds `message`:
|
|
991
|
+
`{status: "sent", message_id, verified}` (verified = found again by its
|
|
992
|
+
`clientmessageid`). If the chat was created but the message failed, the
|
|
993
|
+
result is `status: "partial"` with the `conversation` id, `message:
|
|
994
|
+
{status: "failed", error}` (or `"unknown"` when Teams did not confirm the
|
|
995
|
+
post — check `teams_list_messages` first) and a ready `retry`
|
|
996
|
+
(`teams_send_message` to that id, mentions by MRI). Never retry by calling
|
|
997
|
+
`teams_create_group_chat` again; if it is called again anyway with the
|
|
998
|
+
same people and topic (with a message — the message itself may differ),
|
|
999
|
+
the server remembers the chat it made (in memory, for a day) and only
|
|
1000
|
+
sends that call's message to it — the preview says the chat was already
|
|
1001
|
+
created and shows the message that would go. When the create itself is unconfirmed (`unknown`),
|
|
1002
|
+
nothing is sent (`message: {status: "not_sent"}`). Without `message` the
|
|
1003
|
+
tool behaves exactly as before. Because a posted message cannot be
|
|
1004
|
+
recalled, the tool is annotated destructive, like `teams_send_message`.
|
|
794
1005
|
|
|
795
1006
|
`teams_list_messages` and `teams_list_unread_messages` also write when — and only
|
|
796
1007
|
when — you pass `mark_read: true` (see above). Every other tool is
|