Teams Search Messages
teams_search_messagesSearches the Microsoft Teams chat and channel messages of a Microsoft 365 account with Microsoft Search: by text, and optionally by sender and date range. Use it to find where something was discussed without knowing the chat. Results come in Microsoft's relevance order (not newest first), and body is a snippet around the match, not the whole message; read the chat with teams_read_chat_messages for the rest. Returns at most 100 results from at most 4 pages of the search. When the read is cut (by that bound, or because the call ran out of time) the answer has truncated: true. Needs a work or school Microsoft 365 account connected with connect_m365_account (personal Microsoft accounts have no Teams reads).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max results (default 25, max 100) | |
| query | No | Text to search for | |
| since | No | Only messages on/after this date, YYYY-MM-DD (optional) | |
| until | No | Only messages on/before this date, YYYY-MM-DD (optional) | |
| account | No | Which connected Microsoft 365 account to use: its email (UPN), its id from list_m365_accounts, or its display name when unique. Leave it out to use the default account. | |
| from_sender | No | Only messages from this sender (name or email; optional) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | ||
| count | No | ||
| error | No | ||
| account | No | The email (UPN) of the Microsoft 365 account this call used. | |
| messages | No | ||
| truncated | No | Present and true only when the read was cut before it had everything it was asked for. |