Commit Graph

71 Commits

Author SHA1 Message Date
Rein Lemmens
a9db471345 Add create_bullet_list operation to batch_update_doc
Exposes native Google Docs createParagraphBullets and
deleteParagraphBullets APIs via the batch operation manager.
Supports UNORDERED (bullets), ORDERED (numbered), and NONE
(remove formatting) list types with optional nesting levels.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 21:06:34 +01:00
Taylor Wilsdon
3d7fc02e84 refac for the better 2026-03-03 17:46:50 -05:00
Vishal Verma
10cdcdd7e5 Add support for GDoc Tabs 2026-03-03 09:12:31 -08:00
Taylor Wilsdon
5e4db385d3 refac 2026-03-01 12:50:40 -05:00
Max Ghenis
7b7fcfdb58 fix: add URL-to-ID extraction, comment_mode validation, and pipe escaping
Address CodeRabbit review feedback:
- Extract doc ID from full Google Docs URLs (e.g. /d/<id>/)
- Validate comment_mode against allowed values
- Escape pipe characters in table cell text

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 19:26:31 -08:00
Max Ghenis
08ad7ad308 feat(docs): add get_doc_as_markdown tool with comment context
Adds a new `get_doc_as_markdown` tool that converts Google Docs to clean
Markdown preserving formatting (headings, bold/italic/strikethrough, links,
code spans, ordered/unordered lists with nesting, and tables).

Optionally overlays comments with their anchor text (quotedFileContent) —
the specific text each comment is attached to — in two modes:
- inline: footnote-style references placed at the anchor text location
- appendix: all comments grouped at the bottom with blockquoted anchors

This gives AI agents full document context in a single tool call, unlike
get_doc_content which strips all formatting to plain text.

New files:
- gdocs/docs_markdown.py: Converter + comment formatting logic
- tests/gdocs/test_docs_markdown.py: 18 tests

Tool tier: extended (alongside search_docs, export_doc_to_pdf, etc.)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 19:15:56 -08:00
Taylor Wilsdon
de8865333c ruff 2026-02-17 14:49:59 -05:00
Taylor Wilsdon
40e827810a refac 2026-02-17 14:49:49 -05:00
Taylor Wilsdon
5340887658 refac 2026-02-08 19:00:52 -05:00
Taylor Wilsdon
47443730df refac 2026-02-08 18:53:47 -05:00
Taylor Wilsdon
be6a42e6e5 refac 2026-02-08 18:15:36 -05:00
Taylor Wilsdon
4112e67df2 nesting for paragraph styling 2026-02-08 17:38:20 -05:00
Taylor Wilsdon
b6ead2e23c pr feedback 2026-02-08 16:09:37 -05:00
Taylor Wilsdon
464bd8090f Add paragraph-level list formatting support to Google Docs
Enhanced the update_paragraph_style tool to support creating bulleted and
numbered lists with nested indentation levels (0-8). This enables agents to
create well-structured documents that match professional document styles.

Changes:
- Enhanced update_paragraph_style tool with:
  - create_list parameter: Create bulleted (UNORDERED) or numbered (ORDERED) lists
  - list_nesting_level parameter: Support nested list items (0-8 levels)
- Updated create_bullet_list_request helper to accept nesting_level parameter
- Updated documentation in README.md, docs/README.md, and docs/README_NEW.md
- Tool remains in Extended tier as defined in tool_tiers.yaml

This addresses the feature request to expose paragraph-level formatting
operations (named styles, bullets, indentation) that were previously missing
from the character-level modify_doc_text tool.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08 15:42:58 -05:00
Gigi Sayfan
34957de2e4 Add hyperlink support to modify_doc_text 2026-02-07 13:44:09 -08:00
Taylor Wilsdon
57e1d41c55 refac into single component 2026-02-01 14:47:32 -05:00
Taylor Wilsdon
1197518473 ruff 2026-02-01 12:07:00 -05:00
leolln
08f8ad5265 refactor(docs): remove redundant formatting tools
Per maintainer feedback (@taylorwilsdon):
- Delete format_text_style (redundant with modify_doc_text)
- Delete create_list (redundant with insert_doc_elements)
- Delete remove_list_formatting (use batch_update_doc)
- Delete _hex_to_rgb helper (use existing _normalize_color)

Preserved unique tools:
- format_paragraph_style (paragraph-level properties)
- apply_heading_style (named styles H1-H6)
- import_to_google_doc (new import feature)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-16 17:47:28 +00:00
leolln
6678b96d65 feat(docs,drive): add styling tools and import_to_google_doc
Google Docs styling tools:
- format_text_style: Rich text formatting (bold, italic, underline, colors, fonts)
- format_paragraph_style: Paragraph formatting (alignment, spacing, indentation)
- apply_heading_style: Apply H1-H6 heading styles using namedStyleType
- create_list: Convert paragraphs to bullet/numbered lists with visual indentation
- remove_list_formatting: Remove list formatting from paragraphs

Google Drive import tool:
- import_to_google_doc: Import files (MD, DOCX, TXT, HTML, RTF, ODT) as native
  Google Docs with automatic format conversion by Google Drive

Security:
- SSRF protection for file_url parameter (blocks localhost and private IPs)

