docs(skills): document bounded Gmail message retrieval in resources_gmail - #144
Merged
Merged
Conversation
major-connector-app
Bot
requested review from
jasonzbao,
josegironn and
rishikesh-major
as code owners
July 30, 2026 23:04
rishikesh-major
approved these changes
Jul 30, 2026
PR #1978 (MAJ-344) made gmail_get_message(format="full") return a
normalized, size-bounded message instead of the raw Gmail payload. The
resources_gmail skill still described the old raw shape, so agents had no
way to know the body arrives decoded or that truncation is reported.
- describe the two-step read: gmail_list_messages for IDs, then
gmail_get_message with format="metadata" for headers or the default
format="full" for content
- document the normalized full response: selected headers, decoded text at
body.value.body.text, truncated / originalChars, and bounded attachment
metadata with no base64 payloads
- state that base64-decoding the text, or persisting the response to
Read/grep/parse it back, is unnecessary
- note that only format="full" is normalized; metadata/minimal/raw and
Gmail error envelopes pass through unchanged
- reserve gmail_invoke for what the typed tools don't cover (complete
threads) and document that its query values are arrays, e.g.
{"format":["metadata"]}
- correct the TypeScript client example, which is a thin wrapper over the
raw Gmail API and is NOT subject to the MCP tool's normalization
The documented JSON example was generated from the real normalizer output,
so it matches field-for-field.
Built on major.build
Co-Authored-By: Major <ai-coder@major.build>
rishikesh-major
force-pushed
the
rishikesh/gmail-skill-bounded-message-docs
branch
from
July 30, 2026 23:25
5076a6c to
6a2643f
Compare
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
PR #1978 (MAJ-344) made
gmail_get_message(format="full")return a normalized, size-bounded message instead of the raw Gmail payload. Theresources_gmailskill still documented the old raw shape, so agents had no way to know the body arrives already decoded, that truncation is reported, or thatgmail_invokeis no longer the way to read a message.Changes
gmail_list_messagesfor IDs →gmail_get_messagewithformat="metadata"for headers only, or the defaultformat="full"for content.body.value.body.text,body.value.body.truncated,body.value.body.originalChars, and bounded attachment metadata (filename/mimeType/size/attachmentId, never base64 payloads) plusattachmentsTruncated.Read/grep/parse it back.gmail_invokescoped to a fallback for what the typed tools don't cover — chiefly fetching complete threads — and documents that itsqueryvalues are arrays:{"format":["metadata"]}, never{"format":"metadata"}.format="full"is normalized;metadata/minimal/rawand Gmail error envelopes pass through unchanged (verified inhandleGmailGetMessage).gmailClient.invokeexample is a thin wrapper over the raw Gmail API and is not subject to the MCP tool's normalization — it previously suggestedformat: "full"as if it returned parsed content.Verification
The documented JSON example was generated from the real
normalizeGmailMessageResultoutput against a fixture, so it matches the implementation field-for-field (including field order).Frontmatter still matches ai-coder's
CONNECTOR_SKILL_NAMEregex (name: using-gmail-connector), so the skill continues to be installed for Gmail-scoped agents.Docs-only change — no CLI code touched, so there is nothing to build or test here.
Follow-up (not in this PR)
I also wrote tests in mono-builder pinning this behavior (metadata retrieval, bounded full retrieval, and the
gmail_invokearray-query contract) — extendinggo-common/resourcemcps/gmail_test.go. Held back per review preference;go test ./go-common/resourcemcps/andgo vetpass locally with them.🤖 Generated with Claude Code