Skip to content

get_gmail_thread_content omits To/Cc headers, and include_analysis participants can miss recipients #963

Description

@noneck

Summary

get_gmail_thread_content returns per-message headers for From, Date, Subject, Message-ID, In-Reply-To, and References, but not To or Cc. There is no way to determine a message's recipients from the returned content.

include_analysis=true returns a participants array, which looks like it should cover this, but in at least one case it did not include everyone actually on the thread.

Impact

An agent reading a thread cannot reliably answer "who is on this conversation?" This matters most when drafting a reply: without recipients, you cannot construct a correct reply-all, and the omission is silent. The formatted output looks complete, so there is no signal that recipients were dropped rather than absent.

In our case an agent drafted a reply that was missing two recipients who were visibly Cc'd in the Gmail web UI. The failure was not detectable from the tool output alone.

Observed

Thread with 5 messages, body_format="text", include_analysis=true:

  • Zero lines in the ~55KB response begin with To: or Cc:. (Occurrences of To: in the body text are quoted reply chains inside message bodies, not structured headers.)
  • analysis.participants returned 4 addresses. At least two additional recipients were present on the thread in Gmail's UI and did not appear in that list or anywhere in the response.

The sender was on Outlook, if that is relevant to how the headers were populated.

Suggested fix

  1. Include To and Cc (and ideally Bcc where visible) in the per-message header block emitted by get_gmail_thread_content and get_gmail_message_content.
  2. Derive analysis.participants from the union of From/To/Cc across all messages, so it is complete by construction.
  3. If a header is unavailable rather than empty, emit something explicit so a caller can distinguish "no recipients" from "recipients not retrieved."

Point 3 matters most for agent use. A silently incomplete projection is worse than a documented gap, because the caller has no way to know to go looking.

Workaround

Fetch the message with body_format="raw" and parse the MIME headers directly.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions