@chrischall/microsoft-teams-mcp 0.13.1 → 0.15.0
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 +241 -33
- package/dist/attachments.js +238 -0
- package/dist/auth-fetchproxy.js +42 -7
- package/dist/bridge-scope.js +45 -8
- package/dist/browser-open.js +138 -0
- package/dist/bundle.js +28684 -30653
- 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 +196 -29
- package/dist/sharepoint.js +329 -8
- 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 +19 -0
- package/package.json +4 -1
- package/server.json +30 -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.0"
|
|
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.0",
|
|
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.0",
|
|
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,42 @@ 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 Chrome (the default browser on Linux/Windows); a loading Teams page lists
|
|
56
|
+
its chats through the chat service at once, inside the window, with no click
|
|
57
|
+
needed. At most one tab per 10 minutes; `TEAMS_OPEN_TEAMS_TAB=false` turns it
|
|
58
|
+
off. Never on a hosted install (the browser is not on the server's machine),
|
|
59
|
+
and not for the search token (only a search you run makes that request).
|
|
60
|
+
- **`teams_token_status`.** Reports which tokens are held and until when without
|
|
61
|
+
touching the browser — check it before a write. With `wait: true` it primes a
|
|
62
|
+
token that is not held, waiting up to 120 s: start it, then click into a chat
|
|
63
|
+
(or, with `token: "substrate"`, run a search in the Teams search box).
|
|
64
|
+
|
|
29
65
|
**The Activity feed comes from the same API.** It is a chat-service
|
|
30
66
|
conversation of its own (`48:notifications`), so `teams_list_activity` reads
|
|
31
67
|
it like any chat — no Activity view (or any view) needs to be open, and
|
|
@@ -120,10 +156,15 @@ read only from the request header, never from page storage.
|
|
|
120
156
|
|
|
121
157
|
- **No separate pairing.** Search is part of the one bridge scope every capture
|
|
122
158
|
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)
|
|
159
|
+
- **Run a search in Teams once — while the call waits.** The token is read off
|
|
160
|
+
the Teams tab's own search request, so the first search may need you to type
|
|
161
|
+
anything into the Teams search box and press Enter **after** the call starts
|
|
162
|
+
and within the capture window (`TEAMS_CAPTURE_TIMEOUT`, default 30s); a search
|
|
163
|
+
run before the call does not count. `teams_token_status` with `wait: true`
|
|
164
|
+
and `token: "substrate"` primes it with a 120 s window instead. The token
|
|
165
|
+
(about 1.4 hours) is cached with its expiry in
|
|
166
|
+
`~/.microsoft-teams-mcp/substrate-token.json` and reused — across restarts —
|
|
167
|
+
until it is within 5 minutes of expiring.
|
|
127
168
|
- **It falls back to scanning.** In the default `mode: "auto"`, when no Substrate
|
|
128
169
|
token can be captured or the search fails, the tool scans recent conversations
|
|
129
170
|
instead (`source: "scan"`, with a `fallback_reason`), and does not wait on
|
|
@@ -135,7 +176,18 @@ read only from the request header, never from page storage.
|
|
|
135
176
|
organisation's directory (Substrate's people suggestions) when a name is not
|
|
136
177
|
in your chats, or when you pass an email address. A lookup is an explicit
|
|
137
178
|
request, so it always tries a fresh capture rather than honouring the
|
|
138
|
-
10-minute cooldown below.
|
|
179
|
+
10-minute cooldown below. `teams_get_profile` reads the profile card from the
|
|
180
|
+
same people suggestions (job title, department, office, company, chat
|
|
181
|
+
address; city and manager when the directory includes them) — Teams' own
|
|
182
|
+
card reads its extended fields from the Loki/Delve profile service, which
|
|
183
|
+
would need another token on another host and a re-pair, so this server does
|
|
184
|
+
not. `sender_email` on `teams_list_messages` / `teams_export_messages` uses
|
|
185
|
+
the same lookup.
|
|
186
|
+
- **Presence is best-effort.** `teams_get_profile`'s `include_presence` asks
|
|
187
|
+
the presence service behind the Teams host
|
|
188
|
+
(`teams.cloud.microsoft/ups/<TEAMS_CHATSVC_REGION>/v1/presence/getpresence/`)
|
|
189
|
+
with the chat-service token — no new token or pairing. If that token is not
|
|
190
|
+
accepted there, the lookup still returns the cards with a `presence_error`.
|
|
139
191
|
- **It does not re-capture in a loop.** If a freshly captured token is still
|
|
140
192
|
refused (401), the same 10-minute cooldown applies, so `auto` goes straight
|
|
141
193
|
to the scan instead of waiting on the bridge every call.
|
|
@@ -244,6 +296,10 @@ Everything is optional — by default the token is captured from your browser.
|
|
|
244
296
|
| `TEAMS_CHATSVC_BASE` | Full override for the API base (default `https://teams.cloud.microsoft/api/chatsvc/<region>/v1`). |
|
|
245
297
|
| `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
298
|
| `TEAMS_TOKEN_CACHE` | `false` to keep the captured token in memory only. Defaults to on. |
|
|
299
|
+
| `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 Chrome (the default browser on Linux/Windows) at most once per 10 minutes. Never on a hosted install. |
|
|
300
|
+
| `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 in Chrome once per host so the browser signs in there, and the download is retried for up to 30s. The tab is left open. Local installs only. |
|
|
301
|
+
| `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. |
|
|
302
|
+
| `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
303
|
| `TEAMS_TOKEN_FILE` | Where the captured token is cached. Defaults to `~/.microsoft-teams-mcp/token.json`. |
|
|
248
304
|
| `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
305
|
| `TEAMS_MCPS_REGION` | The region in the meeting-recap API path (`teams.cloud.microsoft/api/mcps/<region>`). Defaults to `us`. |
|
|
@@ -322,8 +378,13 @@ Everything is optional — by default the token is captured from your browser.
|
|
|
322
378
|
`teams_list_conversations`) and
|
|
323
379
|
`limit` (default 50, max 500).
|
|
324
380
|
- `teams_list_messages` — read any chat or channel by id or name,
|
|
325
|
-
oldest first: sender,
|
|
326
|
-
|
|
381
|
+
oldest first: sender, `senderMri` (the sender's MRI, `8:orgid:…` — pass it
|
|
382
|
+
to `teams_get_profile`), time (UTC, ISO 8601), text, subject, edited/deleted
|
|
383
|
+
flags and attachments. `sender_email: true` (full format only) also adds
|
|
384
|
+
`senderEmail`, looked up in your organisation's directory once per sender
|
|
385
|
+
(by that exact MRI, never a namesake) and cached in memory for an hour; a
|
|
386
|
+
sender the directory does not list gets none, and if the directory cannot be
|
|
387
|
+
asked, `sender_email_error` says why while the messages still come back. A formatted message also carries `content_html` —
|
|
327
388
|
its body as sanitised HTML (bold, italic, lists, links, code, quotes,
|
|
328
389
|
headings, tables and @mention spans; every other tag and attribute
|
|
329
390
|
dropped) — and any message with them carries `mentions`
|
|
@@ -331,11 +392,19 @@ Everything is optional — by default the token is captured from your browser.
|
|
|
331
392
|
(`[{href, text}]`, each link with the text it was shown as). A plain
|
|
332
393
|
message has none of the three: its `text` says everything. In `text` a
|
|
333
394
|
numbered list keeps its numbers (`1. `, `2. `) and a bulleted one its `- `.
|
|
334
|
-
A channel comes back as threads (root post + replies)
|
|
395
|
+
A channel comes back as threads (root post + replies) AND, in `full` and
|
|
396
|
+
`compact`, as a flat `messages` list — roots and replies in time order,
|
|
397
|
+
each with `thread_root_id` (a root's own id) — so reading `messages` works
|
|
398
|
+
the same for a chat and a channel. Every result has `message_count` (the
|
|
399
|
+
messages read); a window with nothing in it says `message_count: 0` and
|
|
400
|
+
`messages: []`, never an absent key. A channel read with `since` and
|
|
401
|
+
`format: "compact"` looks like
|
|
402
|
+
`{ conversation, unread_count, message_count: 4, messages: [{ id, time, sender, text, thread_root_id }, …], threads: [{ root, replies }, …], next_cursor, … }`.
|
|
335
403
|
A thread whose root post is older than the window (a reply came in after
|
|
336
404
|
`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
|
-
|
|
405
|
+
it is fetched by id and marked `outside_window: true` — context only: in
|
|
406
|
+
`threads` but not in the flat `messages`, not counted in `unread_count` or
|
|
407
|
+
`message_count` and never the `next_cursor`.
|
|
339
408
|
Up to 25 roots are fetched per call (shared by every conversation it
|
|
340
409
|
reads, newest threads first); one past that, or one that cannot be
|
|
341
410
|
fetched, is `{ id, missing: true }`.
|
|
@@ -399,7 +468,10 @@ Everything is optional — by default the token is captured from your browser.
|
|
|
399
468
|
- `teams_list_unread_messages` — every unread message across your chats and channels,
|
|
400
469
|
grouped by conversation, most recent first (or, with `from`, one
|
|
401
470
|
oldest-first list across them all — see
|
|
402
|
-
[Paging from a time](#paging-from-a-time)).
|
|
471
|
+
[Paging from a time](#paging-from-a-time)). Each conversation carries
|
|
472
|
+
`message_count` and, like `teams_list_messages`, a channel's unread posts
|
|
473
|
+
both flat (`messages`, each with `thread_root_id`) and as `threads`.
|
|
474
|
+
Filter by `kinds` (`chat`,
|
|
403
475
|
`channel`, `meeting`, `oneOnOne`) or `query` (title, channel or team
|
|
404
476
|
name, an untitled chat's participant name, or the last-message preview —
|
|
405
477
|
each conversation then carries `match_reason`, as in `teams_list_conversations`);
|
|
@@ -530,7 +602,10 @@ Everything is optional — by default the token is captured from your browser.
|
|
|
530
602
|
every SharePoint host, so the first download may need
|
|
531
603
|
[your Teams tab reloaded](#sharepoint-file-download) to capture it; a
|
|
532
604
|
file your account cannot open, or one that could not be fetched, comes back as
|
|
533
|
-
metadata and its open link instead of failing.
|
|
605
|
+
metadata and its open link instead of failing. On a local install, a file on
|
|
606
|
+
a SharePoint host the browser has not signed in to yet opens its link in a
|
|
607
|
+
Chrome tab (once per host; the tab is left open, `TEAMS_OPEN_SIGNIN_TAB=false`
|
|
608
|
+
turns it off) and the download is retried. The caption names the
|
|
534
609
|
conversation beside its id (`title`, plus `participants` for an untitled
|
|
535
610
|
chat), titled as `teams_list_conversations` titles it.
|
|
536
611
|
|
|
@@ -591,6 +666,20 @@ Everything is optional — by default the token is captured from your browser.
|
|
|
591
666
|
the whole series, e.g. files shared across it) and `other_occurrences`
|
|
592
667
|
(other call days, newest first). Uses its own token (see
|
|
593
668
|
[Meeting recaps](#meeting-recaps)). Read-only.
|
|
669
|
+
- `teams_get_profile` — a colleague's profile card, as Teams shows it:
|
|
670
|
+
`displayName`, `mri`, `email`, `chatAddress`, `jobTitle`, `department`,
|
|
671
|
+
`officeLocation`, `city`, `company` and `manager` (each absent when the
|
|
672
|
+
directory does not say). `person` is an email address, a chat address (UPN),
|
|
673
|
+
an MRI or a name (`"Last, First"` or `"First Last"`), or an array of up to 50.
|
|
674
|
+
The result is `{ profiles: [...] }`, one per person in order, each with
|
|
675
|
+
`status` `found` (+ `profile`), `ambiguous` (+ `candidates`, up to 10 cards —
|
|
676
|
+
a name several people share is never guessed; pass one's email or MRI),
|
|
677
|
+
`not_found` or `error` (+ `hint`). `include_presence: true` also returns
|
|
678
|
+
`presence: [{ mri, availability, activity, lastSeen, timeZone, localTime }]`
|
|
679
|
+
for the people found — beside the cards, fetched only when asked, never
|
|
680
|
+
stored; if presence cannot be read, `presence_error` says why and the cards
|
|
681
|
+
still come back. Uses the directory token (see
|
|
682
|
+
[Substrate search](#substrate-search)). Read-only.
|
|
594
683
|
- `teams_get_transcript` — the transcript of a recorded Teams meeting, read from
|
|
595
684
|
its meeting chat (`conversation`: the chat's id or a substring of its title).
|
|
596
685
|
It reads **Teams' own copy** of the transcript — the one the meeting's Recap
|
|
@@ -621,7 +710,10 @@ Everything is optional — by default the token is captured from your browser.
|
|
|
621
710
|
conversation, and a note that the content is untrusted third-party text),
|
|
622
711
|
then one record per message, oldest first, each carrying its conversation's
|
|
623
712
|
`id`, `kind`, `title`, `team` (channels) and `participants` (chats: the
|
|
624
|
-
people seen writing, other than you)
|
|
713
|
+
people seen writing, other than you), the sender's `senderMri` (and, with
|
|
714
|
+
`sender_email: true`, `senderEmail`, looked up as for `teams_list_messages`;
|
|
715
|
+
jsonl only — `sender_email` with `format: "markdown"` is refused)
|
|
716
|
+
and the message's `content_html`,
|
|
625
717
|
`mentions` and `links` when it has them — or `format: "markdown"` for readable
|
|
626
718
|
transcripts, channels threaded under their root posts, a formatted message
|
|
627
719
|
rendered as Markdown (bold, italic, lists, links with their text, code,
|
|
@@ -662,6 +754,16 @@ Everything is optional — by default the token is captured from your browser.
|
|
|
662
754
|
large — is listed with `skipped` and the reason instead, and never fails the
|
|
663
755
|
export (`counts.attachments` / `counts.attachments_skipped`). Never marks
|
|
664
756
|
anything read.
|
|
757
|
+
- `teams_token_status` — whether the chat-service and Substrate (search /
|
|
758
|
+
directory) tokens are held, where (`memory`, `disk cache`,
|
|
759
|
+
`TEAMS_ACCESS_TOKEN`), `expires_at` and `minutes_remaining`, and the last
|
|
760
|
+
capture (with its `token_*` code when it failed) — without touching the
|
|
761
|
+
browser, so it is the check to run before a write. `wait: true` primes one
|
|
762
|
+
token (`token`, default `chat_service`) when it is not held, waiting up to
|
|
763
|
+
`wait_seconds` (default and maximum 120) and reporting progress: start it,
|
|
764
|
+
then click into a chat (or run a search, for `substrate`). A failed prime is
|
|
765
|
+
reported in the result (`error`, `next_step`), not as a tool error. Never
|
|
766
|
+
returns a token.
|
|
665
767
|
- `teams_healthcheck` — resolves the token the way every tool does
|
|
666
768
|
(capturing one on a cold start) and probes the chat service with one
|
|
667
769
|
conversations listing. Reports where the token came from and when it
|
|
@@ -698,18 +800,83 @@ Everything is optional — by default the token is captured from your browser.
|
|
|
698
800
|
`warning` saying what it does (a thread reply in a channel, a quote in a
|
|
699
801
|
chat). The fenced details of the quoted message are in `quoted_message`.
|
|
700
802
|
`mentions`
|
|
701
|
-
@-mentions people by MRI
|
|
803
|
+
@-mentions people by MRI (a bare Entra object id is taken as
|
|
804
|
+
`8:orgid:<id>`) or by a display name matched among the
|
|
702
805
|
conversation's recent senders (an ambiguous name is refused with the
|
|
703
|
-
candidates).
|
|
806
|
+
candidates). To mention a channel, pass the channel's id
|
|
807
|
+
(`19:…@thread.tacv2`) or its exact name as `person` — the channel being
|
|
808
|
+
posted to, or its team (by its team thread id or name); that produces the
|
|
809
|
+
mention Teams stores when you type @ChannelName. The preview checks the
|
|
810
|
+
mentions, best-effort and without a lookup per mention:
|
|
811
|
+
- `unmatched_mentions` (with `mention_warning`), shown above the text:
|
|
812
|
+
each "@name" in the text that no mention covers — it goes out as plain
|
|
813
|
+
text and notifies nobody. It is a warning; confirming still sends. An
|
|
814
|
+
"@" counts when it starts a word and a letter follows (so `a@b.com` and
|
|
815
|
+
`@3pm` do not), outside URLs and code; the name is the longest known
|
|
816
|
+
display name (recent senders, the mentions, the channel and team) the
|
|
817
|
+
text continues with, else one word (letters/digits joined by `.` or
|
|
818
|
+
`-`). "Hi @Platform Ops team and @Alice" with only Alice mentioned, in
|
|
819
|
+
the Platform Ops channel, gives `["@Platform Ops"]`; elsewhere
|
|
820
|
+
`["@Platform"]`.
|
|
821
|
+
- `mentions_summary`, one line: `Mentions: "Alice Example", "Platform Ops" (channel)`.
|
|
822
|
+
- per mention: `mention_type` (`person`, `channel` or `team`), the resolved
|
|
823
|
+
display `name` when known, the `mri`, and for a person `in_conversation`
|
|
824
|
+
— `true`/`false` from a chat's member list (a 1:1 from its id), or
|
|
825
|
+
`"unknown"` when it cannot be read; in a channel only someone who posted
|
|
826
|
+
lately is known to be in it, anyone else is `"unknown"`. Emails are not
|
|
827
|
+
looked up.
|
|
828
|
+
- `mention_notes` when a person is not a member of the chat, or a
|
|
829
|
+
channel mention names a different channel than the one posted to.
|
|
830
|
+
The result says whether the post was found again by reading
|
|
704
831
|
the conversation back (`verified`).
|
|
832
|
+
A `conversation` that is exactly a person's name (`First Last` or
|
|
833
|
+
`Last, First`, any case) goes to your 1:1 with them even when group chats
|
|
834
|
+
or channels also match it; the preview's and result's `conversation`
|
|
835
|
+
lists those other matches as `other_matches`, so the choice is visible. A
|
|
836
|
+
partial name, or one matching no single 1:1, is still refused with the
|
|
837
|
+
candidates.
|
|
838
|
+
`attachments` sends files with the message — up to 10, each at most
|
|
839
|
+
100 MiB, any type — and `text` may then be left out. Each item is exactly
|
|
840
|
+
one of `{ path }` (a local file: absolute or `~/…`, inside your home
|
|
841
|
+
folder or a `TEAMS_UPLOAD_DIRS` folder; directories, hidden files and
|
|
842
|
+
symlinks are refused; refused on the hosted connector), `{ blobKey }`
|
|
843
|
+
(the hosted connector: from `teams_upload_slots`) or `{ inline:
|
|
844
|
+
{ filename, contentBase64, mimeType? } }` (small files), each with an
|
|
845
|
+
optional `name` to show. In a chat the files go to your OneDrive's
|
|
846
|
+
"Microsoft Teams Chat Files" folder (the one Teams uses), shared with the
|
|
847
|
+
chat's members (view access, no email); in the self-chat they are shared
|
|
848
|
+
with no one. In a channel they go to the channel's folder of the team's
|
|
849
|
+
SharePoint "Shared Documents" — refused, before anything is uploaded,
|
|
850
|
+
when the channel's details do not name the team's site. They are posted
|
|
851
|
+
as file cards, as the Teams client does. The preview lists each file's
|
|
852
|
+
name, size, type, SHA-256, where it goes and who gets access; nothing is
|
|
853
|
+
uploaded until you confirm, and a file that changed since the preview is
|
|
854
|
+
refused. A file over the limit is refused before anything is sent; files
|
|
855
|
+
over 4 MiB go up through an upload session. An upload or share that fails
|
|
856
|
+
stops the send — the message is never posted without its files — and the
|
|
857
|
+
error names the permission SharePoint wanted (and any file already
|
|
858
|
+
uploaded). The result gives the message id and each file's name, size and
|
|
859
|
+
link. Verified live (2026-12-01) in the self-chat and a 1:1 chat: the
|
|
860
|
+
OneDrive upload (single request and upload session), sharing with the
|
|
861
|
+
other member, and the file cards. Channel attachments are not yet verified
|
|
862
|
+
live (`scripts/manual-send-attachment.mjs` exercises `48:notes`).
|
|
705
863
|
- `teams_edit_message` — replace the text of one of your own messages:
|
|
706
864
|
`conversation`, `message_id` (one you sent — someone else's, a deleted
|
|
707
865
|
message or a system event is refused before any preview), `text`, and
|
|
708
|
-
`format` / `mentions` as for `teams_send_message
|
|
866
|
+
`format` / `mentions` as for `teams_send_message` (the preview checks the
|
|
867
|
+
mentions the same way: `unmatched_mentions`, `mentions_summary`,
|
|
868
|
+
`mention_notes`). A quote-reply keeps its
|
|
709
869
|
quote. The preview shows the current text, the new text and the exact HTML
|
|
710
870
|
that will replace it; text that renders exactly as the message already
|
|
711
871
|
does, mentioning the same people, changes nothing (`status: "unchanged"`). The message is read back to
|
|
712
|
-
verify the edit (`verified`).
|
|
872
|
+
verify the edit (`verified`). `attachments` (as for `teams_send_message`)
|
|
873
|
+
adds files to the message, beside any it already carries.
|
|
874
|
+
- `teams_upload_slots` — the hosted connector's way to attach a file: for
|
|
875
|
+
each `{ filename, mimeType? }` it returns a signed `uploadUrl` (and a
|
|
876
|
+
ready `curl`) to PUT the file to, and a `blobKey` to pass as an attachment
|
|
877
|
+
to `teams_send_message` / `teams_edit_message`. The upload is deleted once
|
|
878
|
+
the message is sent. Writes nothing to Teams; refused on a local install
|
|
879
|
+
(pass `path` there).
|
|
713
880
|
- `teams_delete_message` — delete one of your own messages: `conversation`
|
|
714
881
|
and `message_id` (one you sent — someone else's or a system event is
|
|
715
882
|
refused before any preview). One already deleted is reported as
|
|
@@ -751,17 +918,30 @@ Everything is optional — by default the token is captured from your browser.
|
|
|
751
918
|
several exact matches, several suggestions, a partial word, nothing —
|
|
752
919
|
refuses, listing the candidates with their email and MRI.
|
|
753
920
|
|
|
921
|
+
People are resolved in this order, and nothing is guessed: **(a)** an MRI or
|
|
922
|
+
bare Entra object id, as given; **(b)** a name among the people in your
|
|
923
|
+
chats; **(c)** `ids` — an optional map from a `people` entry (a name or an
|
|
924
|
+
email) to an MRI or Entra object id you looked up elsewhere, e.g. in the
|
|
925
|
+
Outlook MCP's people list (one that names someone other than the chat match
|
|
926
|
+
is refused); **(d)** only then the directory.
|
|
927
|
+
|
|
754
928
|
The directory is Substrate's people suggestions
|
|
755
929
|
(`POST https://substrate.office.com/search/api/v1/suggestions`), reached
|
|
756
930
|
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
|
-
|
|
931
|
+
new token or bridge scope, but if that token is not held the lookup needs
|
|
932
|
+
you to run a search in the Teams search box **while the call waits** (see
|
|
933
|
+
[Token capture timing](#token-capture-timing-read-this-if-a-call-says-it-could-not-get-a-token)).
|
|
934
|
+
Passing an Entra object id, or `ids`, needs no directory at all. Only people
|
|
935
|
+
in your organisation are found there (not distribution lists or personal
|
|
936
|
+
contacts). The directory is asked once per distinct name, and not again in
|
|
937
|
+
the same call after its token could not be captured. When anyone does not
|
|
938
|
+
resolve, the whole call is refused with one error that names each failure
|
|
939
|
+
with a stable code (`person_ambiguous`, `person_not_found`,
|
|
940
|
+
`person_conflict`, `caller_id_invalid`, `directory_unavailable` — which
|
|
941
|
+
also carries the capture's `token_*` code and how long it waited —
|
|
942
|
+
`person_not_checked`; `people_unresolved` when several failed) and lists
|
|
943
|
+
who **did** resolve. The preview lists everyone with their `source` (`id`,
|
|
944
|
+
`chat`, `caller` or `directory`) and, for a directory hit, their `email`, so you can see
|
|
765
945
|
exactly who will be added. People already in the chat are reported as
|
|
766
946
|
`already_member` and not written (if everyone is, nothing is asked). Teams
|
|
767
947
|
posts a notice in the chat for each person added. The chat is read back,
|
|
@@ -783,14 +963,42 @@ Everything is optional — by default the token is captured from your browser.
|
|
|
783
963
|
person is a 1:1, which this tool does not create. Sent as one
|
|
784
964
|
`POST /threads` with everyone as a member (Teams makes every group-chat
|
|
785
965
|
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
|
-
|
|
966
|
+
cannot be deleted afterwards** — only left. The chat is read back and the
|
|
967
|
+
result is `created` with the new `conversation` (id, title, kind `group`),
|
|
968
|
+
the `members` and `verified` (everyone and the topic shown). It is not
|
|
969
|
+
idempotent: `status: "unknown"` means Teams did not confirm the create —
|
|
970
|
+
check `teams_list_conversations` before retrying, since a blind retry makes
|
|
971
|
+
a second chat.
|
|
972
|
+
|
|
973
|
+
**First message, in the same action.** An optional `message` (with
|
|
974
|
+
`format` `text`|`markdown` and `mentions`, as for `teams_send_message`) is
|
|
975
|
+
posted right after the chat is created, to the conversation id Teams
|
|
976
|
+
returned — never looked up by name. Each mention's `person` must be one of
|
|
977
|
+
the new chat's members, by display name (or the `people` entry that named
|
|
978
|
+
them) or MRI; one matching no member (`mention_no_member`) or several
|
|
979
|
+
(`mention_ambiguous`) is refused before any preview. There is one
|
|
980
|
+
confirmation for both steps, and its token is bound to the members, the
|
|
981
|
+
topic and the exact rendered message — changing any of them needs a new
|
|
982
|
+
preview. The preview shows the members, the topic and `first_message`:
|
|
983
|
+
the text, the format, `rendered_html` (exactly what is posted) and each
|
|
984
|
+
mention with the member it resolved to — and, above the text,
|
|
985
|
+
`mentions_summary` plus `unmatched_mentions` / `mention_warning` for any
|
|
986
|
+
`@name` no mention covers (a warning, not a refusal), as for
|
|
987
|
+
`teams_send_message`. The result adds `message`:
|
|
988
|
+
`{status: "sent", message_id, verified}` (verified = found again by its
|
|
989
|
+
`clientmessageid`). If the chat was created but the message failed, the
|
|
990
|
+
result is `status: "partial"` with the `conversation` id, `message:
|
|
991
|
+
{status: "failed", error}` (or `"unknown"` when Teams did not confirm the
|
|
992
|
+
post — check `teams_list_messages` first) and a ready `retry`
|
|
993
|
+
(`teams_send_message` to that id, mentions by MRI). Never retry by calling
|
|
994
|
+
`teams_create_group_chat` again; if it is called again anyway with the
|
|
995
|
+
same people and topic (with a message — the message itself may differ),
|
|
996
|
+
the server remembers the chat it made (in memory, for a day) and only
|
|
997
|
+
sends that call's message to it — the preview says the chat was already
|
|
998
|
+
created and shows the message that would go. When the create itself is unconfirmed (`unknown`),
|
|
999
|
+
nothing is sent (`message: {status: "not_sent"}`). Without `message` the
|
|
1000
|
+
tool behaves exactly as before. Because a posted message cannot be
|
|
1001
|
+
recalled, the tool is annotated destructive, like `teams_send_message`.
|
|
794
1002
|
|
|
795
1003
|
`teams_list_messages` and `teams_list_unread_messages` also write when — and only
|
|
796
1004
|
when — you pass `mark_read: true` (see above). Every other tool is
|