Skip to content

Commit 8c92390

Browse files
committed
add message id headers for proper threading in in non-gmail clients
1 parent 52b0ff8 commit 8c92390

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

.beads/issues.jsonl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
{"id":"google_workspace_mcp-ic8","title":"enh: support writing hyperlink URLs in modify_sheet_values","description":"Issue #434 also requested hyperlink creation/writes. Current implementation reads hyperlinks in read_sheet_values but modify_sheet_values does not expose first-class hyperlink writes.","status":"open","priority":3,"issue_type":"task","owner":"tbarrettwilsdon@gmail.com","created_at":"2026-02-08T17:42:10.590658-05:00","created_by":"Taylor Wilsdon","updated_at":"2026-02-08T17:42:10.590658-05:00"}
1313
{"id":"google_workspace_mcp-jf2","title":"ci: make PyPI publish step rerun-safe with skip-existing","description":"GitHub Actions reruns on same tag fail because PyPI rejects duplicate file uploads. Add skip-existing=true to pypa/gh-action-pypi-publish so reruns proceed to MCP publish.","status":"closed","priority":2,"issue_type":"bug","owner":"tbarrettwilsdon@gmail.com","created_at":"2026-02-08T20:59:58.461102-05:00","created_by":"Taylor Wilsdon","updated_at":"2026-02-08T21:00:32.121469-05:00","closed_at":"2026-02-08T21:00:32.121469-05:00","close_reason":"Closed"}
1414
{"id":"google_workspace_mcp-qfl","title":"Fix stdio multi-account session binding","status":"in_progress","priority":1,"issue_type":"task","owner":"tbarrettwilsdon@gmail.com","created_at":"2026-02-07T13:27:09.466282-05:00","created_by":"Taylor Wilsdon","updated_at":"2026-02-07T13:27:22.857227-05:00"}
15+
{"id":"google_workspace_mcp-qr5","title":"fix: include RFC Message-ID threading headers in thread content output","status":"closed","priority":2,"issue_type":"bug","owner":"tbarrettwilsdon@gmail.com","created_at":"2026-02-11T11:44:41.966911-05:00","created_by":"Taylor Wilsdon","updated_at":"2026-02-11T11:46:11.355237-05:00","closed_at":"2026-02-11T11:46:11.355237-05:00","close_reason":"Closed"}
1516
{"id":"google_workspace_mcp-xia","title":"fix: CLI should unwrap FastAPI Body defaults when invoking tools","description":"CLI mode invokes tool functions directly and currently passes FastAPI Body marker objects as defaults for omitted args. This breaks gmail send/draft with errors like Body has no attribute lower/len. Update CLI invocation to normalize Param defaults and return clear missing-required errors.","status":"closed","priority":1,"issue_type":"bug","owner":"tbarrettwilsdon@gmail.com","created_at":"2026-02-10T12:33:06.83139-05:00","created_by":"Taylor Wilsdon","updated_at":"2026-02-10T12:36:35.051947-05:00","closed_at":"2026-02-10T12:36:35.051947-05:00","close_reason":"Implemented CLI FastAPI default normalization + regression tests","labels":["cli","gmail"]}
1617
{"id":"google_workspace_mcp-xt2","title":"Implement CLI mode for Workspace MCP","description":"Create a CLI mode for the Workspace MCP server, activated via --cli flag, that allows all tools to be used directly from the command line without running as an MCP server.\n\n**Goals:**\n- Add --cli startup flag to enable CLI mode\n- Expose all existing tools as CLI subcommands\n- No changes to individual tool implementations - reuse existing code\n- Lightweight and flexible design\n- Enable usage by coding agents (Codex, Claude Code) without MCP server overhead\n\n**Requirements:**\n- Parse tool name and arguments from command line\n- Route to existing tool handlers\n- Output results to stdout (JSON or human-readable)\n- Maintain same authentication/credential flow\n- Support all current tools without modification","status":"in_progress","priority":0,"issue_type":"task","owner":"tbarrettwilsdon@gmail.com","created_at":"2026-02-01T10:57:29.920078-05:00","created_by":"Taylor Wilsdon","updated_at":"2026-02-01T11:02:26.818109-05:00"}
1718
{"id":"google_workspace_mcp-y3j","title":"docs: add MCP registry publishing guidance for this server","status":"closed","priority":2,"issue_type":"task","owner":"tbarrettwilsdon@gmail.com","created_at":"2026-02-08T19:56:42.74673-05:00","created_by":"Taylor Wilsdon","updated_at":"2026-02-08T20:00:56.253918-05:00","closed_at":"2026-02-08T20:00:56.253918-05:00","close_reason":"Closed"}

gmail/gmail_tools.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,6 +1357,9 @@ def _format_thread_content(thread_data: dict, thread_id: str) -> str:
13571357
sender = headers.get("From", "(unknown sender)")
13581358
date = headers.get("Date", "(unknown date)")
13591359
subject = headers.get("Subject", "(no subject)")
1360+
rfc822_message_id = headers.get("Message-ID", "")
1361+
in_reply_to = headers.get("In-Reply-To", "")
1362+
references = headers.get("References", "")
13601363

13611364
# Extract both text and HTML bodies
13621365
payload = message.get("payload", {})
@@ -1376,6 +1379,13 @@ def _format_thread_content(thread_data: dict, thread_id: str) -> str:
13761379
]
13771380
)
13781381

1382+
if rfc822_message_id:
1383+
content_lines.append(f"Message-ID: {rfc822_message_id}")
1384+
if in_reply_to:
1385+
content_lines.append(f"In-Reply-To: {in_reply_to}")
1386+
if references:
1387+
content_lines.append(f"References: {references}")
1388+
13791389
# Only show subject if it's different from thread subject
13801390
if subject != thread_subject:
13811391
content_lines.append(f"Subject: {subject}")

0 commit comments

Comments
 (0)