feat(tools): add gmail.read tool for full email content

The existing gmail.list and gmail.search tools only return snippets.
gmail.read fetches the full message by ID using format: 'full', decodes
base64url body parts (preferring text/plain, falling back to stripped
HTML), and returns headers + body text. This enables workflows like
searching for invoices and extracting amounts from the full content.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
William Valentin
2026-02-10 12:01:49 -08:00
parent d39d3ac367
commit 50471d63af
3 changed files with 232 additions and 5 deletions
+3 -1
View File
@@ -22,6 +22,7 @@ const PROFILE_TOOLS: Record<ToolProfile, Set<string>> = {
'web.search',
'gmail.list',
'gmail.search',
'gmail.read',
'calendar.today',
'calendar.list',
'calendar.search',
@@ -37,6 +38,7 @@ const PROFILE_TOOLS: Record<ToolProfile, Set<string>> = {
'web.search',
'gmail.list',
'gmail.search',
'gmail.read',
'calendar.today',
'calendar.list',
'calendar.search',
@@ -67,7 +69,7 @@ export const TOOL_GROUPS: Record<string, string[]> = {
'group:runtime': ['shell.exec', 'process.start', 'process.output', 'process.status', 'process.kill', 'process.list'],
'group:web': ['web.fetch', 'web.search', 'browser.navigate', 'browser.screenshot', 'browser.click', 'browser.type', 'browser.content', 'browser.eval'],
'group:memory': ['memory.read', 'memory.write', 'memory.search'],
'group:gmail': ['gmail.list', 'gmail.search'],
'group:gmail': ['gmail.list', 'gmail.search', 'gmail.read'],
'group:gcal': ['calendar.today', 'calendar.list', 'calendar.search'],
};