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

TableJSON 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

TableJSON Schema
NameRequiredDescriptionDefault
countYes
messagesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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"
      +}
  2. 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
  3. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover read-only/idempotent/non-destructive safety, and the description adds real behavioral value: result ordering ('newest first'), Backend-specific quirks ('Outlook: total counts returned results only; from is exact'), and Gmail query support. It does not disclose pagination interaction with offset/limit beyond what schema states.

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?

Information-dense and front-loaded, with the account scope leading. The backtick-laden, semicolon-joined style is telegraphic, and the 'uid + folder and header hints' clause slightly duplicates the output schema, but no sentence is wasted.

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?

An output schema exists, so return values needn't be detailed, and the description correctly focuses on the ambiguous parts (account scoping, per-backend query semantics). For a 13-parameter search tool it is largely complete, though it omits guidance on combining filters.

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 adds genuine meaning: `query` semantics differ per backend (Gmail syntax vs. full text), `account="all"` is explained, and Outlook `from`/`total` behavior is clarified. It leaves less-obvious params like `offset` interplay with `limit` unaddressed.

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?

States a clear verb+resource ('Searches' messages) and immediately scopes it ('one account, or all with account="all"'). It never names the sibling 'search' or explains how it differs from get_message/fetch, so it falls short of full sibling differentiation.

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?

Usage is implied through the account and query scoping, and it explains Gmail vs. non-Gmail query behavior, but there is no explicit when-to-use vs. when-not, nor any named alternative (search, fetch, triage) to route the agent.

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.