Skip to content

fix: add document bounds validation for text modification#414

Draft
m-ghalib wants to merge 10 commits intotaylorwilsdon:mainfrom
m-ghalib:fix/docs-bounds-validation
Draft

fix: add document bounds validation for text modification#414
m-ghalib wants to merge 10 commits intotaylorwilsdon:mainfrom
m-ghalib:fix/docs-bounds-validation

Conversation

@m-ghalib
Copy link

@m-ghalib m-ghalib commented Feb 2, 2026

Summary

  • Add _get_document_length helper to fetch actual document length
  • Validate end_index against document bounds before delete/replace operations
  • Prevents API errors from invalid index ranges exceeding document length

Test plan

  • Test text replacement with valid index range
  • Test text replacement with end_index exceeding document length (should return error)
  • Test formatting with valid index range

🤖 Generated with Claude Code

Momin Ghalib and others added 8 commits February 1, 2026 16:26
…chat, search, appscript)

Remove 47 tools across 6 services to streamline the codebase:
- gtasks (Google Tasks) - 8 tools
- gcontacts (Google Contacts) - 9 tools
- gforms (Google Forms) - 6 tools
- gchat (Google Chat) - 4 tools
- gsearch (Google Custom Search) - 3 tools
- gappsscript (Google Apps Script) - 17 tools

Changes:
- Delete module directories and test files
- Update main.py and fastmcp_server.py entry points
- Remove OAuth scopes from auth/scopes.py and auth/service_decorator.py
- Clean tool_tiers.yaml configuration
- Update README.md and README_NEW.md documentation
- Remove log formatter prefixes
- Update helm chart values.yaml

Remaining services: gmail, drive, calendar, docs, sheets, slides

BREAKING CHANGE: Removes support for Tasks, Contacts, Forms, Chat, Custom Search, and Apps Script APIs

Co-Authored-By: Claude <[email protected]>
- Remove 7 Google Drive sharing/permissions tools (share, permissions, ownership)
- Add header/footer management tools for Google Docs
- Add advanced table operations (merge cells, styling)
- Expand table operation tests
- Update documentation to reflect API changes

Co-Authored-By: Claude <[email protected]>
Remove unnecessary environment variables and volume mounts.

Co-Authored-By: Claude <[email protected]>
- Update docker-compose.yml to reference GOOGLE_OAUTH_CLIENT_ID and GOOGLE_OAUTH_CLIENT_SECRET from .env file
- Add .env.example template with placeholder values
- Prevents accidental credential exposure in version control

Co-Authored-By: Claude <[email protected]>
- Add create_paragraph_bullets tool to convert text to bullet/numbered lists
- Fix table cell style request structure with proper tableRange wrapper
- Enhance get_drive_file_download_url with flexible output modes:
  - base64: Return content as base64 string
  - url: Save file and return HTTP URL
  - auto: Intelligently choose based on file size (500KB threshold)

Co-Authored-By: Claude <[email protected]>
Fetch document length before delete/replace operations to validate
that end_index does not exceed actual document bounds, preventing
API errors from invalid index ranges.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@taylorwilsdon taylorwilsdon marked this pull request as draft February 2, 2026 03:03
Momin Ghalib and others added 2 commits February 1, 2026 22:28
- Replace 12 app-specific comment tools with 4 unified tools (read_comments,
  create_comment, reply_to_comment, resolve_comment) that work via Drive API
- Consolidate Gmail batch tools: get_gmail_message_content now accepts single
  ID or list, removing need for separate get_gmail_messages_content_batch
- Same consolidation for get_gmail_thread_content and modify_gmail_message_labels
- Add delete_doc_content tool for dedicated content deletion
- Update documentation and tool tiers to reflect simplified API surface

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Repository owner deleted a comment from kapilthakare-cyberpunk Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant