Skip to main content

Gmail - Summarize Thread

Generate AI-powered summaries of entire email thread conversations using advanced language models.

Overview

The Gmail Summarize Thread tool analyzes complete email conversations and generates concise, intelligent summaries using your choice of LLM (Large Language Model). Perfect for quickly understanding long email chains, extracting action items, and getting the gist of complex discussions.

Key Features:

  • Summarize entire email threads with AI
  • Support for multiple LLM providers (OpenAI, Anthropic, Google)
  • Flexible input (thread_id or message_id)
  • Control summary length and thread size
  • OAuth authentication for secure access
  • Optional user-provided LLM credentials

Common Use Cases:

  • Quickly understand long email conversations
  • Extract action items and decisions from threads
  • Get context on ongoing discussions
  • Summarize customer support threads
  • Review project discussions efficiently
  • Analyze team conversations for insights

Default Model: gemini-2.5-flash (fast, cost-effective)

Prerequisites

OAuth Authentication Required

This tool requires OAuth authentication. App Password accounts are not supported.

Follow our Google Account OAuth Setup Guide to:

  1. Create a Google Cloud project
  2. Enable Gmail API
  3. Create OAuth credentials
  4. Connect your account to Reeva

Optional: LLM Provider Credentials

You can optionally provide your own LLM credentials to:

  • Use your own API keys (OpenAI, Anthropic, or Google)
  • Avoid platform LLM token charges
  • Have full control over API usage

If you don't provide credentials, platform credentials will be used (base cost + token usage charged).

Using the Tool

1. Create a Summarize Thread Tool Instance

  1. Navigate to My Tools in Reeva
  2. Click Create New Tool
  3. Select Gmail - Summarize Thread from the base tools
  4. Give your tool a name (e.g., "Summarize Email Threads")
  5. Select your OAuth Gmail account
  6. (Optional) Link an LLM Provider account (OpenAI, Anthropic, or Google)
  7. Click Create

2. Summarize a Thread

Option A: Using thread_id (from Search tools):

{
"thread_id": "18a1b2c3d4e5f678"
}

Option B: Using message_id (from Read Email or Search tools):

{
"message_id": "18a1b2c3d4e5f678"
}

The tool will look up the thread for that message automatically.

3. Control Summary Parameters

Limit summary length:

{
"thread_id": "18a1b2c3d4e5f678",
"max_length": 300
}

Limit thread size (for very long threads):

{
"thread_id": "18a1b2c3d4e5f678",
"max_messages": 10
}

Choose a different model:

{
"thread_id": "18a1b2c3d4e5f678",
"model": "claude-sonnet-4-5"
}

Getting thread_id or message_id

From Search Tools:

From Read Email Tool:

  • Use Read Email to read a message
  • Response includes thread_id

Tool Parameters

ParameterTypeRequiredDefaultDescription
thread_idstring*-Gmail thread ID to summarize
message_idstring*-Gmail message ID (alternative to thread_id)
max_lengthintegerNo500Maximum summary length in words
max_messagesintegerNounlimitedMax messages to include from thread
modelstringNogemini-2.5-flashLLM model to use
use_thinkingbooleanNofalseEnable extended thinking (Claude Sonnet 4+ only)
thinking_budgetintegerNo5000Max thinking tokens (Claude only)

* Either thread_id OR message_id is required, not both

Parameter Details

thread_id vs message_id:

  • Use thread_id when you have it from Search tools (most common)
  • Use message_id when you only have a message ID
  • If you provide message_id, the tool looks up its thread automatically
  • Cannot provide both - choose one

max_length:

  • Controls summary word count
  • Default: 500 words
  • Range: 50-2000 words recommended
  • LLM will try to stay within this limit
  • Actual length may vary slightly

max_messages:

  • Limits how many messages from the thread to summarize
  • Useful for very long threads (100+ messages)
  • Messages are taken from the beginning of the thread
  • If thread has more messages, response includes truncated: true
  • Example: max_messages: 10 summarizes only first 10 messages

