fix(microsoft-teams): align tools with live Graph API docs, add missing endpoints#5477
Conversation
…ng endpoints - fix list_channel_members/list_team_members falling back to userId when email is missing - add $top=50 pagination to read_channel for parity with read_chat - add list_teams, list_chats, list_channels, list_chat_members tools so agents can discover ids without the UI selectors - all new tools use only existing granted scopes (Team.ReadBasic.All, Chat.ReadBasic, Channel.ReadBasic.All) — no new OAuth scopes requested
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview New operations: Fixes and parity: Team/channel member listing no longer puts a raw Reviewed by Cursor Bugbot for commit c8127a6. Configure here. |
Greptile SummaryThis PR audits the Microsoft Teams integration against live Graph API docs, fixes two member-listing bugs, and adds four new discovery tools (
Confidence Score: 5/5Safe to merge — all changes are additive (new tools) or targeted correctness fixes with no breaking surface. The email-field bug fix is a strict improvement (a GUID is not an email address), the $top=50 addition to read_channel aligns it with the existing read_chat behavior, and the four new tools are self-contained with correct params routing, typed responses, and hasMore pagination signals. The block config correctly gates field visibility for each new operation, and no existing tool contracts are broken. No files require special attention. Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant Agent
participant Block as MicrosoftTeams Block
participant Tool as Tool Registry
participant Graph as Microsoft Graph API
Note over Agent,Graph: Discovery flow (new tools)
Agent->>Block: "operation = list_teams"
Block->>Tool: microsoft_teams_list_teams
Tool->>Graph: GET /me/joinedTeams
Graph-->>Tool: "{ value: [...teams], @odata.nextLink? }"
Tool-->>Block: "{ teams, teamCount, hasMore }"
Block-->>Agent: teams array + hasMore flag
Agent->>Block: "operation = list_channels (teamId)"
Block->>Tool: microsoft_teams_list_channels
Tool->>Graph: "GET /teams/{teamId}/channels"
Graph-->>Tool: "{ value: [...channels], @odata.nextLink? }"
Tool-->>Block: "{ channels, channelCount, hasMore }"
Block-->>Agent: channels array + hasMore flag
Agent->>Block: "operation = list_chats"
Block->>Tool: microsoft_teams_list_chats
Tool->>Graph: "GET /me/chats?$top=50"
Graph-->>Tool: "{ value: [...chats], @odata.nextLink? }"
Tool-->>Block: "{ chats, chatCount, hasMore }"
Block-->>Agent: chats array + hasMore flag
Agent->>Block: "operation = list_chat_members (chatId)"
Block->>Tool: microsoft_teams_list_chat_members
Tool->>Graph: "GET /chats/{chatId}/members"
Graph-->>Tool: "{ value: [...members], @odata.nextLink? }"
Tool-->>Block: "{ members, memberCount, hasMore }"
Block-->>Agent: members array + hasMore flag
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant Agent
participant Block as MicrosoftTeams Block
participant Tool as Tool Registry
participant Graph as Microsoft Graph API
Note over Agent,Graph: Discovery flow (new tools)
Agent->>Block: "operation = list_teams"
Block->>Tool: microsoft_teams_list_teams
Tool->>Graph: GET /me/joinedTeams
Graph-->>Tool: "{ value: [...teams], @odata.nextLink? }"
Tool-->>Block: "{ teams, teamCount, hasMore }"
Block-->>Agent: teams array + hasMore flag
Agent->>Block: "operation = list_channels (teamId)"
Block->>Tool: microsoft_teams_list_channels
Tool->>Graph: "GET /teams/{teamId}/channels"
Graph-->>Tool: "{ value: [...channels], @odata.nextLink? }"
Tool-->>Block: "{ channels, channelCount, hasMore }"
Block-->>Agent: channels array + hasMore flag
Agent->>Block: "operation = list_chats"
Block->>Tool: microsoft_teams_list_chats
Tool->>Graph: "GET /me/chats?$top=50"
Graph-->>Tool: "{ value: [...chats], @odata.nextLink? }"
Tool-->>Block: "{ chats, chatCount, hasMore }"
Block-->>Agent: chats array + hasMore flag
Agent->>Block: "operation = list_chat_members (chatId)"
Block->>Tool: microsoft_teams_list_chat_members
Tool->>Graph: "GET /chats/{chatId}/members"
Graph-->>Tool: "{ value: [...members], @odata.nextLink? }"
Tool-->>Block: "{ members, memberCount, hasMore }"
Block-->>Agent: members array + hasMore flag
Reviews (2): Last reviewed commit: "fix(microsoft-teams): surface pagination..." | Re-trigger Greptile |
- add hasMore output (derived from @odata.nextLink presence) to list_teams, list_chats, list_channels, list_chat_members so agents can detect truncated results instead of trusting the count field as a total - do NOT add $top to list_teams' joinedTeams request — Graph docs explicitly state this endpoint does not support OData query parameters, so it would silently no-op
|
@greptile review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit c8127a6. Configure here.
Summary
list_channel_members/list_team_membersincorrectly falling back to a rawuserIdGUID when a member's email was missing$top=50pagination toread_channelfor parity withread_chat(previously silently capped at Graph's default page size of 20)microsoft_teams_list_teams,microsoft_teams_list_chats,microsoft_teams_list_channels,microsoft_teams_list_chat_membersTeam.ReadBasic.All,Chat.ReadBasic,Channel.ReadBasic.All) — no new scopes requestedtools.access,tools.config, outputs, and added adiscover-teams-chats-channelsBlockMeta skillType of Change
Testing
Tested manually;
bun run lintandtsc --noEmitboth clean (no new errors vs. staging baseline)Checklist