Skip to content

feat(msteams): Add Graph API-based message history query (readMessages action) #11346

@jlian

Description

@jlian

Summary

The msteams plugin docs describe Graph API permissions enabling historical message queries, but the plugin doesn't implement a readMessages action. Discord and Slack both support this. Teams should too, especially since Graph permissions (ChannelMessage.Read.All, Chat.Read.All) are already documented as prerequisites.

Use Case

After session compaction, the agent loses raw conversation history. Being able to query recent Teams messages via Graph would let the agent reconstruct context that was lost during compaction, rather than relying solely on the compaction summary and memory files.

This would also help with:

  • Catching up on messages received while the gateway was offline
  • Providing the agent with accurate message history for reference

Current State

  • Graph API permissions are documented in the msteams docs (RSC vs Graph API)
  • The plugin uses Graph for media/attachment downloads (attachments/graph.ts)
  • historyLimit and dmHistoryLimit only limit locally stored session turns, not Graph queries
  • The message tool for msteams only supports poll and send actions
  • Discord and Slack already have readMessages actions

Proposed

Add a readMessages (or similar) action to the msteams plugin that queries the Graph API /chats/{id}/messages and /teams/{teamId}/channels/{channelId}/messages endpoints, consistent with how Discord and Slack implement it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions