Skip to main content
Glama

Dayze — Life Context

Search Gmail (read-only)

search_gmail
Read-only

Search one of the authenticated user's connected Gmail inboxes (read-only). Reuses Integrations hub Gmail (service_connections provider=gmail). Optional account/email selects a mailbox when multiple are connected — call list_gmail_accounts first. Prefer Gmail operators: from:, subject:, is:unread, newer_than:7d, has:attachment. For clock-time constraints, pass after/before as account-local civil datetimes; the tool converts them to precise UTC instants. Returns id, subject, from, canonical date, account-local date_local, time_zone, and snippet only (no body), newest first (newest_first: true). For the latest / most recent email from someone, query from: alone, without quoted topic phrases (the newest reply often lacks them); a from: + topic search with no match from the last 7 days also searches the sender alone and marks those messages sender_only (see note). Follow up with read_gmail_message. Cannot send, archive, or delete. Never invent email contents. If Gmail is not connected, connect at /integrations. Requires mail.read on an API key or non-ChatGPT OAuth connection. ChatGPT profiles do not grant mail.read or list this tool. Share tokens cannot call this tool. ($0.10; API key required)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qNoAlias for query
afterNoExclusive lower bound as account-local YYYY-MM-DDTHH:mm, or an offset-aware ISO instant
emailNoAlias for account
queryYesGmail search query, e.g. "is:unread newer_than:7d", "from:airline subject:itinerary", "receipt newer_than:30d"
beforeNoExclusive upper bound as account-local YYYY-MM-DDTHH:mm, or an offset-aware ISO instant
accountNoMailbox email, connection id, or Google subject (from list_gmail_accounts)
max_resultsNoMax messages to return (default 10, max 20)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteNoWhat the ranking means for a "latest email" answer.
afterNo
queryYes
beforeNo
accountNo
messagesYes
time_zoneYes
newest_firstYesMessages are ranked newest first by received time.
sender_checkNoA from: + topic search with no recent match also searched the sender alone (one extra search).
unavailable_countNoMatches whose details could not be loaded; one may be newer.
result_size_estimateYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • addedOutput schema / properties / messages / items / properties / sender_only
      Added value: +{
      +  "description": "From the sender-only check: the sender's mail, missing some of the topic terms.",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / newest_first
      Added value: +{
      +  "description": "Messages are ranked newest first by received time.",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / note
      Added value: +{
      +  "description": "What the ranking means for a \"latest email\" answer.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / sender_check
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "A from: + topic search with no recent match also searched the sender alone (one extra search).",
      +  "properties": {
      +    "added": {
      +      "type": "number"
      +    },
      +    "failed": {
      +      "type": "boolean"
      +    },
      +    "query": {
      +      "type": "string"
      +    },
      +    "reason": {
      +      "type": "string"
      +    },
      +    "window_days": {
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "query",
      +    "reason",
      +    "window_days",
      +    "added",
      +    "failed"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / unavailable_count
      Added value: +{
      +  "description": "Matches whose details could not be loaded; one may be newer.",
      +  "type": "number"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "query",
      -  "result_size_estimate",
      -  "messages",
      -  "time_zone"
      -]New value: +[
      +  "query",
      +  "result_size_estimate",
      +  "newest_first",
      +  "messages",
      +  "time_zone"
      +]
  2. Changed9 schema fields changed
    • addedInput schema / properties / after
      Added value: +{
      +  "description": "Exclusive lower bound as account-local YYYY-MM-DDTHH:mm, or an offset-aware ISO instant",
      +  "type": "string"
      +}
    • addedInput schema / properties / before
      Added value: +{
      +  "description": "Exclusive upper bound as account-local YYYY-MM-DDTHH:mm, or an offset-aware ISO instant",
      +  "type": "string"
      +}
    • addedOutput schema / properties / after
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / before
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / messages / items / properties / date_local
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / messages / items / properties / time_zone
      Added value: +{
      +  "type": "string"
      +}
    • changedOutput schema / properties / messages / items / required
      Previous value: -[
      -  "id",
      -  "subject",
      -  "from",
      -  "date",
      -  "snippet"
      -]New value: +[
      +  "id",
      +  "subject",
      +  "from",
      +  "date",
      +  "date_local",
      +  "time_zone",
      +  "snippet"
      +]
    • addedOutput schema / properties / time_zone
      Added value: +{
      +  "type": "string"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "query",
      -  "result_size_estimate",
      -  "messages"
      -]New value: +[
      +  "query",
      +  "result_size_estimate",
      +  "messages",
      +  "time_zone"
      +]
  3. Changed4 schema fields changed
    • addedInput schema / properties / account
      Added value: +{
      +  "description": "Mailbox email, connection id, or Google subject (from list_gmail_accounts)",
      +  "type": "string"
      +}
    • addedInput schema / properties / email
      Added value: +{
      +  "description": "Alias for account",
      +  "type": "string"
      +}
    • addedOutput schema / properties / account
      Added value: +{
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • changedOutput schema / properties / messages / items / properties / date / type
      Previous value: -[
      -  "string",
      -  "null"
      -]New value: +"string"
  4. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "messages": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "date": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "from": {
      +            "type": "string"
      +          },
      +          "id": {
      +            "type": "string"
      +          },
      +          "snippet": {
      +            "type": "string"
      +          },
      +          "subject": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "id",
      +          "subject",
      +          "from",
      +          "date",
      +          "snippet"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "query": {
      +      "type": "string"
      +    },
      +    "result_size_estimate": {
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    }
      +  },
      +  "required": [
      +    "query",
      +    "result_size_estimate",
      +    "messages"
      +  ],
      +  "type": "object"
      +}
  5. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare read-only/non-destructive, but the description adds substantial context: only id/subject/from/date/date_local/time_zone/snippet are returned (no body), newest-first ordering, the sender_only fallback when a from:+topic search misses, auth requirements (mail.read on API key or non-ChatGPT OAuth), ChatGPT profiles not granting access, share tokens blocked, and connection setup at /integrations.

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?

Front-loaded with purpose and scoping, then constraints and behavior. Dense but every clause carries information; a few parenthetical asides (the $0.10 cost, the sender_only 'see note' cross-reference) make it longer than ideal, though nothing is truly filler.

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

Completeness5/5

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

Given an output schema exists, return fields need not be explained yet it still summarizes them, and it covers auth, prerequisites, cost, and a behavioral edge case (sender-only fallback). Nothing an agent needs to invoke this correctly is missing.

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 100%, so the baseline is 3, but the description adds real meaning beyond the schema: after/before are account-local civil datetimes converted to precise UTC instants (an execution behavior not visible in the schema), the account/email alias relationship, and practical query-construction guidance. It stops short of documenting max_results' 20 cap in prose, but that is already in the schema.

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

Purpose5/5

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

States a specific verb+resource with scope ('search one of the authenticated user's connected Gmail inboxes, read-only'), and distinguishes itself from siblings by naming list_gmail_accounts, read_gmail_message, and the import_*_gmail tools it is not. An agent can route correctly without opening the schema.

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

Usage Guidelines5/5

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

Gives explicit when-to-use guidance (call list_gmail_accounts first when multiple mailboxes; follow up with read_gmail_message), operator preferences (from:, subject:, is:unread, newer_than:7d), and a specific alternative query pattern for the latest email from a sender. Also states exclusions: cannot send, archive, or delete.

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.