Skip to main content
Glama

Search my mailbox for a receipt

well_search_mailbox_for_receipt
Read-only

Search the caller's own live Gmail and Outlook mailboxes for one supplier's messages in a date window. It checks up to 3 grants per provider, from from to to inclusive, and returns up to max_results messages from each mailbox, newest first. If more grants exist for a provider, truncated_providers names it; say the search covered only some of that provider's mailboxes. Use one call per supplier and widen the window by about a week on each side of the payment date because a receipt often arrives before or after the charge. Each match has provider and mailbox so its source is clear, plus from, subject, sent_at, a short snippet, already_in_well and an open_url to the message. When a message fits, name its provider and mailbox address in your answer. Compare the snippet and subject against the gap's amount and date yourself: a supplier message is a find only when it fits that charge. already_in_well: true means Well's mail sync already turned that message into documents, so the receipt can be matched in Well rather than fetched. mailboxes reports each searched grant's provider, address and status. One mailbox can be unavailable while another still returns matches; the top-level status is searched when at least one search ran. Top-level no_mailbox means the caller has no connected Gmail or Outlook in this workspace; another member's mailbox is never searched. needs_reconnect means reconnect the listed provider. unavailable means no search could answer; say which mailbox could not be searched and never call it not found. This is a read only action: it attaches nothing, imports nothing and contacts no one, so it needs no confirmation.

When the token authorizes one workspace, call this directly — no workspace call is needed first. When it authorizes several, this read will not guess which one you mean: pass workspace_id on the call.

Input Schema

NameRequiredDescriptionDefault
toYesLast day of the window, YYYY-MM-DD, inclusive.
fromYesFirst day of the window, YYYY-MM-DD, inclusive.
max_resultsNo
workspace_idNoTarget workspace. Omit when the token authorizes one workspace. Required when it authorizes several: this read reports one workspace's own figures and will not choose which.
conversation_idNoThe conversation id returned by the previous Well result, in its meta under well/conversation_id, in its structuredContent, or in its JSON text block. Pass it back on every call in the same conversation, including a call a card makes, so the chosen workspace and the earlier answers still apply. It decides the conversation on its own: nothing the host states about the session replaces it. Omit it only on the first call of a conversation.
workspace_scopeNoRestrict this call to the family: the token's primary workspace plus the company workspaces under it that you are a member of. Unrelated authorized workspaces drop out of the read; row reads merge across the family, while a per-workspace figure still reports exactly one workspace.
counterparty_nameYesThe supplier's name as the missing-invoice row names it.
counterparty_domainNoThe supplier's email domain when known, e.g. the matched provider's domain.

Output Schema

