Summarize Microsoft Teams chats and embed source links. Use when asked to summarize chats, recap Teams conversations, teams chat summary, weekly chat roundup, or fetch chat history. Always embeds deep links to original Teams messages.
Summarize Microsoft Teams 1:1 and group chats via WorkIQ and produce vault-ready notes with embedded deep links to every referenced message. Excludes Teams channel messages — only person-to-person and group chats are processed. Supports both manual invocation and automated hourly cron sync with watermark tracking.
Activate when:
ask_work_iq tool)04-Periodic/Weekly/, 04-Periodic/Daily/)getTeamsChatSyncStateReturns the timestamp watermark of the last successful sync. Use this to avoid re-processing old chats.
Returns: JSON with lastSynced (ISO timestamp or null), processedThreads (array of thread IDs), syncCount.
updateTeamsChatSyncStateUpdates the watermark after a successful sync.
Parameters:
lastSynced (required): ISO timestamp of this syncprocessedThreadIds (optional): Array of thread/conversation IDs processedappendTeamsChatHighlightsAppends a "## Teams Chat Highlights" section to the daily note. Idempotent — updates existing section if present. Also creates/updates person contact notes.
Parameters:
date (optional): YYYY-MM-DD, defaults to todayhighlights (required): Markdown content for the sectionpeople (optional): Array of person names mentionedpersonNotes (optional): Array of { name, note } to append to person contact filesThe sync state is stored at <vault_root>/.duckyai/state/tcs-last-sync.json:
{
"lastSynced": "2026-03-09T20:00:00Z",
"previousSynced": "2026-03-09T19:00:00Z",
"processedThreads": ["thread-id-1", "thread-id-2"],
"syncCount": 42,
"updatedAt": "2026-03-09T20:00:05Z"
}
This prevents re-processing chats across cron runs. Always call getTeamsChatSyncState first and updateTeamsChatSyncState last.
Manual invocation: Use the range the user explicitly specified (e.g., "January chats", "last week", "2026-03-01 to 2026-03-07"). Parse natural language into concrete {start} and {end} timestamps.
Automated cron: Call getTeamsChatSyncState to get the watermark.
lastSynced is null, use start of current day as {start}.lastSynced as {start}.{end}.Query WorkIQ with an explicit request for message-level deep links and the resolved date range:
"Summarize all Teams 1:1 and group chats I had between {start} and {end} (inclusive).
STRICT DATE FILTER: Only include messages that occurred within this exact window — do NOT include anything before {start} or after {end}.
Only include person-to-person and group chats — do NOT include Teams channel messages.
For EACH topic or key message, include the Teams deep link URL.
For 1:1 chats, group highlights by person.
For group chats, include who said what to whom for each key point.
Include decisions and action items."
CRITICAL: The prompt MUST ask for deep links. WorkIQ returns them as numbered references like [1](https://teams.microsoft.com/l/message/...). Extract and preserve every one.
Strictness rule: Regardless of how {start} / {end} were determined, always enforce them. Discard any item WorkIQ returns that falls outside the window — do not trust WorkIQ to filter perfectly; validate each item's timestamp before writing to the vault.
From the WorkIQ response, identify the chat type first, then extract accordingly:
1:1 chats:
Group chats:
Call appendTeamsChatHighlights with the formatted highlights, people list, and person notes.
For action items, call createTask with appropriate title, description, and priority.
Call updateTeamsChatSyncState with the current timestamp and any thread IDs.
Use different formats based on chat type:
## Teams Chat Highlights
### [[Alice Smith]]
- [Project Standup](https://teams.microsoft.com/l/message/...)
- Discussed sprint priorities and auth module ownership
- Agreed on JWT over session tokens
- [[Alice Smith]]: Handle auth module implementation
- [[Alice Smith]]: Share design doc by Wednesday
- [Code Review Follow-up](https://teams.microsoft.com/l/message/...)
- Reviewed PR #142 feedback
- [[Alice Smith]]: Address review comments and re-submit
### [[Bob Jones]]
- [Sprint Demo Prep](https://teams.microsoft.com/l/message/...)
- Moved demo to Friday
- [[Bob Jones]]: Prepare demo environment by Thursday
### API Design Working Group
- [[Alice Smith]] proposed switching to REST over gRPC [🔗](https://teams.microsoft.com/l/message/...)
- [[Bob Jones]] raised latency concerns with REST for high-frequency calls [🔗](https://teams.microsoft.com/l/message/...)
- [[Alice Smith]] → [[Bob Jones]]: suggested benchmarking both approaches before deciding [🔗](https://teams.microsoft.com/l/message/...)
- ✅ Decided to run a latency benchmark by end of week [🔗](https://teams.microsoft.com/l/message/...)
- [[Carol White]]: Write up a REST vs gRPC comparison doc by Friday
- [[Bob Jones]]: Set up benchmark environment by Wednesday
Format rules:
###) = Participant name as wiki link [[Full Name]] — exclude "Me"/the user- ) = Chat context/thread topic as a markdown link - [Topic](teams-url) -) = Key points and action items under that topic[[Name]]: indicating owner###) = Group chat name (plain text — no wiki link, it's not a person)[[Speaker Name]] to show who said it[[Sender]] → [[Recipient]]: format✅[[Name]]: indicating ownerEach person gets a dated entry under their ## Notes section:
- [2026-03-09] Discussed sprint priorities in standup; taking auth module
For weekly recaps, create 04-Periodic/Weekly/YYYY-Www Chat Summary.md with full template:
---