model:

  • Choose your preferred LLM
  • Default: gemini-2.5-flash (fast, cost-effective)
  • Premium options: claude-sonnet-4-5, gpt-5, gemini-2.5-pro
  • Budget options: claude-haiku-4-5, gpt-5-mini, gemini-2.5-flash-lite
  • See "LLM Models" section below for full list

use_thinking (Claude Sonnet 4+ only):

  • Enables extended thinking mode
  • Only works with Claude Sonnet 4 models
  • Does NOT work with Haiku or other models
  • Increases quality for complex threads
  • Costs more tokens

thinking_budget:

  • Controls max thinking tokens (Claude only)
  • Default: 5000 tokens
  • Only applies when use_thinking: true
  • Higher budget = deeper analysis, more cost

Response Format

Successful Summary

{
"summary": "The team discussed the Q4 product launch. Key points: launch date set for Dec 15, marketing campaign approved, engineering team needs 2 more weeks for testing. Action items: Sarah to finalize marketing materials, Mike to coordinate with QA team.",
"thread_id": "18a1b2c3d4e5f678",
"subject": "Q4 Product Launch Discussion",
"message_count": 8,
"participant_count": 5,
"date_range": "2024-12-01 10:30:00 to 2024-12-07 16:45:00",
"word_count": 48,
"success": true,
"token_usage": {
"input_tokens": 1500,
"output_tokens": 150
}
}

Response Fields

  • summary: AI-generated summary of the thread
  • thread_id: Gmail thread ID that was summarized
  • subject: Email subject line from the thread
  • message_count: Number of messages in the thread (or limited by max_messages)
  • participant_count: Number of unique participants
  • date_range: Time span of the conversation
  • word_count: Actual word count of the summary
  • success: Whether summarization succeeded
  • token_usage: LLM token consumption (input + output)
  • truncated (optional): True if thread was truncated by max_messages
  • total_messages (optional): Total messages if truncated
  • billing_note (optional): Present when using user credentials

Truncated Thread Response

{
"summary": "...",
"thread_id": "18a1b2c3d4e5f678",
"message_count": 10,
"truncated": true,
"total_messages": 47,
"..."
}

When max_messages limits the thread, you'll see:

  • truncated: true
  • total_messages: Full thread size
  • message_count: Number actually summarized

LLM Models

Supported Models

OpenAI (GPT):

  • gpt-5 - Latest GPT model, high quality
  • gpt-5-mini - Smaller, faster, more affordable
  • gpt-5.1 - Enhanced version
  • gpt-5.1-codex - Code-optimized (not recommended for email)
  • gpt-5.1-codex-mini - Smaller code model

Anthropic (Claude):

  • claude-sonnet-4-5 - Excellent balance, supports thinking
  • claude-sonnet-4 - High quality, supports thinking
  • claude-haiku-4-5 - Fast and affordable (no thinking)
  • claude-opus-4-5 - Highest quality, most expensive

Google (Gemini):

  • gemini-2.5-flash - Default, fast and cost-effective
  • gemini-2.5-pro - Higher quality, slower
  • gemini-2.5-flash-lite - Fastest, most affordable

Model Selection Guide

For most threads: gemini-2.5-flash (default)

  • Great quality
  • Fast responses
  • Cost-effective
  • Good balance

For complex/critical threads: claude-sonnet-4-5 or gpt-5

  • Highest quality summaries
  • Better at extracting action items
  • More nuanced understanding
  • Higher cost

For high-volume/simple threads: claude-haiku-4-5 or gemini-2.5-flash-lite

  • Very fast
  • Most affordable
  • Good for straightforward summaries

For deep analysis: claude-opus-4-5 with use_thinking: true

  • Best quality available
  • Extended thinking capability
  • Excellent for complex negotiations or technical discussions
  • Most expensive

Extended Thinking (Claude Sonnet 4+ Only)

Claude Sonnet 4 models support "extended thinking" mode:

{
"thread_id": "18a1b2c3d4e5f678",
"model": "claude-sonnet-4-5",
"use_thinking": true,
"thinking_budget": 10000
}

Benefits:

  • Deeper analysis of complex threads
  • Better identification of subtle points
  • More accurate action item extraction
  • Improved handling of contradictions

Note: Only works with Claude Sonnet 4 models (not Haiku, not other providers)

Billing

Cost Structure

Base Cost: 1 credit per summarization

Additional Costs (when using platform credentials):

  • Input tokens: Charged based on thread length
  • Output tokens: Charged based on summary length
  • Thinking tokens: Charged if extended thinking enabled (Claude only)

Total Cost Example (platform credentials):

  • Base: 1 credit
  • Thread with 2000 input tokens: ~X credits
  • Summary with 200 output tokens: ~Y credits
  • Total: 1 + X + Y credits

User vs Platform Credentials

ScenarioCostNotes
Platform credentials1 credit + token usageLLM usage charged separately
Your own credentials1 credit onlyNo token charges from Reeva

Response includes billing info:

  • token_usage: Always shown for transparency
  • billing_note: "User credentials used - only base cost charged" (when applicable)

Cost Optimization Tips

  1. Use your own LLM credentials to avoid token charges
  2. Use max_messages to limit long threads
  3. Use max_length to control summary size
  4. Choose cost-effective models (gemini-2.5-flash, claude-haiku-4-5)
  5. Avoid extended thinking unless needed for complex threads

OAuth vs App Password

FeatureOAuthApp Password
Summarize threads✅ Yes❌ Not supported
ReasonGmail API threads.get requiredIMAP doesn't support thread retrieval
SetupOAuth Setup GuideN/A

Why OAuth only?

The Gmail API provides rich thread data with proper message ordering, timestamps, and metadata. IMAP doesn't have a comparable thread retrieval mechanism that would work reliably.

⚠️ Critical: ID Format Incompatibility

You cannot mix App Password and OAuth authentication across tools:

  • App Password Search tools return IMAP IDs (numeric: 1830025676796881235)
  • OAuth Summarize Thread requires Gmail API IDs (hexadecimal: 18a1b2c3d4e5f678)
  • These formats are incompatible

Solution: Use OAuth for both your Search tools and Summarize Thread tool. If you use App Password for Search, you'll get thread_id: null and numeric message IDs that won't work with this tool.

Use Cases

1. Quick Catch-Up on Long Conversations

After being away, quickly understand what happened in a long email thread:

{
"thread_id": "18a1b2c3d4e5f678",
"max_length": 200
}

Get a 200-word summary to quickly catch up.

2. Extract Action Items from Team Discussions

{
"thread_id": "18a1b2c3d4e5f678",
"model": "claude-sonnet-4-5",
"max_length": 300
}

Claude excels at identifying action items, decisions, and next steps.

3. Summarize Customer Support Threads

{
"message_id": "18a1b2c3d4e5f678",
"max_length": 250
}

Use message_id from the latest customer message to summarize the entire support conversation.

4. Analyze Very Long Threads (100+ messages)

{
"thread_id": "18a1b2c3d4e5f678",
"max_messages": 20,
"max_length": 500
}

Limit to first 20 messages to avoid overwhelming the LLM and reduce costs.

5. Deep Analysis of Complex Negotiations

{
"thread_id": "18a1b2c3d4e5f678",
"model": "claude-sonnet-4-5",
"use_thinking": true,
"thinking_budget": 15000,
"max_length": 800
}

Use extended thinking for nuanced understanding of complex business negotiations.

6. Weekly Thread Digest

Workflow:
1. Search for threads from last week
2. For each thread, call Summarize Thread
3. Compile summaries into a weekly digest
4. Send digest email with all summaries

Automate weekly email catch-up.

Error Handling

Thread Not Found

{
"error": "Thread with ID '18a1b2c3d4e5f678' not found."
}

Causes:

  • Invalid thread_id
  • Thread deleted
  • Wrong Gmail account
  • Thread from different account

Solution:

  • Verify thread_id from Search tools
  • Check you're using correct Gmail account
  • Try searching for the thread first

Message Not Found

{
"error": "Message with ID '18a1b2c3d4e5f678' not found."
}

Causes:

  • Invalid message_id
  • Message deleted
  • Message from different account

Solution:

  • Verify message_id from Read Email or Search tools
  • Use thread_id instead if available

IMAP Message ID / Thread ID Incompatibility

{
"error": "The message_id '1830025676796881235' appears to be an IMAP X-GM-MSGID (numeric format), which is incompatible with this tool. This tool requires OAuth authentication and Gmail API message IDs (hexadecimal format like '18a1b2c3d4e5f678'). Solution: Use an OAuth Gmail account (not App Password) for your Search tools to get compatible message IDs and thread IDs."
}

Cause: Using message_id or thread_id from App Password Search tools with OAuth-only Summarize Thread tool

The Problem:

  • App Password Search tools return IMAP IDs (numeric like 1830025676796881235)
  • OAuth Summarize Thread tool requires Gmail API IDs (hexadecimal like 18a1b2c3d4e5f678)
  • These formats are incompatible and cannot be mixed

How to Identify This Issue:

  • Your message_id or thread_id is all numbers and 18-19 digits long
  • Search tools returned thread_id: null
  • You're using different authentication for Search vs Summarize Thread

Solution:

  1. Switch your Search tool instance to use an OAuth Gmail account (not App Password)
  2. Re-run your search - you'll get proper Gmail API format IDs
  3. Use those hexadecimal IDs with Summarize Thread

Example Workflow:

Step 1: Use OAuth account for Search
Tool: Gmail Simple Search (with OAuth account)
Input: { "query": "from:sender@example.com" }

Step 2: Get proper Gmail API IDs
Response will include:
{
"message_id": "18a1b2c3d4e5f678", ✓ Valid (hexadecimal)
"thread_id": "18a1b2c3d4e5f678", ✓ Valid (not null)
...
}

Step 3: Use with Summarize Thread
Input: { "thread_id": "18a1b2c3d4e5f678" }

Important: Since Summarize Thread is OAuth-only, you must use OAuth for the entire workflow (search → summarize) to avoid ID format mismatches.

Missing Input

{
"error": "Either thread_id or message_id is required"
}

Cause: Neither thread_id nor message_id provided

Solution: Provide one of the two IDs

Both IDs Provided

{
"error": "Provide either thread_id or message_id, not both"
}

Cause: Both thread_id and message_id in the same request

Solution: Choose one ID to use

App Password Authentication

{
"error": "Summarize Thread requires OAuth authentication. App Password is not supported."
}

Cause: Using App Password account instead of OAuth

Solution: Set up OAuth authentication: OAuth Setup Guide

Model Not Allowed

{
"error": "Model not allowed. gpt-5-pro and gpt-5-codex are not available for this tool."
}

Cause: Trying to use forbidden models

Solution: Choose from supported models (see "LLM Models" section)

LLM API Error

{
"error": "Failed to summarize thread: [LLM error details]"
}

Causes:

  • LLM provider API issue
  • Invalid API key (if using user credentials)
  • Rate limit exceeded
  • Model unavailable

Solution:

  • Check LLM provider status
  • Verify API key is valid
  • Wait and retry if rate limited
  • Try a different model

Tips

  1. ⚠️ Use OAuth for ALL Gmail tools in your workflow - If you use App Password for Search tools, you'll get numeric IMAP IDs that are incompatible with this OAuth-only tool. Use OAuth everywhere to avoid ID format mismatches.

  2. Start with thread_id when available - it's more direct than looking up from message_id

  3. Use max_messages for very long threads - threads with 50+ messages can be expensive and may exceed model context limits

  4. Choose the right model for the job:

    • Simple threads: gemini-2.5-flash (default)
    • Complex analysis: claude-sonnet-4-5
    • High volume: claude-haiku-4-5 or gemini-2.5-flash-lite
  5. Adjust max_length based on thread complexity:

    • Short threads (2-5 messages): 200-300 words
    • Medium threads (6-15 messages): 300-500 words
    • Long threads (16+ messages): 500-800 words
  6. Use your own LLM credentials to avoid token charges from Reeva

  7. Extended thinking is expensive - only use for genuinely complex threads

  8. Check token_usage in response to understand costs

  9. The summary includes action items automatically - the prompt is optimized to extract them