NameRequiredDescriptionDefault
errorNo
statusYes
matchesYes
successYes
mailboxesYes
conversation_idNoThe conversation this result belongs to. Pass it back as the conversation_id argument on every later Well call in the same conversation.
newly_connectedNoTools that connected to this workspace since the last result and that no session was told about yet, oldest first. Present only when at least one tool is new. The connected-line rule says when to tell an entry; when it does, one line per entry, in the person's language: "<name> is connected.". Never fold several entries into one sentence. Each entry comes back once, on one result only: never repeat its line later.
resolved_workspaceNoThe workspace that answered, when the caller named none and the token authorizes several.
truncated_providersYes
conversation_id_noteNoPresent only when the server opened a fresh lane, stating that no choice recorded earlier was read.
conversation_id_sourceNoWhere the conversation id came from: the host's own request meta, the caller's argument, or a fresh lane the server opened.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • removedOutput schema / properties / mailbox
      Removed value: -{
      -  "type": [
      -    "string",
      -    "null"
      -  ]
      -}
    • addedOutput schema / properties / mailboxes
      Added value: +{
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "mailbox": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "provider": {
      +        "enum": [
      +          "gmail",
      +          "outlook"
      +        ],
      +        "type": "string"
      +      },
      +      "status": {
      +        "enum": [
      +          "searched",
      +          "needs_reconnect",
      +          "unavailable"
      +        ],
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "provider",
      +      "mailbox",
      +      "status"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / matches / items / properties / mailbox
      Added value: +{
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / matches / items / properties / provider
      Added value: +{
      +  "enum": [
      +    "gmail",
      +    "outlook"
      +  ],
      +  "type": "string"
      +}
    • changedOutput schema / properties / matches / items / required
      Previous value: -[
      -  "message_id",
      -  "from",
      -  "subject",
      -  "sent_at",
      -  "snippet",
      -  "already_in_well",
      -  "open_url"
      -]New value: +[
      +  "provider",
      +  "mailbox",
      +  "message_id",
      +  "from",
      +  "subject",
      +  "sent_at",
      +  "snippet",
      +  "already_in_well",
      +  "open_url"
      +]
    • addedOutput schema / properties / truncated_providers
      Added value: +{
      +  "items": {
      +    "enum": [
      +      "gmail",
      +      "outlook"
      +    ],
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "status",
      -  "mailbox",
      -  "matches",
      -  "success"
      -]New value: +[
      +  "status",
      +  "mailboxes",
      +  "truncated_providers",
      +  "matches",
      +  "success"
      +]
  2. Changed12 schema fields changed
    • removedOutput schema / properties / mailbox / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / mailbox / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / matches / items / properties / from / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / matches / items / properties / from / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / matches / items / properties / sent_at / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / matches / items / properties / sent_at / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / matches / items / properties / snippet / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / matches / items / properties / snippet / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / matches / items / properties / subject / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / matches / items / properties / subject / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / resolved_workspace / properties / name / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / resolved_workspace / properties / name / type
      Added value: +[
      +  "string",
      +  "null"
      +]
  3. Changed1 schema field changed
    • changedOutput schema / properties / newly_connected / description
      Previous value: -"Tools that connected to this workspace since the last result and that no session was told about yet, oldest first. Present only when at least one tool is new. Start the reply with one line per entry, in the person's language: \"<name> is connected.\". Never fold several entries into one sentence. Each entry comes back once, on one result only: never repeat its line later."New value: +"Tools that connected to this workspace since the last result and that no session was told about yet, oldest first. Present only when at least one tool is new. The connected-line rule says when to tell an entry; when it does, one line per entry, in the person's language: \"<name> is connected.\". Never fold several entries into one sentence. Each entry comes back once, on one result only: never repeat its line later."
  4. Added

TDQS

A4.3/5.0
Behavior5/5

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

Discloses numerous behavioral traits beyond annotations: checks up to 3 grants per provider, returns up to max_results per mailbox with newest first, truncated_providers signals partial coverage, and explains statuses like no_mailbox, needs_reconnect, and unavailable. It also reinforces the read-only nature ('attaches nothing, imports nothing and contacts no one') and clarifies that another member's mailbox is never searched.

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?

The description is long (300+ words) but front-loads the core action and then systematically covers edge cases, statuses, and workspace handling. Every sentence provides useful information, though some tightening could improve scannability. It earns its length given the tool's complexity and output richness.

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, the description covers all necessary behavioral context: limitations (3 grants per provider), status interpretation, how to compare snippets, workspace selection, and read-only consequences. It anticipates common failure modes (no_mailbox, needs_reconnect, unavailable) and instructs how to respond, leaving no critical gaps for correct invocation.

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 high (88%), so the baseline is 3. The description adds meaning beyond the schema: max_results is 'from each mailbox' (not total), results are 'newest first', and workspace_id behavior is explained ('pass workspace_id on the call' when multiple workspaces). It doesn't elaborate on counterparty_name or counterparty_domain beyond schema, but it enriches several parameters.

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: 'Search the caller's own live Gmail and Outlook mailboxes for one supplier's messages in a date window.' This clearly distinguishes the tool's purpose from general email search or receipt listing siblings, though it does not explicitly name alternatives. The scope (live mailboxes, one supplier, date window) is precise.

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?

Gives concrete usage guidance: 'Use one call per supplier and widen the window by about a week on each side of the payment date' and explains how to interpret already_in_well and mailbox statuses. It stops short of naming specific alternative tools or when not to use it, but the operational context is strong.

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.

Resources