teams_search_messages
Search Microsoft Teams messages by full text and filter results by sender, chat or date. Returns conversation and message IDs for work and personal accounts, with paging support.
Instructions
Full-text search of your Teams messages, optionally by sender, chat and date; results carry conversationId, messageId and fromMri. Work and personal accounts (personal accounts fall back to Teams free search; to page, repeat with from=nextFrom and the engine the result reports).
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "teams_search_messages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from | No | Result offset (nextFrom of the previous page) | |
| size | No | Results per page (Teams free search returns at most 25) | |
| after | No | Only items sent at or after this ISO date/time | |
| limit | No | Same as size | |
| query | No | Search text. Microsoft 365 search also takes KQL: "exact phrase", OR, NOT, in:<chat or channel name> | |
| before | No | Only items sent before this ISO date/time | |
| engine | No | auto (default): Microsoft 365 search (substrate), then Teams free search (osearch, personal only) when it fails or finds nothing | |
| sender | No | Only items from this person (MRI, email or name) | |
| account | No | Account alias (see teams_accounts). Defaults to the default account. | |
| conversation_id | No | Only messages in this chat or channel |