Limitations

  1. OAuth Only: App Password authentication is not supported

  2. Thread Format: Only works with Gmail threads, not individual emails

  3. Language: Summarization quality depends on email language (English works best)

  4. Thread Size: Very large threads (100+ messages) may need max_messages limit

  5. Model Context: Each model has token limits (typically 30K-200K tokens)

  6. Thinking Support: Extended thinking only works with Claude Sonnet 4 models

  7. Real-time: Not suitable for instant summarization - takes a few seconds

  8. Attachments: Attachment content is not analyzed (only mentioned if in email body)

Troubleshooting

Summary Seems Incomplete

Cause: Thread truncated by max_messages or LLM context limit

Solution:

  • Check if response has truncated: true
  • Remove or increase max_messages parameter
  • Try a model with larger context (claude-opus-4-5, gpt-5)

Summary Too Brief

Cause: max_length too small for thread complexity

Solution:

  • Increase max_length (try 800-1000 words)
  • Use a model with better instruction following

Summary Misses Key Points

Cause: Model not powerful enough or thread too complex

Solution:

  • Upgrade to claude-sonnet-4-5 or gpt-5
  • Enable extended thinking: use_thinking: true (Claude only)
  • Increase thinking_budget to 10000+

"Thread contains no messages" Error

Cause: Thread is empty or data malformed

Solution:

  • Verify thread exists with Search tools
  • Try reading one message from the thread first
  • Thread may be in a weird state - contact support

High Token Usage / Cost

Cause: Long thread or detailed summary

Solution:

  • Use max_messages to limit thread size
  • Reduce max_length
  • Switch to more efficient model (gemini-2.5-flash-lite)
  • Provide your own LLM credentials to avoid token charges

Summary in Wrong Language

Cause: Thread in non-English language

Solution:

  • Model will try to summarize in the email's language
  • For best results, specify language in a custom prompt (not supported natively)
  • Use gpt-5 or claude-opus-4-5 for better multilingual support

Workflow Examples

Complete Thread Analysis Workflow

Step 1: Find threads to summarize
Tool: Gmail Simple Search
Input: { "query": "subject:Project Alpha", "max_results": 10 }

Step 2: Review thread list
Identify thread_id from results

Step 3: Summarize the thread
Tool: Gmail Summarize Thread
Input: { "thread_id": "18a1b2c3d4e5f678" }

Step 4: Review summary
Check for action items and key decisions

Step 5: (Optional) Create draft response
Tool: Gmail Create Draft
Use insights from summary to draft reply

Weekly Email Digest Workflow

Step 1: Search for this week's threads
Tool: Gmail Advanced Search
Input: { "after_date": "2024/12/01", "label": "INBOX" }

Step 2: For each thread in results:
- Call Summarize Thread with thread_id
- Collect summary + metadata

Step 3: Compile all summaries
Format as weekly digest document

Step 4: Send digest
Tool: Gmail Send Email
Send compiled digest to yourself or team

Customer Support Summary Workflow

Step 1: Customer sends new message
Trigger: New email in support inbox

Step 2: Get message details
Tool: Gmail Read Email
Get message_id and customer info

Step 3: Summarize entire conversation
Tool: Gmail Summarize Thread
Input: { "message_id": "[from step 2]", "max_length": 300 }

Step 4: Display summary to support agent
Show summary in support dashboard
Agent has instant context before responding

Support

Need help? Reach out to our support team or join our Discord community.