Skip to main content
Glama

search_messages

Read-onlyIdempotent

Search Outlook mail across folders by query, sender, recipient, date, attachments, flags, or category, with optional body search and paging.

Instructions

Search mail, newest first. query matches subject, sender name or sender address (case-insensitive); the filters narrow further. Searches every non-empty folder of the accounts unless folder_id is given; last 90 days by default.

Args:
    query: Text to look for; may be empty when a filter is given.
    folder_id: Only this folder.
    account: Only this account's folders.
    since_days: Last N days (default 90; null searches everything, slow on big mailboxes).
    include_body: Also search body text (slower).
    limit: Maximum messages (1-200, default 50).
    from_address: Sender address contains this text.
    to_address: A To or Cc address contains this text.
    has_attachments: true / false to filter; omit for either.
    flagged: true / false to filter; omit for either.
    category: Only messages with this category.
    after, before: Received after / before these ISO dates (after replaces since_days).
    offset: Skip this many results first (paging).

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": "search_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
afterNo
limitNo
queryNo
beforeNo
offsetNo
accountNo
flaggedNo
categoryNo
folder_idNo
since_daysNo
to_addressNo
from_addressNo
include_bodyNo
has_attachmentsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare this is read-only, idempotent, non-destructive and closed-world, so the description is not required to establish safety. It adds useful behavioral context beyond that: searches span every non-empty folder of every account by default, results are newest first, include_body and a null since_days are slower, and after takes precedence over since_days. It does not describe result payload shape, which is the main remaining behavioral gap.

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

Conciseness5/5

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

The opening paragraph front-loads scope, ordering, matching behavior and defaults before the per-argument list, and every argument line contributes distinct information with no filler. Formatting as a compact Args block makes it scannable despite the high parameter count.

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

Completeness4/5

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

For a 14-parameter tool with no output schema, the definition is nearly complete on the input side, covering defaults, precedence rules, paging and performance trade-offs. The notable omission is what a returned message contains (fields such as id, subject, sender, date), which an agent would need in order to chain into follow-up tools like get_conversation or move_messages.

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

Parameters5/5

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

Schema description coverage is 0%, so the description carries the full parameter burden and does so thoroughly: all 14 parameters are explained, including matching semantics for query (subject, sender name, sender address, case-insensitive), limit's 1-200 range and default of 50, offset paging, ISO date format for after/before, and the interaction where after replaces since_days. This adds substantial meaning beyond the schema's bare names and defaults.

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

Purpose4/5

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

The description opens with a specific verb and resource ('Search mail, newest first') and states scope details: all non-empty folders of all accounts unless folder_id is given, with a 90-day default window. It is clear what the tool does, but it never names or distinguishes itself from the obvious sibling alternative (list_messages), so the reader must infer the search-vs-list boundary.

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

Usage Guidelines4/5

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

It gives concrete usage conditions: query may be empty when a filter is supplied, folder_id/account narrow the scope, after replaces since_days, and has_attachments/flagged should be omitted for either value. What it lacks is an explicit statement of when to use this instead of a plain listing or other retrieval tool, and no exclusions are given.

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