MAILGENT

mail.get_thread

Get a full email thread with messages (newest 200 by default)

Scope: mail:read

Get the complete conversation — messages in chronological order, up to a configurable limit.

Parameters

NameTypeRequiredDescription
threadIdstringYesThread ID
limitnumberNoMax messages to return (default 200, max 500)

Example

Agent needs full context before replying.

→ mail.get_thread({ threadId: "thd_a3f91b00c4e2d7e8" })

Returns

Thread object with totalMessages count and a messages array ordered oldest to newest. Each message includes messageId, threadId, inboxId, from, to, cc, subject, text, extractedText, labels, createdAt.

This is the best way to give your LLM full conversation context before generating a reply.

Agent Pattern

1. mail.list_messages(labels: "unread")     → find new email
2. mail.get_thread(threadId: "...")          → full conversation
3. Feed thread messages to LLM              → generate reply
4. mail.reply(messageId: "...", text: "...") → send
5. mail.update_labels(addLabels: ["read"])   → mark done

REST Equivalent

GET /v0/threads/{threadId}

On this page