Skip to main content
Glama

search_emails_batch

Read-only

Search up to 20 email accounts at once with one portable query and return one result group per account, with filters for dates, folders, read status, attachments, and snippets.

Instructions

Search up to 20 accounts with one portable query and return one result group per account.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNo
fromNo
readNo
afterNoYYYY-MM-DD received date, inclusive in UTC
queryYesTyped portable search syntax
beforeNoYYYY-MM-DD received date, exclusive in UTC
folderNo
starredNo
subjectNo
accountsYes
pageSizeNoDefaults to 25
hasAttachmentNo
includeSnippetNoRequest or suppress message previews
includeSearchContextNoInclude a match-centered body excerpt; requires a portable text query

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.11.1
    • removedOutput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
  2. Changed1 schema field changedv0.11.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "data": {
      +      "additionalProperties": true,
      +      "properties": {
      +        "exhausted": {
      +          "type": "boolean"
      +        },
      +        "groups": {
      +          "items": {
      +            "additionalProperties": true,
      +            "properties": {
      +              "accountId": {
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "accountId"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        }
      +      },
      +      "required": [
      +        "groups",
      +        "exhausted"
      +      ],
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "data"
      +  ],
      +  "type": "object"
      +}
  3. Changed1 schema field changedv0.10.0
    • addedInput schema / properties / includeSearchContext
      Added value: +{
      +  "description": "Include a match-centered body excerpt; requires a portable text query",
      +  "type": "boolean"
      +}
  4. Addedv0.9.0

TDQS

B3.1/5.0
Behavior3/5

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

Annotations declare readOnlyHint=true, so safety is covered. The description usefully adds that results are grouped per account with a shared query, but says nothing about pagination, page-token behavior across accounts, or rate limits for a 20-account fan-out.

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?

A single tightly written sentence with no filler, front-loading the batch scope and grouping behavior. It is efficient, though arguably too terse for a 14-parameter tool.

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

Completeness2/5

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

Output schema exists so return values need not be described, but for a 14-param, 43%-covered tool with nested account/pagination semantics, the one-line description leaves the agent without enough guidance on filters, pagination, or multi-account error handling.

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

Parameters2/5

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

Schema description coverage is only 43% across 14 parameters, and the description adds meaning for just two concepts (the portable query and the 20-account cap). Filters like to/from/read/starred/folder and the per-account pageToken structure get no explanation anywhere, so the description fails to compensate for the coverage gap.

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 specific verb (search) and resource (emails) with a clear scope: batching up to 20 accounts in one portable query and returning grouped results. This implicitly distinguishes it from the single-account search_emails sibling, though it never names the alternative.

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?

The 20-account cap and 'one portable query' framing imply this is the multi-account tool, but there is no explicit when-to-use vs search_emails guidance or any stated prerequisites. Usage must be inferred from the batch scope.

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