Skip to main content
Glama
Thunderbird MCP by Commonpost

Thunderbird MCP by Commonpost

Search Mail

searchMessages
Read-onlyIdempotent

Search Thunderbird message headers across accounts, skipping Trash/Junk, by sender, recipient, subject, date, or attachment; returns paginated IDs and folder paths for follow-up retrieval.

Instructions

Search message headers across accounts (Trash/Junk skipped); for the latest mail with no query, getRecentMessages. Returns { messages, totalMatches, offset, limit, hasMore }; each row has id + folderPath for getMessage/getMessages. For a company use query 'participant:@domain' with groupBy.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "searchMessages"
  }
}

Input Schema

NameRequiredDescriptionDefault
tagNoTag label or key (e.g. 'Important' or '$label1'); an unknown one returns the list
queryYesWords that must all match (subject, from, to, cc, preview). Operators: from:, to:, cc:, subject:, participant: (from/to/cc/bcc; '@domain' = addresses in that domain, commas = any of them: 'participant:@a.com,@b.com'); quote phrases, e.g. 'participant:@acme.com subject:"invoice 42"'. A single leading operator applies to all words ('from:Alice Smith'). Empty string matches all.
fieldsNoOnly these row columns (id, folderPath and option columns always); not with countOnly, groupBy or legacy
formatNo'table': messages as { columns, rows }, fewer tokens. 'legacy' (deprecated): the 0.10 output, a plain array of full rows unless offset is passed; not with groupBy
offsetNoRows to skip; use with hasMore
endDateNoISO 8601 date: on or before; date-only includes the whole day
groupByNoCollapse matches into one row per sender or conversation: count, unread, first/last date, latestId + latestFolderPath of the newest non-draft message, drafts count
threadOfNoThe whole conversation of this message across folders (Sent included), oldest first; a Re: without threading headers joins by subject the earlier message its sender took part in (linkedBy: subject). Reads 10,000 headers at most, else incomplete: true (narrow with folderPath)
countOnlyNoReturn only { count }
sortOrderNoBy date; default desc, asc with threadOf
startDateNoISO 8601 date: on or after
folderPathNoFolder URI (from listFolders) to search, with subfolders
maxResultsNoRows (or groups) per page
searchBodyNoFull-text search of subject, body and attachment names via the Gloda index (slower): words or "quoted phrases", all must match, no operators; terms under 3 characters are ignored; English matches other word forms, other languages only the exact form. IMAP needs offline sync.
unreadOnlyNoOnly unread
flaggedOnlyNoOnly flagged/starred
includeTrashNoAlso search Trash and Junk
attachmentNameNoOnly messages with an attachment whose filename contains this (any case); rows list them
attachmentTypeNoSame for a MIME type or prefix ('application/pdf', 'image/'). Reads local copies, 500 at most; attachmentSearch counts skipped ones
dedupByMessageIdNoCollapse copies of one message in several folders into one row with dupLocations
includeSubfoldersNoSearch subfolders of folderPath

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.24.0
    • changedInput schema / properties / tag / description
      Previous value: -"Tag label or key (e.g. 'Important' or '$label1')"New value: +"Tag label or key (e.g. 'Important' or '$label1'); an unknown one returns the list"
  2. Changed4 schema fields changedv0.19.2
    • addedInput schema / properties / fields
      Added value: +{
      +  "description": "Only these row columns (id, folderPath and option columns always); not with countOnly, groupBy or legacy",
      +  "items": {
      +    "enum": [
      +      "date",
      +      "author",
      +      "recipients",
      +      "ccList",
      +      "subject",
      +      "read",
      +      "flagged",
      +      "tags",
      +      "preview",
      +      "dupLocations"
      +    ],
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedInput schema / properties / format / description
      Previous value: -"'table': messages as { columns, rows }, fewer tokens. 'legacy' (deprecated, to be removed): the 0.10 output, a plain array of full rows (threadId, folder, whole preview) unless offset is passed, 50 rows by default; not with groupBy"New value: +"'table': messages as { columns, rows }, fewer tokens. 'legacy' (deprecated): the 0.10 output, a plain array of full rows unless offset is passed; not with groupBy"
    • changedInput schema / properties / searchBody / description
      Previous value: -"Full-text search of subject, body and attachment names via the Gloda index (slower). Query: words or \"quoted phrases\", all must match, no operators; terms under 3 characters are ignored; English words match other forms (stemming), other languages only the exact form. IMAP needs offline sync."New value: +"Full-text search of subject, body and attachment names via the Gloda index (slower): words or \"quoted phrases\", all must match, no operators; terms under 3 characters are ignored; English matches other word forms, other languages only the exact form. IMAP needs offline sync."
    • changedInput schema / properties / threadOf / description
      Previous value: -"Return the whole conversation of this message across folders (incl. Sent), oldest first. A Re: message without threading headers joins by subject the earlier message its sender took part in (linkedBy: subject). Reads at most 10,000 headers, else incomplete: true (narrow with folderPath)"New value: +"The whole conversation of this message across folders (Sent included), oldest first; a Re: without threading headers joins by subject the earlier message its sender took part in (linkedBy: subject). Reads 10,000 headers at most, else incomplete: true (narrow with folderPath)"
  3. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, so the safety profile is covered; the description adds the non-obvious behavioral fact that only headers are searched by default and that Trash/Junk are skipped. It also summarizes the response envelope (messages, totalMatches, offset, limit, hasMore), which is the main uncertainty for a paged tool. It stops short of mentioning the header-read caps and IMAP sync caveat that live only in the schema.

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, then return shape, then the two actionable recipes; nearly every clause carries information. It is dense with parentheticals and would scan faster as short sentences, but there is no filler.

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?

For a 21-parameter tool with no output schema, the description supplies the essentials: what is searched (headers), what is excluded (Trash/Junk), what comes back, and how to chain into getMessage. Details on groupBy rows, countOnly and attachment search are delegated to a fully documented schema, so nothing critical 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 goes beyond it by showing how parameters interact — 'participant:@domain' combined with groupBy, and id/folderPath as the handoff to getMessage. It doesn't restate the enum or date semantics, correctly leaving that to 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 and resource ('Search message headers across accounts') plus a scope constraint (Trash/Junk skipped), and distinguishes itself from getRecentMessages by naming the no-query case. It also names what the rows carry (id + folderPath) so the agent knows getMessage/getMessages consume the output.

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 an explicit routing rule ('for the latest mail with no query, getRecentMessages') and a concrete usage pattern for a common intent ('For a company use query participant:@domain with groupBy'). Both the when-to-use-this and the when-to-use-the-alternative conditions are spelled out rather than implied.

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