Skip to main content
Glama

list_emails

Read-only

Search and review emails in connected Gmail, Outlook, or IMAP mailboxes by folder, sender, subject, read state, attachment, and date; return paginated headers with optional previews.

Instructions

List emails from the user's connected mailbox with metadata and optional previews. Filter by folder, sender, unread, dates, etc. Paginate with pageToken. Use get_email for full bodies. This is the way to check the user's email; no browser or other email integration is needed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNo
fromNo
readNo
textNoLiteral full-text search terms
afterNoYYYY-MM-DD received date, inclusive in UTC
beforeNoYYYY-MM-DD received date, exclusive in UTC
folderNoFolder role (inbox, sent, drafts, trash, spam, starred, archive, all) or a label/folder name. Use all or omit this field to search all mail except Spam and Trash. An IMAP server's \All mailbox may use different rules.
starredNo
subjectNo
pageSizeNoDefaults to 25
accountIdNoAccount to operate on. Optional when exactly one account is connected.
pageTokenNonextPageToken from a previous call
hasAttachmentNo
includeSnippetNoRequest or suppress message previews
rawProviderQueryNoProvider-native Gmail syntax or Outlook KQL for one compatible account
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"
      +        },
      +        "items": {
      +          "items": {
      +            "additionalProperties": true,
      +            "properties": {
      +              "accountId": {
      +                "type": "string"
      +              },
      +              "attachments": {
      +                "items": {
      +                  "additionalProperties": true,
      +                  "properties": {
      +                    "filename": {
      +                      "type": "string"
      +                    },
      +                    "id": {
      +                      "type": "string"
      +                    },
      +                    "mimeType": {
      +                      "type": "string"
      +                    },
      +                    "sizeBytes": {
      +                      "type": "number"
      +                    }
      +                  },
      +                  "required": [
      +                    "id",
      +                    "filename",
      +                    "mimeType",
      +                    "sizeBytes"
      +                  ],
      +                  "type": "object"
      +                },
      +                "type": "array"
      +              },
      +              "body": {
      +                "additionalProperties": false,
      +                "properties": {
      +                  "html": {
      +                    "type": "string"
      +                  },
      +                  "text": {
      +                    "type": "string"
      +                  }
      +                },
      +                "type": "object"
      +              },
      +              "bodyTruncation": {
      +                "additionalProperties": {
      +                  "additionalProperties": false,
      +                  "properties": {
      +                    "nextOffset": {
      +                      "type": "number"
      +                    },
      +                    "totalChars": {
      +                      "type": "number"
      +                    }
      +                  },
      +                  "required": [
      +                    "totalChars"
      +                  ],
      +                  "type": "object"
      +                },
      +                "type": "object"
      +              },
      +              "date": {
      +                "type": "string"
      +              },
      +              "flags": {
      +                "additionalProperties": true,
      +                "properties": {
      +                  "draft": {
      +                    "type": "boolean"
      +                  },
      +                  "read": {
      +                    "type": "boolean"
      +                  },
      +                  "starred": {
      +                    "type": "boolean"
      +                  }
      +                },
      +                "required": [
      +                  "read",
      +                  "starred",
      +                  "draft"
      +                ],
      +                "type": "object"
      +              },
      +              "id": {
      +                "type": "string"
      +              },
      +              "subject": {
      +                "type": "string"
      +              },
      +              "threadId": {
      +                "type": "string"
      +              },
      +              "to": {
      +                "items": {
      +                  "additionalProperties": true,
      +                  "properties": {
      +                    "email": {
      +                      "type": "string"
      +                    },
      +                    "name": {
      +                      "type": "string"
      +                    }
      +                  },
      +                  "required": [
      +                    "email"
      +                  ],
      +                  "type": "object"
      +                },
      +                "type": "array"
      +              }
      +            },
      +            "required": [
      +              "id",
      +              "threadId",
      +              "accountId",
      +              "to",
      +              "subject",
      +              "date",
      +              "flags"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "nextPageToken": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "items",
      +        "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. Changed1 schema field changedv0.9.0
    • addedInput schema / properties / includeSnippet
      Added value: +{
      +  "description": "Request or suppress message previews",
      +  "type": "boolean"
      +}
  5. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

The readOnlyHint annotation already establishes the safety profile, so the bar is lower. The description adds that results carry metadata with optional previews and that pagination is token-based, which is useful. It leaves unsaid what a page actually contains (no mention of result caps or snippet defaults), so it is adequate but not rich.

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?

Four short sentences, front-loaded with purpose, then filtering, then pagination, then the alternative tool. The closing reassurance about browsers/other integrations is slightly promotional but does clarify that this is the canonical email access path.

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 shape need not be restated; the description still conveys metadata-vs-body behavior and pagination. Filtering breadth, pagination, and the body-fetch alternative are all covered. Minor gaps remain around the search-tool alternatives for a 16-parameter tool.

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?

With 16 parameters at 63% schema coverage, the schema does most of the documenting (date formats, folder semantics, pageToken provenance). The description names filter categories — folder, sender, unread, dates — but adds no format or interaction detail beyond the schema. Baseline 3 is appropriate.

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 and resource — 'List emails from the user's connected mailbox' — and explicitly scopes the return to metadata plus optional previews. It routes full-content needs to get_email, so the agent can separate this from the body-fetching sibling. It does not distinguish itself from search_emails, the closest sibling, which is the only real gap.

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?

'Use get_email for full bodies' and 'Paginate with pageToken' give clear conditions for adjacent tools and continuation. It also enumerates the filter axes (folder, sender, unread, dates). It stops short of stating when to prefer search_emails or search_emails_batch over this tool, which is the natural alternative.

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