-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtools.js
More file actions
92 lines (86 loc) · 31.1 KB
/
tools.js
File metadata and controls
92 lines (86 loc) · 31.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
export const SECTION_TOOLS = [
{ name: 'docs_get_sections', description: 'parse doc return sections with name level start end indices', inputSchema: { type: 'object', properties: { doc_id: { type: 'string', description: 'Google Doc ID' } }, required: ['doc_id'] } },
{ name: 'docs_section', description: 'delete move or replace section by name or index', inputSchema: { type: 'object', properties: { doc_id: { type: 'string', description: 'Google Doc ID' }, action: { type: 'string', enum: ['delete', 'move', 'replace'], description: 'action to perform' }, section: { oneOf: [{ type: 'string', description: 'section name' }, { type: 'number', description: 'section index 0-based' }], description: 'section to act on' }, target: { oneOf: [{ type: 'string', description: 'start end or section name to move before' }, { type: 'number', description: 'target position index 0-based' }], description: 'where to move section for move action' }, content: { type: 'string', description: 'new content for replace action' }, preserve_heading: { type: 'boolean', description: 'keep heading for replace default true', default: true } }, required: ['doc_id', 'action', 'section'] } }
];
export const MEDIA_TOOLS = [
{ name: 'docs_image', description: 'insert list delete or replace image in doc', inputSchema: { type: 'object', properties: { doc_id: { type: 'string', description: 'Google Doc ID' }, action: { type: 'string', enum: ['insert', 'list', 'delete', 'replace'], description: 'action to perform' }, image_url: { type: 'string', description: 'image URL for insert or replace' }, image_index: { type: 'number', description: 'image index 0-based for delete or replace' }, position: { oneOf: [{ type: 'string', description: 'end or text to insert after' }, { type: 'number', description: 'character index' }], description: 'where to insert default end' }, width: { type: 'number', description: 'width in points' }, height: { type: 'number', description: 'height in points' } }, required: ['doc_id', 'action'] } }
];
export const DRIVE_TOOLS = [
{ name: 'drive_search', description: 'search Google Drive for docs and sheets by name or content', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'search query matches name and content' }, type: { type: 'string', enum: ['all', 'docs', 'sheets'], description: 'file type filter default all', default: 'all' }, max_results: { type: 'number', description: 'max results default 20', default: 20 } }, required: ['query'] } },
{ name: 'drive_upload', description: 'upload a local file to Google Drive', inputSchema: { type: 'object', properties: { file_path: { type: 'string', description: 'absolute or relative path to the local file' }, mime_type: { type: 'string', description: 'MIME type override auto-detected from extension if omitted' }, parent_folder_id: { type: 'string', description: 'Drive folder ID to upload into optional' }, file_name: { type: 'string', description: 'name to give the file in Drive defaults to local filename' } }, required: ['file_path'] } },
{ name: 'drive_get_download_url', description: 'get a direct download URL for a Drive file', inputSchema: { type: 'object', properties: { file_id: { type: 'string', description: 'Drive file ID' } }, required: ['file_id'] } },
{ name: 'drive_copy', description: 'copy a Drive file', inputSchema: { type: 'object', properties: { file_id: { type: 'string', description: 'source file ID' }, name: { type: 'string', description: 'name for copy' }, parent_folder_id: { type: 'string', description: 'destination folder ID' } }, required: ['file_id'] } },
{ name: 'drive_manage_access', description: 'share or unshare a Drive file', inputSchema: { type: 'object', properties: { file_id: { type: 'string', description: 'Drive file ID' }, action: { type: 'string', enum: ['share', 'unshare', 'list'], description: 'action to perform' }, email: { type: 'string', description: 'email for share' }, role: { type: 'string', enum: ['reader', 'writer', 'commenter', 'owner'], description: 'permission role default reader', default: 'reader' }, permission_id: { type: 'string', description: 'permission ID for unshare' } }, required: ['file_id', 'action'] } }
];
export const DOCS_TOOLS = [
{ name: 'docs_create', description: 'create new doc with optional formatted content (HTML/Markdown/plain text); returns id and title', inputSchema: { type: 'object', properties: { title: { type: 'string', description: 'doc title' }, content: { type: 'string', description: 'initial content as HTML or Markdown (renders as formatted doc)' } }, required: ['title'] } },
{ name: 'docs_read', description: 'read doc text content', inputSchema: { type: 'object', properties: { doc_id: { type: 'string', description: 'Google Doc ID' } }, required: ['doc_id'] } },
{ name: 'docs_edit', description: 'replace text in doc old_text must be unique unless replace_all true', inputSchema: { type: 'object', properties: { doc_id: { type: 'string', description: 'Google Doc ID' }, old_text: { type: 'string', description: 'text to find and replace' }, new_text: { type: 'string', description: 'replacement text' }, replace_all: { type: 'boolean', description: 'replace all occurrences default false', default: false } }, required: ['doc_id', 'old_text', 'new_text'] } },
{ name: 'docs_insert', description: 'insert text at position end index or after text', inputSchema: { type: 'object', properties: { doc_id: { type: 'string', description: 'Google Doc ID' }, text: { type: 'string', description: 'text to insert' }, position: { oneOf: [{ type: 'string', description: 'end or text to insert after' }, { type: 'number', description: 'character index' }], description: 'where to insert default end' } }, required: ['doc_id', 'text'] } },
{ name: 'docs_get_info', description: 'get doc metadata title dates owners', inputSchema: { type: 'object', properties: { doc_id: { type: 'string', description: 'Google Doc ID' } }, required: ['doc_id'] } },
{ name: 'docs_list', description: 'list docs optionally filtered by name', inputSchema: { type: 'object', properties: { max_results: { type: 'number', description: 'max docs default 20', default: 20 }, query: { type: 'string', description: 'search query to filter by name' } } } },
{ name: 'docs_format', description: 'format text bold italic colors fonts alignment headings', inputSchema: { type: 'object', properties: { doc_id: { type: 'string', description: 'Google Doc ID' }, search_text: { type: 'string', description: 'text to format must exist in doc' }, bold: { type: 'boolean', description: 'apply bold' }, italic: { type: 'boolean', description: 'apply italic' }, underline: { type: 'boolean', description: 'apply underline' }, strikethrough: { type: 'boolean', description: 'apply strikethrough' }, font_size: { type: 'number', description: 'font size in points' }, font_family: { type: 'string', description: 'font family name' }, foreground_color: { type: 'string', description: 'text color hex' }, background_color: { type: 'string', description: 'highlight color hex' }, heading: { type: 'string', enum: ['TITLE', 'SUBTITLE', 'HEADING_1', 'HEADING_2', 'HEADING_3', 'HEADING_4', 'HEADING_5', 'HEADING_6', 'NORMAL_TEXT'], description: 'heading style' }, alignment: { type: 'string', enum: ['LEFT', 'CENTER', 'RIGHT', 'JUSTIFY'], description: 'paragraph alignment' } }, required: ['doc_id', 'search_text'] } },
{ name: 'docs_insert_table', description: 'insert table with rows and cols', inputSchema: { type: 'object', properties: { doc_id: { type: 'string', description: 'Google Doc ID' }, rows: { type: 'number', description: 'number of rows' }, cols: { type: 'number', description: 'number of columns' }, position: { oneOf: [{ type: 'string', description: 'end or text to insert after' }, { type: 'number', description: 'character index' }], description: 'where to insert default end' } }, required: ['doc_id', 'rows', 'cols'] } },
{ name: 'docs_delete', description: 'delete text from doc', inputSchema: { type: 'object', properties: { doc_id: { type: 'string', description: 'Google Doc ID' }, text: { type: 'string', description: 'text to delete' }, delete_all: { type: 'boolean', description: 'delete all occurrences default false', default: false } }, required: ['doc_id', 'text'] } },
{ name: 'docs_get_structure', description: 'get doc structure headings hierarchy', inputSchema: { type: 'object', properties: { doc_id: { type: 'string', description: 'Google Doc ID' } }, required: ['doc_id'] } },
{ name: 'docs_batch', description: 'execute multiple doc operations in one batch', inputSchema: { type: 'object', properties: { doc_id: { type: 'string', description: 'Google Doc ID' }, operations: { type: 'array', description: 'array of operations type insert delete format with params', items: { type: 'object' } } }, required: ['doc_id', 'operations'] } },
{ name: 'docs_find_replace', description: 'find and replace all occurrences of text in doc', inputSchema: { type: 'object', properties: { doc_id: { type: 'string', description: 'Google Doc ID' }, find_text: { type: 'string', description: 'text to find' }, replace_text: { type: 'string', description: 'replacement text' }, match_case: { type: 'boolean', description: 'case sensitive default false', default: false } }, required: ['doc_id', 'find_text', 'replace_text'] } },
{ name: 'docs_export_pdf', description: 'export doc as PDF returns base64 encoded data', inputSchema: { type: 'object', properties: { doc_id: { type: 'string', description: 'Google Doc ID' } }, required: ['doc_id'] } },
{ name: 'docs_as_markdown', description: 'get doc content as markdown with formatting', inputSchema: { type: 'object', properties: { doc_id: { type: 'string', description: 'Google Doc ID' } }, required: ['doc_id'] } }
];
export const SCRIPTS_TOOLS = [
{ name: 'scripts_search', description: 'search Google Apps Script projects by name or content', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'search query for script name/content' }, max_results: { type: 'number', description: 'max results default 20', default: 20 } }, required: ['query'] } },
{ name: 'scripts_create', description: 'create apps script project attached to spreadsheet', inputSchema: { type: 'object', properties: { sheet_id: { type: 'string', description: 'Google Sheet ID' }, script_name: { type: 'string', description: 'script project name' } }, required: ['sheet_id', 'script_name'] } },
{ name: 'scripts_list', description: 'list scripts attached to spreadsheet', inputSchema: { type: 'object', properties: { sheet_id: { type: 'string', description: 'Google Sheet ID' } }, required: ['sheet_id'] } },
{ name: 'scripts_read', description: 'read script content including all files', inputSchema: { type: 'object', properties: { sheet_id: { type: 'string', description: 'Google Sheet ID' }, script: { oneOf: [{ type: 'string', description: 'script name or ID' }, { type: 'number', description: 'script index 0-based' }], description: 'script to read' } }, required: ['sheet_id', 'script'] } },
{ name: 'scripts_write', description: 'write or edit script file content mode edit for old_text new_text replacement mode write for full overwrite', inputSchema: { type: 'object', properties: { sheet_id: { type: 'string', description: 'Google Sheet ID' }, script: { oneOf: [{ type: 'string', description: 'script name or ID' }, { type: 'number', description: 'script index 0-based' }], description: 'script to modify' }, file_name: { type: 'string', description: 'file name in script' }, mode: { type: 'string', enum: ['write', 'edit'], description: 'write for full overwrite edit for replacement default write', default: 'write' }, content: { type: 'string', description: 'full content for write mode' }, old_text: { type: 'string', description: 'text to find for edit mode' }, new_text: { type: 'string', description: 'replacement text for edit mode' }, replace_all: { type: 'boolean', description: 'replace all occurrences for edit mode default false', default: false }, file_type: { type: 'string', enum: ['SERVER_JS', 'HTML'], description: 'file type for new files default SERVER_JS', default: 'SERVER_JS' } }, required: ['sheet_id', 'script', 'file_name'] } },
{ name: 'scripts_delete', description: 'delete script from spreadsheet', inputSchema: { type: 'object', properties: { sheet_id: { type: 'string', description: 'Google Sheet ID' }, script: { oneOf: [{ type: 'string', description: 'script name or ID' }, { type: 'number', description: 'script index 0-based' }], description: 'script to delete' } }, required: ['sheet_id', 'script'] } },
{ name: 'scripts_run', description: 'execute function in script must be deployed as API executable', inputSchema: { type: 'object', properties: { sheet_id: { type: 'string', description: 'Google Sheet ID' }, script: { oneOf: [{ type: 'string', description: 'script name or ID' }, { type: 'number', description: 'script index 0-based' }], description: 'script containing function' }, function_name: { type: 'string', description: 'function to execute' }, parameters: { type: 'array', description: 'parameters to pass', items: {} } }, required: ['sheet_id', 'script', 'function_name'] } },
{ name: 'scripts_sync', description: 'verify all tracked scripts exist and remove stale entries', inputSchema: { type: 'object', properties: { sheet_id: { type: 'string', description: 'Google Sheet ID' } }, required: ['sheet_id'] } }
];
export const SHEETS_TOOLS = [
{ name: 'sheets_create', description: 'create new spreadsheet returns id and title', inputSchema: { type: 'object', properties: { title: { type: 'string', description: 'spreadsheet title' } }, required: ['title'] } },
{ name: 'sheets_read', description: 'read values from range returns 2D array', inputSchema: { type: 'object', properties: { sheet_id: { type: 'string', description: 'Google Sheet ID' }, range: { type: 'string', description: 'A1 range default Sheet1' } }, required: ['sheet_id'] } },
{ name: 'sheets_edit', description: 'update values in range overwrites with new values', inputSchema: { type: 'object', properties: { sheet_id: { type: 'string', description: 'Google Sheet ID' }, range: { type: 'string', description: 'A1 range' }, values: { type: 'array', items: { type: 'array', items: {} }, description: '2D array of values' } }, required: ['sheet_id', 'range', 'values'] } },
{ name: 'sheets_insert', description: 'append rows after existing data', inputSchema: { type: 'object', properties: { sheet_id: { type: 'string', description: 'Google Sheet ID' }, range: { type: 'string', description: 'A1 range default Sheet1' }, values: { type: 'array', items: { type: 'array', items: {} }, description: '2D array of values to append' } }, required: ['sheet_id', 'values'] } },
{ name: 'sheets_get_cell', description: 'get single cell value', inputSchema: { type: 'object', properties: { sheet_id: { type: 'string', description: 'Google Sheet ID' }, cell: { type: 'string', description: 'cell reference A1 or Sheet1!B2' } }, required: ['sheet_id', 'cell'] } },
{ name: 'sheets_set_cell', description: 'set single cell value replaces content', inputSchema: { type: 'object', properties: { sheet_id: { type: 'string', description: 'Google Sheet ID' }, cell: { type: 'string', description: 'cell reference A1 or Sheet1!B2' }, value: { description: 'value to set' } }, required: ['sheet_id', 'cell', 'value'] } },
{ name: 'sheets_edit_cell', description: 'replace text in cell old_text must be unique unless replace_all true', inputSchema: { type: 'object', properties: { sheet_id: { type: 'string', description: 'Google Sheet ID' }, cell: { type: 'string', description: 'cell reference' }, old_text: { type: 'string', description: 'text to find and replace' }, new_text: { type: 'string', description: 'replacement text' }, replace_all: { type: 'boolean', description: 'replace all occurrences default false', default: false } }, required: ['sheet_id', 'cell', 'old_text', 'new_text'] } },
{ name: 'sheets_find_replace', description: 'find and replace text across all cells in sheet', inputSchema: { type: 'object', properties: { sheet_id: { type: 'string', description: 'Google Sheet ID' }, find: { type: 'string', description: 'text to find' }, replace: { type: 'string', description: 'replacement text' }, sheet_name: { type: 'string', description: 'tab name optional searches all if omitted' } }, required: ['sheet_id', 'find', 'replace'] } },
{ name: 'sheets_get_info', description: 'get spreadsheet metadata title tabs dimensions owners', inputSchema: { type: 'object', properties: { sheet_id: { type: 'string', description: 'Google Sheet ID' } }, required: ['sheet_id'] } },
{ name: 'sheets_list', description: 'list spreadsheets optionally filtered by name', inputSchema: { type: 'object', properties: { max_results: { type: 'number', description: 'max results default 20', default: 20 }, query: { type: 'string', description: 'search query to filter by name' } } } },
{ name: 'sheets_tab', description: 'add delete or rename sheet tab', inputSchema: { type: 'object', properties: { sheet_id: { type: 'string', description: 'Google Sheet ID' }, action: { type: 'string', enum: ['add', 'delete', 'rename'], description: 'action to perform' }, title: { type: 'string', description: 'tab title for add or new name for rename' }, sheet_name: { type: 'string', description: 'tab name for delete or rename' } }, required: ['sheet_id', 'action'] } },
{ name: 'sheets_clear', description: 'clear values from range optionally clear formatting', inputSchema: { type: 'object', properties: { sheet_id: { type: 'string', description: 'Google Sheet ID' }, range: { type: 'string', description: 'A1 range' }, clear_formats: { type: 'boolean', description: 'also clear formatting default false', default: false } }, required: ['sheet_id', 'range'] } },
{ name: 'sheets_format', description: 'format range colors fonts alignment borders number formats', inputSchema: { type: 'object', properties: { sheet_id: { type: 'string', description: 'Google Sheet ID' }, range: { type: 'string', description: 'A1 range' }, background_color: { type: 'string', description: 'background color hex' }, text_color: { type: 'string', description: 'text color hex' }, bold: { type: 'boolean', description: 'apply bold' }, italic: { type: 'boolean', description: 'apply italic' }, font_size: { type: 'number', description: 'font size in points' }, font_family: { type: 'string', description: 'font family name' }, horizontal_alignment: { type: 'string', enum: ['LEFT', 'CENTER', 'RIGHT'], description: 'horizontal alignment' }, vertical_alignment: { type: 'string', enum: ['TOP', 'MIDDLE', 'BOTTOM'], description: 'vertical alignment' }, wrap_strategy: { type: 'string', enum: ['OVERFLOW', 'CLIP', 'WRAP'], description: 'text wrap strategy' }, number_format: { type: 'object', description: 'number format type and pattern', properties: { type: { type: 'string', enum: ['NUMBER', 'CURRENCY', 'PERCENT', 'DATE', 'TIME', 'DATE_TIME', 'SCIENTIFIC', 'TEXT'] }, pattern: { type: 'string', description: 'format pattern' } } }, borders: { type: 'object', description: 'border settings', properties: { style: { type: 'string', enum: ['SOLID', 'SOLID_MEDIUM', 'SOLID_THICK', 'DASHED', 'DOTTED', 'DOUBLE'] }, color: { type: 'string', description: 'border color hex' }, inner: { type: 'boolean', description: 'also apply inner borders' } } } }, required: ['sheet_id', 'range'] } },
{ name: 'sheets_merge', description: 'merge or unmerge cells in range', inputSchema: { type: 'object', properties: { sheet_id: { type: 'string', description: 'Google Sheet ID' }, range: { type: 'string', description: 'A1 range' }, action: { type: 'string', enum: ['merge', 'unmerge'], description: 'merge or unmerge default merge', default: 'merge' } }, required: ['sheet_id', 'range'] } },
{ name: 'sheets_freeze', description: 'freeze rows and columns in tab 0 to unfreeze', inputSchema: { type: 'object', properties: { sheet_id: { type: 'string', description: 'Google Sheet ID' }, sheet_name: { type: 'string', description: 'tab name' }, rows: { type: 'number', description: 'rows to freeze 0 to unfreeze', default: 0 }, columns: { type: 'number', description: 'columns to freeze 0 to unfreeze', default: 0 } }, required: ['sheet_id', 'sheet_name'] } },
{ name: 'sheets_sort', description: 'sort range by column', inputSchema: { type: 'object', properties: { sheet_id: { type: 'string', description: 'Google Sheet ID' }, range: { type: 'string', description: 'A1 range' }, sort_column: { oneOf: [{ type: 'string', description: 'column letter A B' }, { type: 'number', description: 'column index 0-based' }], description: 'column to sort by' }, ascending: { type: 'boolean', description: 'sort ascending default true', default: true } }, required: ['sheet_id', 'range', 'sort_column'] } },
{ name: 'sheets_rows_cols', description: 'insert or delete rows or columns', inputSchema: { type: 'object', properties: { sheet_id: { type: 'string', description: 'Google Sheet ID' }, sheet_name: { type: 'string', description: 'tab name' }, action: { type: 'string', enum: ['insert', 'delete'], description: 'insert or delete' }, dimension: { type: 'string', enum: ['ROW', 'COLUMN'], description: 'rows or columns' }, start_index: { type: 'number', description: '0-based start index' }, count: { type: 'number', description: 'number to insert or delete' } }, required: ['sheet_id', 'sheet_name', 'action', 'dimension', 'start_index', 'count'] } },
{ name: 'sheets_dimension_size', description: 'set column width or row height in pixels', inputSchema: { type: 'object', properties: { sheet_id: { type: 'string', description: 'Google Sheet ID' }, sheet_name: { type: 'string', description: 'tab name' }, dimension: { type: 'string', enum: ['COLUMN', 'ROW'], description: 'column or row' }, start: { oneOf: [{ type: 'string' }, { type: 'number' }], description: 'start column letter or 0-based index for columns or 1-based row number for rows' }, end: { oneOf: [{ type: 'string' }, { type: 'number' }], description: 'end column letter or 0-based index for columns or 1-based row number for rows' }, size: { type: 'number', description: 'size in pixels' } }, required: ['sheet_id', 'sheet_name', 'dimension', 'start', 'end', 'size'] } },
{ name: 'sheets_get_formula', description: 'get cell formula and value', inputSchema: { type: 'object', properties: { sheet_id: { type: 'string', description: 'Google Sheet ID' }, cell: { type: 'string', description: 'cell reference A1 or Sheet1!B2' } }, required: ['sheet_id', 'cell'] } },
{ name: 'sheets_batch', description: 'execute multiple operations in one batch', inputSchema: { type: 'object', properties: { sheet_id: { type: 'string', description: 'Google Sheet ID' }, operations: { type: 'array', description: 'array of operations type setValue format with range values backgroundColor bold', items: { type: 'object' } } }, required: ['sheet_id', 'operations'] } }
];
export const GMAIL_TOOLS = [
{ name: 'gmail_list', description: 'list recent emails from inbox', inputSchema: { type: 'object', properties: { max_results: { type: 'number', description: 'max results default 20', default: 20 }, query: { type: 'string', description: 'search query same as Gmail search' }, label_ids: { type: 'array', items: { type: 'string' }, description: 'filter by labels INBOX SENT DRAFT etc' } } } },
{ name: 'gmail_search', description: 'search emails using Gmail search syntax', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'search query from: to: subject: has:attachment etc' }, max_results: { type: 'number', description: 'max results default 20', default: 20 } }, required: ['query'] } },
{ name: 'gmail_read', description: 'read full email content by message id', inputSchema: { type: 'object', properties: { message_id: { type: 'string', description: 'Gmail message id' }, format: { type: 'string', enum: ['full', 'metadata', 'minimal'], description: 'format default full', default: 'full' } }, required: ['message_id'] } },
{ name: 'gmail_get_attachments', description: 'list attachments in an email', inputSchema: { type: 'object', properties: { message_id: { type: 'string', description: 'Gmail message id' } }, required: ['message_id'] } },
{ name: 'gmail_download_attachment', description: 'download attachment content as base64', inputSchema: { type: 'object', properties: { message_id: { type: 'string', description: 'Gmail message id' }, attachment_id: { type: 'string', description: 'attachment id from gmail_get_attachments' } }, required: ['message_id', 'attachment_id'] } },
{ name: 'gmail_get_labels', description: 'list all email labels with visibility, counts, and color metadata', inputSchema: { type: 'object', properties: {} } },
{ name: 'gmail_create_label', description: 'create a Gmail label', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'label display name' }, label_list_visibility: { type: 'string', enum: ['labelHide', 'labelShow', 'labelShowIfUnread'], description: 'left-nav visibility' }, message_list_visibility: { type: 'string', enum: ['hide', 'show'], description: 'message list visibility' }, color: { type: 'object', properties: { text_color: { type: 'string', description: 'hex color like #000000' }, background_color: { type: 'string', description: 'hex color like #ffffff' } } } }, required: ['name'] } },
{ name: 'gmail_update_label', description: 'update an existing Gmail label', inputSchema: { type: 'object', properties: { label_id: { type: 'string', description: 'label id to update' }, name: { type: 'string', description: 'new label name' }, label_list_visibility: { type: 'string', enum: ['labelHide', 'labelShow', 'labelShowIfUnread'], description: 'left-nav visibility' }, message_list_visibility: { type: 'string', enum: ['hide', 'show'], description: 'message list visibility' }, color: { type: 'object', properties: { text_color: { type: 'string', description: 'hex color like #000000' }, background_color: { type: 'string', description: 'hex color like #ffffff' } } } }, required: ['label_id'] } },
{ name: 'gmail_delete_label', description: 'delete a Gmail label by id', inputSchema: { type: 'object', properties: { label_id: { type: 'string', description: 'label id to delete' } }, required: ['label_id'] } },
{ name: 'gmail_list_filters', description: 'list all Gmail filters', inputSchema: { type: 'object', properties: {} } },
{ name: 'gmail_get_filter', description: 'get one Gmail filter by id', inputSchema: { type: 'object', properties: { filter_id: { type: 'string', description: 'filter id' } }, required: ['filter_id'] } },
{ name: 'gmail_create_filter', description: 'create a Gmail filter with criteria and action', inputSchema: { type: 'object', properties: { criteria: { type: 'object', description: 'Gmail filter criteria (from, to, subject, query, negated_query, has_attachment, size, size_comparison)', properties: { from: { type: 'string' }, to: { type: 'string' }, subject: { type: 'string' }, query: { type: 'string' }, negated_query: { type: 'string' }, has_attachment: { type: 'boolean' }, size: { type: 'number' }, size_comparison: { type: 'string', enum: ['larger', 'smaller'] } } }, action: { type: 'object', description: 'Gmail filter action (add/remove labels, forward)', properties: { add_label_ids: { type: 'array', items: { type: 'string' } }, remove_label_ids: { type: 'array', items: { type: 'string' } }, forward: { type: 'string', description: 'forwarding address (must already be configured in Gmail)' } } } }, required: ['criteria', 'action'] } },
{ name: 'gmail_delete_filter', description: 'delete a Gmail filter by id', inputSchema: { type: 'object', properties: { filter_id: { type: 'string', description: 'filter id to delete' } }, required: ['filter_id'] } },
{ name: 'gmail_replace_filter', description: 'replace an existing Gmail filter (Gmail has no native update API)', inputSchema: { type: 'object', properties: { filter_id: { type: 'string', description: 'existing filter id to replace' }, criteria: { type: 'object', description: 'criteria fields to override (from, to, subject, query, negated_query, has_attachment, size, size_comparison)', properties: { from: { type: 'string' }, to: { type: 'string' }, subject: { type: 'string' }, query: { type: 'string' }, negated_query: { type: 'string' }, has_attachment: { type: 'boolean' }, size: { type: 'number' }, size_comparison: { type: 'string', enum: ['larger', 'smaller'] } } }, action: { type: 'object', description: 'action fields to override (add/remove labels, forward)', properties: { add_label_ids: { type: 'array', items: { type: 'string' } }, remove_label_ids: { type: 'array', items: { type: 'string' } }, forward: { type: 'string' } } } }, required: ['filter_id'] } },
{ name: 'gmail_send', description: 'send an email', inputSchema: { type: 'object', properties: { to: { type: 'string', description: 'recipient email address' }, subject: { type: 'string', description: 'email subject' }, body: { type: 'string', description: 'email body text' }, cc: { type: 'string', description: 'cc recipient' }, bcc: { type: 'string', description: 'bcc recipient' } }, required: ['to', 'subject', 'body'] } },
{ name: 'gmail_delete', description: 'permanently delete an email', inputSchema: { type: 'object', properties: { message_id: { type: 'string', description: 'Gmail message id' } }, required: ['message_id'] } },
{ name: 'gmail_trash', description: 'move email to trash', inputSchema: { type: 'object', properties: { message_id: { type: 'string', description: 'Gmail message id' } }, required: ['message_id'] } },
{ name: 'gmail_modify_labels', description: 'add or remove labels from email', inputSchema: { type: 'object', properties: { message_id: { type: 'string', description: 'Gmail message id' } , add_labels: { type: 'array', items: { type: 'string' }, description: 'label ids to add' }, remove_labels: { type: 'array', items: { type: 'string' }, description: 'label ids to remove' } }, required: ['message_id'] } },
{ name: 'gmail_bulk_modify_labels', description: 'bulk add or remove labels from emails matching a Gmail query', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Gmail query to match messages for bulk processing' }, add_labels: { type: 'array', items: { type: 'string' }, description: 'label ids to add to each matched message' }, remove_labels: { type: 'array', items: { type: 'string' }, description: 'label ids to remove from each matched message' }, max_results: { type: 'number', description: 'maximum matched messages to process (default 2000)', default: 2000 } }, required: ['query'] } },
{ name: 'gmail_draft', description: 'create a draft email', inputSchema: { type: 'object', properties: { to: { type: 'string', description: 'recipient email' }, subject: { type: 'string', description: 'email subject' }, body: { type: 'string', description: 'email body text' }, cc: { type: 'string', description: 'cc recipient' }, bcc: { type: 'string', description: 'bcc recipient' } }, required: ['to', 'subject', 'body'] } },
{ name: 'gmail_get_thread', description: 'get full thread content with all messages', inputSchema: { type: 'object', properties: { thread_id: { type: 'string', description: 'Gmail thread ID' }, format: { type: 'string', enum: ['full', 'metadata', 'minimal'], default: 'full' } }, required: ['thread_id'] } },
{ name: 'gmail_batch_get', description: 'get multiple emails by message IDs in one call', inputSchema: { type: 'object', properties: { message_ids: { type: 'array', items: { type: 'string' }, description: 'array of message IDs' }, format: { type: 'string', enum: ['full', 'metadata', 'minimal'], default: 'full' } }, required: ['message_ids'] } }
];