Skip to main content
Glama

search_messages

Search Microsoft Teams messages across chats and channels the signed-in user can see. Returns matching content snippets, senders, timestamps, and web links, newest first.

Instructions

Search Teams messages in all chats and channels the signed-in user can see.

Matches message content, including attachments (Microsoft Search). Returns up to size hits, newest first, with no further pages. Each hit has a snippet (summary, not the full body), sender name and email, timestamp, chatId or channelIdentity, and a webLink. Message ids are not returned - to reply to, react to or delete a hit, find it with list_chat_messages or list_channel_messages.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sizeNo
queryYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.0

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and delivers: results are capped at `size`, newest first, with no further pages (a real pagination limitation), hits contain a snippet rather than the full body, and ids are absent. These are non-obvious behavioral facts that materially change how an agent should call it.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads purpose, then behaviors, then the routing caveat in a logical order with no filler sentences. Dense and well-organized, though the enumerated return fields are borderline redundant given an output schema exists.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a two-parameter search tool with no annotations, it covers scope, matching behavior, result cap and ordering, snippet-vs-body, and the missing-id consequence. An agent has everything needed to call it correctly and to know when not to.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate and only partially does: it clarifies that `size` caps the number of hits and that `query` matches message content including attachments. It gives no search syntax or operators, so the query param's effective semantics remain partly undefined.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (Search) and resource (Teams messages) and delimits scope to 'all chats and channels the signed-in user can see'. It also actively distinguishes itself from list_chat_messages and list_channel_messages, so an agent can route between search-style discovery and list-style retrieval without opening schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit routing guidance: message ids are not returned, so to reply/react/delete a hit the agent must use list_chat_messages or list_channel_messages. This names the alternatives and the exact condition that selects them, which is precisely the when/when-not signal an agent needs.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.