docs(gmail): default get_thread to MINIMAL; escalate to FULL_CONTENT only on body-parse#409
Merged
Merged
Conversation
…only on body-parse Profiling a 12-tracker bulk sync surfaced that Gmail get_thread calls were responsible for ~170 KB of in-context spillover (top single spillover file was 440 KB) — a FULL_CONTENT call on a long reporter conversation routinely lands 60-100K tokens. Most call sites only needed the chronologically-last message ID for anchoring, the SENT/ DRAFT label state, or the thread-exists check — all of which MINIMAL satisfies at ~5K tokens. Changes: 1. tools/gmail/operations.md — flip the default example from FULL_CONTENT to MINIMAL. Document a clear escalation rule: default to MINIMAL; escalate to FULL_CONTENT only when the call site actually processes the message body (Step 3 classification in security-issue-import, Step 1e reviewer-comment parsing in security-issue-sync, draft-composition that quotes the reporter's prior message, credit-form extraction). Also fix a longstanding terminology error: the doc said 'METADATA' but the MCP enum is 'MINIMAL'. 2. security-issue-sync Step 1e — make the FULL_CONTENT requirement explicit (reviewer comment bodies ARE the actionable signal). Reinforce the contrast with the rest of the skill, which defaults to MINIMAL. The privacy-LLM contract block was updated accordingly — the redact-after-fetch protocol applies to FULL_CONTENT calls; MINIMAL calls are exempt (they carry headers only, no free-form body content). Estimated savings: ~80% of Gmail-related tokens on typical bulk runs (60-100K → ~5K per call). Compounds on every bulk-sync invocation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Profiling a 12-tracker bulk sync surfaced that Gmail `get_thread` calls were responsible for ~170 KB of in-context spillover (single largest: 440 KB). Most call sites only needed the chronologically-last message ID, label state, or thread-exists check — all of which `MINIMAL` satisfies at ~5K tokens vs ~60-100K for `FULL_CONTENT` on a typical reporter conversation.
Changes
`tools/gmail/operations.md`
`security-issue-sync` Step 1e
Make the `FULL_CONTENT` requirement explicit — reviewer comment bodies ARE the actionable signal here. Reinforce the contrast with the rest of the skill, which defaults to `MINIMAL`.
Estimated savings
~80% of Gmail-related tokens on typical bulk runs (60-100K → ~5K per call). Compounds on every bulk-sync invocation.
Test plan
🤖 Generated with Claude Code