Skip to main content
Glama

Search messages

search_messages
Read-onlyIdempotent

Searches one account, or all with account="all". Gmail: query takes Gmail syntax (from:, newer_than:7d, has:attachment, label:); elsewhere full text plus the filters. Newest first, with uid + folder and header hints. Outlook: total counts returned results only; from is exact.

Input Schema

NameRequiredDescriptionDefault
toNo
fromNo
limitNoDefault 20, max 50
queryNoGmail syntax on Gmail, else plain text
sinceNoISO date, e.g. 2026-09-01
beforeNoISO date
folderNoDefault: Gmail All Mail, else INBOX
offsetNoHits to skip (keep small)
unseenNoOnly unread
accountYes"all", or a list_accounts id
flaggedNoOnly starred/flagged
subjectNo
has_attachmentNo

Output Schema

NameRequiredDescriptionDefault
countYes
messagesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / from / maxLength
      Added value: +500
    • addedInput schema / properties / subject / maxLength
      Added value: +500
    • addedInput schema / properties / to / maxLength
      Added value: +500
  2. Changed5 schema fields changed
    • changedInput schema / properties / account / description
      Previous value: -"Account id, or \"all\" to search every readable account"New value: +"\"all\", or a list_accounts id"
    • changedInput schema / properties / folder / description
      Previous value: -"Folder/label path. Defaults to All Mail on Gmail, INBOX elsewhere."New value: +"Default: Gmail All Mail, else INBOX"
    • changedInput schema / properties / offset / description
      Previous value: -"Skip this many hits; the window Graph and IMAP fetch grows with it, so keep it small"New value: +"Hits to skip (keep small)"
    • changedInput schema / properties / query / description
      Previous value: -"Gmail search syntax on Gmail; plain text elsewhere"New value: +"Gmail syntax on Gmail, else plain text"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "additionalProperties": {},
      +  "properties": {
      +    "count": {
      +      "type": "number"
      +    },
      +    "messages": {
      +      "items": {
      +        "additionalProperties": {},
      +        "properties": {
      +          "folder": {
      +            "type": "string"
      +          },
      +          "uid": {
      +            "type": [
      +              "string",
      +              "number"
      +            ]
      +          }
      +        },
      +        "required": [
      +          "uid",
      +          "folder"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "count",
      +    "messages"
      +  ],
      +  "type": "object"
      +}
  3. Changed2 schema fields changed
    • addedInput schema / properties / offset / description
      Added value: +"Skip this many hits; the window Graph and IMAP fetch grows with it, so keep it small"
    • changedInput schema / properties / offset / maximum
      Previous value: -9007199254740991New value: +5000
  4. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already cover readOnly/idempotent/non-destructive/open-world, so the bar is lower; the description still adds real behavior: results are newest-first and include uid, folder, and header hints. The caveat that Outlook `total` counts returned results only, and that `from` is exact there, is exactly the kind of non-obvious semantics annotations can't express.

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?

Three terse sentences, scoping constraint front-loaded, then provider-specific semantics. No filler, and every clause carries information an agent would otherwise have to guess.

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 13-parameter search tool with an output schema and full annotations, the description covers the risky/ambiguous parts (account scoping, query syntax, ordering, Outlook caveats). It omits any mention of paging (offset/limit constraints like max 5000) and the relationship to sibling search tools, which keeps it just short of complete.

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

Parameters4/5

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

Schema coverage is 69%, and the description compensates for the gap: it explains the `account` sentinel value, restates the provider-dependent meaning of `query`, clarifies the default `folder` per provider, and warns that `from` is exact-match on Outlook. Only the paging parameters and the boolean filters get no added meaning, which is acceptable given they are self-descriptive.

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?

Opens with a specific verb+resource ("Searches") and immediately states scope: one account, or all accounts with account="all". However, it never differentiates from the sibling `search` tool or from `fetch`/`get_message`, so an agent must infer which retrieval tool to pick.

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

Usage Guidelines3/5

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

Provider-conditional behavior (Gmail query syntax vs full-text elsewhere, default folder Gmail All Mail vs INBOX) implies when the tool behaves differently, but there is no explicit when-to-use/when-not guidance and no named alternative such as `search` or `fetch`.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.