All tools include input validation, error handling, and comprehensive docstrings.
2026-01-16 17:47:28 +00:00
Taylor Wilsdon
bf4fc86989 Update gdocs/docs_tools.py 2025-12-27 10:18:18 -08:00
Taylor Wilsdon
7a26d4c128 Update gdocs/docs_tools.py 2025-12-27 10:18:13 -08:00
Jonathan Siegel
a4f0c66c55 fix: remove invalid supportsAllDrives param from export_media()
The Google Drive API export_media() method does not accept the
supportsAllDrives parameter (unlike get(), list(), create(), etc.).

This caused export_doc_to_pdf to fail with:
  "Got an unexpected keyword argument supportsAllDrives"

The fix removes the invalid parameter. File access for shared drives
is already validated by the preceding files().get() call which does
use supportsAllDrives=True.

Tested with Google Docs in shared drives - exports work correctly.
2025-12-26 21:19:32 +09:00
Olivier Schiavo
72999a1531 fix: simplify color in modify_color 2025-12-22 09:37:25 +01:00
Olivier Schiavo
c63021c530 fix: color typing 2025-12-16 10:26:20 +01:00
Taylor Wilsdon
6b8352a354 apply ruff formatting 2025-12-13 13:49:28 -08:00
Taylor Wilsdon
5f59b4e9a7 fix imports 2025-12-13 11:21:35 -08:00
Taylor Wilsdon
1ed965926b merge 2025-12-13 10:50:51 -08:00
Olivier Schiavo
c528fe5bc4 fix: tab title 2025-12-12 16:07:51 +01:00
Olivier Schiavo
7e2f9cdd96 feat: use colors in gdocs 2025-11-27 17:26:35 +01:00
Taylor Wilsdon
8363ae1c06 add additional bits 2025-11-04 10:36:49 -05:00
Taylor Wilsdon
24d79ab470 All Drive API operations now include supportsAllDrives=True 2025-11-04 10:19:37 -05:00
Taylor Wilsdon
ff7ced33e5 yank optional 2025-09-28 15:38:39 -04:00
Taylor Wilsdon
db6861c33b typing to resolve #197 2025-09-28 15:34:19 -04:00
Taylor Wilsdon
d05409a93a avoid recreating file object 2025-08-23 10:16:32 -04:00
Emanuilo Jovanovic
4c5ad0ae78 feat: add docs pdf export 2025-08-21 12:31:55 +02:00
Taylor Wilsdon
985228046e improve logic a bit, cleanup 2025-08-14 10:22:20 -04:00
Taylor Wilsdon
8ff093dc20 ruff check fixes 2025-08-12 09:37:20 -04:00
Taylor Wilsdon
6022d2c7d9 consolidate the doc modification functions 2025-08-10 16:22:27 -04:00
Taylor Wilsdon
5bcd149f40 lots of fixes 2025-08-10 15:56:18 -04:00
Taylor Wilsdon
543f85ac1c helpers for formatting 2025-08-10 15:33:11 -04:00
Taylor Wilsdon
e29ff043fd refactor into modules 2025-08-10 15:21:10 -04:00
Taylor Wilsdon
d67e1fcf0f clean up docstrings 2025-08-10 14:35:56 -04:00
Taylor Wilsdon
6fe2fcdfa2 creating tables actually working reliably 2025-08-10 14:21:01 -04:00
Taylor Wilsdon
fcf407201d Update gdocs/docs_tools.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-10 10:36:41 -04:00
Rob Sherman
f369ca1635 feat(docs): add comprehensive Google Docs editing capabilities
Add full document editing and manipulation support to Google Docs tools,
expanding beyond read-only operations to match Google Docs API capabilities.

Features added:
- Text operations: update_doc_text, find_and_replace_doc, format_doc_text
- Structural elements: insert_doc_elements, insert_doc_image
- Document management: update_doc_headers_footers, batch_update_doc
- Helper functions module for common document operations

Changes:
- gdocs/docs_tools.py: Add 7 new editing functions with comprehensive error handling
- gdocs/docs_helpers.py: New helper module with utility functions for document operations
- README.md: Update Google Docs description to include full editing capabilities
- CLAUDE.md: Add comprehensive documentation for new editing features
- .mcp.json: Add MCP server configuration file
- .gitignore: Resolve merge conflicts from upstream sync
- uv.lock: Update dependencies from upstream merge

The implementation uses Google Docs API batchUpdate operations for atomic
document modifications and maintains compatibility with existing authentication
and error handling patterns.

All new tools follow the established @require_google_service decorator pattern
and include proper scope management for write operations.
2025-08-09 17:57:34 -07:00
Taylor Wilsdon
dad52829f8 oauth2.1 working - quick flow in mcp inspector 2025-08-02 09:52:16 -04:00
Taylor Wilsdon
8d053680c0 merge 2025-08-01 13:19:09 -04:00
Taylor Wilsdon
b4743d2f16 add instructions for llm if api not enabled 2025-07-28 11:49:01 -04:00
Taylor Wilsdon
61d1f05fdf ruff fixes 2025-07-23 14:36:32 -04:00
Taylor Wilsdon
1b59b2d30c tab header format and level parameter 2025-07-19 19:41:25 -04:00